Skip to content

Reflections: clear the left-out miss program's output instead of leaving earlier frames' bytes (#2440) - #2764

Open
milesah3ad wants to merge 2 commits into
trustno1-coder:mainfrom
milesah3ad:fix-glass-reflections
Open

milesah3ad wants to merge 2 commits into
trustno1-coder:mainfrom
milesah3ad:fix-glass-reflections

Conversation

@milesah3ad

@milesah3ad milesah3ad commented Nov 29, 2026 •

Copy link
Copy Markdown

Fixes #2440. Fixes #2224. Fixes #2272. Fixes #2643. Fixes #2661. Fixes #2758. Related: #2464 (suggested this approach), #2324, #2275 (the glass part).

Fixes the coloured blocks and smearing on glass from #2440, following the direction in #2464 (section 1).

Cause. Since e2d7854, the reflections' miss program (CS_RayMiss) is left out for the opaque and alpha layers (VICTORY_RAYMISS_KEEP=0, the white-grain fix for floors). Its output target then keeps whatever it held before. Every texel the screen-space resolve doesn't write shows earlier frames' bytes, which appears as blocks and smearing on windows, car paint and glass. Running only the alpha layer doesn't help, because glass is drawn in the opaque layer with the floors (#2534, closed).

Change. In place of the left-out dispatch, the miss program's output (ambient::MISS_LIGHT) is cleared to zero with the existing host UAV clear (list::clear_uav_on_host, now pub(crate)). This covers both the direct and the indirect dispatch paths. Uncovered texels then hold "no reflection" instead of stale memory, and the floors keep the white-grain fix. The clear sets its own descriptor heaps, so the draw state rebinds the title's on the next bind (host_heaps_set = false). VICTORY_RAYMISS_ZERO=0 restores the old behaviour.

Tested. RTX 5080 16 GB, Ryzen 7 9800X3D, Series X 1440p, DLSS Quality, on 829188e, scripted run through the opening and the boat scene:

  • with the change, window reflections are clean, and the log shows reflections' miss program left out: its output cleared to zero instead;
  • with VICTORY_RAYMISS_ZERO=0 on the same build, the smearing is back;
  • no new artifacts. A shadow and texture flicker at edges appears in both runs, so it predates this change;
  • fps unchanged (one clear per left-out dispatch).

cargo check --release -p victory passes on main plus this change. The diagnostics build needs #2593.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YPhfiX2HTdGjHQHvB9b9DE

…ing earlier frames' bytes (trustno1-coder#2440)

Since e2d7854 the reflections' miss program (CS_RayMiss) is left out for
the opaque and alpha layers (VICTORY_RAYMISS_KEEP=0, the white-grain fix for
floors). Its output target then keeps whatever it held before, and every
texel the screen-space resolve does not write shows earlier frames' bytes:
coloured blocks and smearing on glass, car paint and windows (trustno1-coder#2440, trustno1-coder#2464).
Running the alpha layer only does not help, since glass is drawn in the
opaque layer with the floors (PR trustno1-coder#2534, closed).

In place of the left-out dispatch (direct and indirect), its output
(ambient::MISS_LIGHT) is cleared to zero with the existing host UAV clear,
as trustno1-coder#2464 suggested: uncovered texels hold "no reflection". The floors keep
the white-grain fix. VICTORY_RAYMISS_ZERO=0 turns it off.

Tested on an RTX 5080 / 9800X3D, Series X 1440p, DLSS Quality, 829188e:
window reflections clean with it, smearing back with VICTORY_RAYMISS_ZERO=0;
no new artifacts (an edge flicker seen in both runs predates it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YPhfiX2HTdGjHQHvB9b9DE
@jbr589

jbr589 commented Nov 29, 2026

Copy link
Copy Markdown

Verified on an RTX 3060 12 GB (issue #2758), Windows 11 driver 621.40, Series S, DLSS Performance, frame generation off, ray tracing off.

The orange/red garbage in reflections reproduces on the v2026.11.29.01 release (in a cutscene, on every reflective surface) and is gone with this change; the log shows reflections' miss program left out: its output cleared to zero instead, and reflections render clean.

I couldn't check an interior floor in this cutscene (none visible), but clearing to zero instead of running CS_RayMiss keeps the white-grain fix, so floors should not brighten (unlike VICTORY_RAYMISS_KEEP=1).

cargo build --release -p victory passes; cargo test -p victory-gpu --lib → 914 passed, 1 unrelated flaky test in watch.rs (not touched by this change; passes in isolation).

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @jbr589 for testing on the RTX 3060 / Series S. Good to have it confirmed on a second card and profile. I've added #2758 to the issues this fixes. On floors: our runs on an RTX 5080 kept the floors as they are on main (no brightening), since the floor fix itself is untouched.

James5618 pushed a commit to James5618/Vice-Tay that referenced this pull request Nov 29, 2026
…ing earlier frames' bytes (#2440)

Since e2d7854 the reflections' miss program (CS_RayMiss) is left out for
the opaque and alpha layers (VICTORY_RAYMISS_KEEP=0, the white-grain fix for
floors). Its output target then keeps whatever it held before, and every
texel the screen-space resolve does not write shows earlier frames' bytes:
coloured blocks and smearing on glass, car paint and windows (#2440, #2464).
Running the alpha layer only does not help, since glass is drawn in the
opaque layer with the floors (PR #2534, closed).

In place of the left-out dispatch (direct and indirect), its output
(ambient::MISS_LIGHT) is cleared to zero with the existing host UAV clear,
as #2464 suggested: uncovered texels hold "no reflection". The floors keep
the white-grain fix. VICTORY_RAYMISS_ZERO=0 turns it off.

Tested on an RTX 5080 / 9800X3D, Series X 1440p, DLSS Quality, 829188e:
window reflections clean with it, smearing back with VICTORY_RAYMISS_ZERO=0;
no new artifacts (an edge flicker seen in both runs predates it).

From trustno1-coder/VIctory-NVIDIA#2764. Taken for the blue blocks on windows
seen on the RTX PRO 5000 laptop with v2026.11.29.01 (VICTORY_RAYMISS_ZERO=0
turns it off for an A/B).

(cherry picked from commit 8715a9d7b983ac62a39e43cbbd3a3b674b5defac)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NovNovikov

Copy link
Copy Markdown

Does the fix work on a new release?

@milesah3ad

Copy link
Copy Markdown
Author

@NovNovikov Yes. v2026.11.29.02 doesn't touch the reflection code (its 10 commits since 829188e change list.rs elsewhere, not the miss-program path), and this PR still merges cleanly onto main, which is the .02 hotfix. So the glass blocks are still there on .02 without it, and this change clears them the same way on .02.

@Eliauk0

Eliauk0 commented Nov 29, 2026

Copy link
Copy Markdown

Confirmed fixed, on both versions.

Config: 7800x3D, RTX 5070 Ti, driver 621.40,, Series X, 4K + DLSS Perf + FG 3x.

  • v2026.11.29.01: coloured blocks and smearing on glass/windows/car paint gone; log shows reflections' miss program left out: its output cleared to zero instead; floors unchanged.
  • v2026.11.29.02: merged clean, same result — artifacts gone, floors unchanged. Without the PR they come back on both.

Thanks!

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @Eliauk0! That's the first confirmation on v2026.11.29.02, and with frame generation on. So far it's verified on an RTX 5080, a 3060 and a 5070 Ti, Series S and X, with no floor brightening.

@atorata

atorata commented Nov 29, 2026

Copy link
Copy Markdown

Tested on Linux, RTX 3060 12 GB (Ampere), NVIDIA 620.73.04, CachyOS, Proton Experimental 11.0-20261112 with vkd3d-proton master 71cae091b. Series S, DLSS Quality (1280x720 to 1920x1080), FSR 3 frame generation 2x, ray tracing off. This PR applied on 829188e (cleanly; it also applies cleanly on v2026.11.29.02 / f889bb07).

  • Before: in a 60-frame screenshot burst on the street with the bus and the RV, their windows showed the coloured blocks in about a dozen frames.
  • After: the log has reflections' miss program left out: its output cleared to zero instead (VICTORY_RAYMISS_ZERO=0: not), and in a 60-frame burst along a busy road (tow truck, pickups, SUV, taxi, semi cabs, shop windows) no glass showed the blocks. Windows read as dark glass with a faint reflection.
  • No GPU fault (Xid) in that run, and no change in frame rate I could measure (GPU-bound at about 11-13 fps there either way).

Not checked: indoor wooden floors specifically for the white grain, so I can't confirm that part on this card.

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @atorata, that's the first Linux / vkd3d-proton confirmation, so the clear works through the Vulkan path too. With your report that makes four independent tests: RTX 5080, 3060 (Windows and Linux), 5070 Ti; Series S and X; .01 and .02.

@milesah3ad

Copy link
Copy Markdown
Author

AMD confirmation from @saltdam36 on #2224: RX 7800 XT, Series S, FSR upscaler (#1236) on, VICTORY_RAYMISS_KEEP unset. Reflections in mirrors, windows and bottles are right, with no grain on floors, faces or eyes. That makes five setups: RTX 5080, 3060 (Windows and Linux/vkd3d-proton), 5070 Ti and RX 7800 XT; Series S and X; .01 and .02.

@Lyrnc

Lyrnc commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Tested on an RTX 5080 (driver 610.88, Windows 11), built from 829188e + this PR. Series S, DLSS Quality, ray tracing off, VICTORY_COMPILE_MEMORY=0. Each run used the same save and the same hands-off sequence (a dock with a house, then a cutscene with parked cars), about 5.5 min long. I captured frames and counted those with random-colour garbage (strongly magenta texels, which these scenes otherwise never have).

Run In-world frames with garbage
Series S, 829188e as is 48 of 208 (the house windows glow purple, the parked pickup's and van's windows show red and purple blocks)
Series S, this PR 0 of 223. The same windows are dark and natural, with no visible darkening of wood or floors.
Series X, 829188e without any clear 0 of 167 (not affected, as reported)

The "not at the usual place" line never fired in this scene. Two small hardening ideas:

  • When the UAV is not at (1, 104), fall back to the first 2D R11G11B10 UAV in the tables, as ambient does.
  • clear_uav_on_host returns false unless the texture is already in UNORDERED_ACCESS. A once! log on that path would show if a clear is ever skipped.

#3058 (keep the sky miss while the structure builder runs) fits well alongside this, so ray-traced misses still get the sky instead of zero.

I had written the same fix independently (Lyrnc/VIctory-NVIDIA fix/glass-noise-regression: it binds the image, then clears it). It gave the same result, 0 of 215 on Series S, so I won't open a second PR.

AI use: Claude Code (Claude Opus 5.5) built both versions, ran the hands-off A/B runs, counted the frames and wrote this comment.

…ts usual place; log a skipped clear

Review suggestions on trustno1-coder#2764 (Lyrnc): when the miss program's output is
not at (1, 104), the first 2D R11G11B10 unordered image in its tables is
cleared (the variant search ambient already uses), and a clear that
cannot be recorded (the texture not in the unordered state) is said once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YPhfiX2HTdGjHQHvB9b9DE
@milesah3ad

Copy link
Copy Markdown
Author

Thanks @Lyrnc, great measurement (48/208 → 0/223 on Series S). Both suggestions are in now: when the output isn't at (1, 104), the first 2D R11G11B10 unordered image in the tables is cleared (the same variant search ambient uses), and a clear that can't be recorded logs once instead of failing silently. Agreed that #3058 fits alongside this.

@ChenmouXu

Copy link
Copy Markdown

Confirmed on an RTX 5070 Ti Laptop -- glass is clean here too, and the floors do not brighten

Hardware: RTX 5070 Ti Laptop (Blackwell), driver 32.0.16.2140 (GeForce 610.x branch, 2026-11-21), Ryzen 9 9955HX, Windows 11 26200.
Build: 41adb55 with this patch applied on top (git apply, clean), release build, shader cache translated with victory shaders.
Settings: Series S profile, DLSS Quality (0.667), DLSS frame generation 6X, VICTORY_ASYNC_SUBMIT=1, borderless fullscreen, the 46 baseline variables from the GKinto profile. 9,881 draws/frame in the sample below.

Result: glass is clean, every surface that was bad on 829188e is normal.

  • Car windscreen and side windows: clear, the interior is visible through them -- on 829188e these were dense purple-green speckle.
  • Mirror chrome, paint and shop windows: normal.
  • Floors: no brightening visible compared with e1f2eb6, so the white-grain fix is intact.

The log confirms the new path rather than the old one:

WARN victory_gpu::draw: reflections' miss program left out for opaque and transparent surfaces
WARN victory_gpu::draw: reflections' miss program left out: its output cleared to zero instead

Nothing else regressed that I can see: ~10 fps render at 9,881 draws (101 ms), 6X presenting 59 fps, no device loss, no pipeline refusals beyond the usual ray-tracing ones. Frame time looks the same as e1f2eb6 within the spread between scenes, so the clear does not appear to cost anything measurable here.

Screenshot attached (sunset street, red pickup): windscreen and side glass clean. For reference the "before" frames are on #2661 -- same card, same driver, 829188e unpatched.

One data point you may want: this card drops 6X to 2X occasionally (19 times in 797 frames on the previous build), so if you test here expect the presented rate to move around; that is the driver's MFG headroom, not this patch.
Uploading fixed-glass.png…

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @ChenmouXu! That makes six independent confirmations (RTX 5080 ×2, 5070 Ti desktop + laptop, 3060 on Windows and Linux, RX 7800 XT), now including 6× frame generation and async submit, with no floor brightening and no frame-time cost.

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @tphira612 for the before/after captures on the RTX 4090, that's exactly the case (stale blocks on indoor glass) and a clear comparison.

@Fr0zenForest

Copy link
Copy Markdown

Confirmed fixed for me on an RTX 4080 Laptop GPU with ab342fb7 . On v2026.11.29.01 , I saw red and green blocks on the patrol car windows during the cutscene with the two officers. With this build, I no longer see those artifacts. I left VICTORY_ALIAS_TARGETS=1 enabled and didn’t need the VICTORY_RAYMISS_KEEP=1 workaround.

Setup: Ryzen 9 7945HX, RTX 4080 Laptop GPU (12 GB, driver 610.74), 32 GB RAM. Series S profile, DLSS Quality (1280×720 → 1920×1080), frame generation off.

The log confirms the new path: reflections' miss program left out: its output cleared to zero instead.

Thanks for the fix!

@milesah3ad

Copy link
Copy Markdown
Author

Thanks @Fr0zenForest, good to have it on a 4080 Laptop and with VICTORY_ALIAS_TARGETS=1 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment