Reflections: VICTORY_RAYMISS_ZERO clears the image a left-out miss program would have written #2872
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2872
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2872"
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?
@Kam471 on GitHub · 2026-11-29 18:25 UTC · original
Kam471:reflections-raymiss-zero→main· +301 −42 · 2 files · 2 commits · openWhat this changes
VICTORY_RAYMISS_ZERO=1clears the reflections' image at the place in thelist where a left-out miss program would have written it.
Why
Since
e2d7854ethe reflections' miss program is left out for opaque andtransparent surfaces, so its sky light does not grain indoor floors seen at a
grazing angle (
draw.rs,sky_miss_left_out). Left out, its image keeps whatan earlier frame left there. For the rays the screen-space resolve does not
cover, that is the flickering red/green/purple blocks #2440 reports on windows
and glass, and what #2643, #2661 and #2275 report on other reflective surfaces.
Zero is neither the sky's light nor an earlier frame: the resolve still writes
what its march found over it, and what it does not cover is unlit — the same
every frame, so nothing flickers. The parquet floors the skip was for keep the
skip.
This is the direction #2534 was closed with: the layer constants do not split
glass from the floors (one dispatch fills the whole half-size target), so the
fix has to be at the dispatch rather than per layer. #2464's section 1 asks for
exactly this: give the dispatch's output zero instead of leaving the dispatch
out.
How
ambient::zerorecords a small compute pass (cs_5_1,DescriptorTable(UAV(u0))) over the image between the title's own UAVbarrier and one after it, at the place of the skipped dispatch. It replaces
the list's compute root signature and pipeline, as
ambient::afteralreadydoes.
State::miss_imagefinds the image the program would have written: its usualplace (
ambient::MISS_LIGHT), else the first 2D R11G11B10 UAV in its tables(a variant binds it elsewhere), with the size of the host texture.
State::host_heapsis lifted out ofbindso the clear can bind the heap thetitle last set before its table is addressed;
bindcalls the same function.the reflections' image is cleared where the miss program is left out (VICTORY_RAYMISS_ZERO).VICTORY_RAYMISS_KEEP=1still runs the program instead. The two are exclusive,KEEPfirst: with the program running the image is filled as before andnothing is cleared.
Default
Off, read with
asked_for!: a run that does not setVICTORY_RAYMISS_ZERO=1records nothing new. Turning it on by default should follow a play session on
#2440's spot (the stilt house's windows) and on the parquet floors the skip is
for; the switch is there so that can be done one machine at a time.
Tests
cargo test -p victory-gpu --lib ambient—the_clear_zeroes_every_texel(WARP: an 8x1 R11G11B10 image filled with
0xDEADBEEF, the clear's callsrecorded on a list, every texel reads back zero) and
the_passes_build,which now compiles
ZERO_SOURCEwith the estimate kernels.cargo test -p victory-gpu --libfor the whole crate.Refs #2440, #2464.
@andrewpozdnakov7-jpg on GitHub · 2026-11-30 11:17 UTC · original
I applied both commits of
99270e2on top of release/main41adb551(aab77d8) and ran the ambient suite on Windows. All 16 tests passed, including a WARP readback with a generated 17Г—11R11G11B10_FLOATimage. Each texel started with the same nonzero value.ClearUnorderedAccessViewFloat, as used by #2764The native row exercises the D3D12 clear in isolation. Both #2764 commits also apply cleanly to
41adb551ase409dff, andcargo check --locked -p victory --features diagnostics --target x86_64-pc-windows-msvccompleted.One coverage gap remains here. The direct branch records the clear when opted in. The indirect dispatch branch still returns without a clear. #2764 calls its clear in both places. Do indirect miss dispatches need the same treatment here, or is the scope direct dispatches only? I have no gameplay capture identifying an indirect miss dispatch.
AI-assisted with OpenAI Codex.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.