Repository navigation
gpu: drop neon green and blue garbage from the probe resolve on request - #2904
Conversation
The light pass already drops magenta from what the title's probe resolve left (LEONIDA_AMBIENT_MAGENTA, on). LEONIDA_AMBIENT_GREEN=1 drops a green far above red and blue, LEONIDA_AMBIENT_BLUE=1 a blue far above green and above red, with the thresholds of lobomfz/VIctory-xmem 5a60834 (from coastingVI via dfmbrollins/victory-linux-nvidia, GPL-3.0). Both are off by default: the garbage was seen on Linux with RADV, not yet on a Windows driver, and a strongly green or blue light that is real would be dropped too. A new test compiles the part with every drop on and off; it fails when a define the shader reads is missing. On an RX 6800 (Windows 11, driver 32.0.21030.2001) with both on, a save loaded into the world: the light passes were made with the drops compiled in, and the picture showed nothing wrong over about 4 minutes. No frame was compared with them off.
b563b6d to
fe61206
Compare
KelboLive
left a comment
There was a problem hiding this comment.
The port is faithful — the thresholds match lobomfz/VIctory-xmem 5a60834 exactly (g > 1.8*max(r,b), b > 2.5*g && b > r, floors 0.05/0.02; upstream ships green+blue on by default, this makes all three opt-in) — and it is on the right path: the drops act on was only, inside raise, which is dispatched only for Role::Resolve (ambient.rs:847-852); constant mode returns before reading was (:569-573), so no clear or present is touched and the fallback is the floored found, not black. The worst case is a genuinely strong green/blue probe being replaced by the 64×36 estimate, so default-off is the right call.
Two things to fix before merge:
- The new test is compile-only, and the guard has no behavioural coverage.
1.8 → 0.8(drops ordinary green light) leaves all 4 ambient tests green, and so doesif (GREEN_DROP) was = 0.0;(drops all leftover light whenever the switch is on). That is the case AGENTS.md asks to prove red before green. #2893's new test already dispatchesgatheron WARP and reads back — araisedispatch with one packed green pixel would test this for real without a game or a device. - The MAGENTA docs row is now wrong.
switches.mdregenerates bit-for-bit, but the magenta row carries thecolour_dropssentence ("which other colours…") truncated atLEONIDA_AMBIENT_BL…, so magenta's own row describes green/blue instead. Split the doc comment per switch.
Everything else checks out here: the exact HLSL compiles through D3DCompile in both define combinations, all pipelines build on the hardware adapter, the full crate suite is 633/0/59, clippy is clean in ambient.rs, check_no_game_data passes, and merge-tree against current main is clean (2 commits behind, neither touching these files). With #2893 it conflicts only on the test appended at the end of mod tests — trivial. Note switches.md is shared with 17 open PRs, so regenerate it at merge time.
No visual claim is made in the body, so this is opt-in plumbing with logic-level support only — which is fine, given it stays off by default.
|
Heads-up: this was merged at 17:14 UTC while main's CI was still running on #2874's merge (3d8ea10, merged 17:12). The maintaining guide in #2797 (draft) asks for one merge at a time, then waiting for main's CI, and for a merge by someone other than the author, so that a red main points at one PR. No harm seen so far; main's CI now covers both. Could we keep to that order from here on? (Posted by oreofr-agent, Claude Code, on OreoFR's request.) |
Item:
D3D12-AMBIENT-GREEN-BLUE-FILTER(claimed in #2570).The light pass already drops magenta from what the title's probe resolve left (
LEONIDA_AMBIENT_MAGENTA, on by default;d3d12/crates/leonida-gpu/src/ambient.rs). This adds two more colours:LEONIDA_AMBIENT_GREEN=1drops a green far above red and blue (g > 1.8 * max(r, b)andg > 0.05).LEONIDA_AMBIENT_BLUE=1drops a blue far above green and above red (b > 2.5 * g,b > randb > 0.02).The thresholds are those of lobomfz/VIctory-xmem
5a60834(from coastingVI via dfmbrollins/victory-linux-nvidia, GPL-3.0).Both are off by default. The garbage was seen on Linux with RADV, not yet on a Windows driver, and a strongly green or blue light that is real would be dropped too. The pass source is now built by one
source()function, so a test can compile it.Tested
cargo test -p leonida-gpu --lib ambient: 4 pass. The newthe_colour_drops_compilecompiles the part with every drop on and with every drop off, with the system's compiler and no device. It fails when a define the shader reads is missing, which I checked by renamingGREEN_DROPinsource().