gpu: drop neon green and blue garbage from the probe resolve on request #2904
No reviewers
Labels
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2904
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2904"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ubiquitarianism on GitHub · 2026-12-01 16:55 UTC · original
ProjectLeonida:fix/ambient-green-blue-probes→main· +44 −11 · 2 files · 1 commits · merged 2026-12-01 17:14 UTCItem:
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().b563b6de3atofe612066ac@KelboLive on GitHub · 2026-12-01 17:18 UTC · original · reviewed
The port is faithful — the thresholds match lobomfz/VIctory-xmem
5a60834exactly (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 onwasonly, insideraise, which is dispatched only forRole::Resolve(ambient.rs:847-852);constantmode returns before readingwas(:569-573), so no clear or present is touched and the fallback is the flooredfound, 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:
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.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
D3DCompilein both define combinations, all pipelines build on the hardware adapter, the full crate suite is 633/0/59, clippy is clean inambient.rs,check_no_game_datapasses, andmerge-treeagainst current main is clean (2 commits behind, neither touching these files). With #2893 it conflicts only on the test appended at the end ofmod tests— trivial. Noteswitches.mdis 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.
@OreoFR on GitHub · 2026-12-01 17:19 UTC · original
Heads-up: this was merged at 17:14 UTC while main's CI was still running on #2874's merge (
3d8ea1031, 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.)