Repository navigation
Conversation
…ogram would have written With no ray-tracing structures the miss program is left out so its sky light does not grain floors, but then its image keeps earlier frames' bytes: on glass and windows that is coloured blocks that flicker as the view moves (trustno1-coder#2440). The switch clears that image where the dispatch would have run, so the screen-space resolve writes over a known unlit value.
…e once The reflections' image is a view in the heap the title last set, and a draw of another pipeline may have bound another heap since. The clear now binds the host's for the title's before it dispatches: `State::host_heaps`, lifted out of `bind` so the same check serves both. The image size is said once, at the image `miss_image` finds.
|
I applied both commits of
The native row exercises the D3D12 clear in isolation. Both #2764 commits also apply cleanly to 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. |
What 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.