Repository navigation
Conversation
KelboLive
left a comment
There was a problem hiding this comment.
Identical to #2866 (31e64fcf0), which I reviewed: the depth-prime ordering is right and the suite is green, and merge-tree is clean. Two things from there still stand: there is still no regression test (reverting the ordering stays green), and the bake-path comment is missing. Main has since changed draw.rs (indirect batches), so a rebase plus a re-run of the lib suite is worth doing before merge.
|
Thanks — both points are accurate: the ordering is a state decision a GPU-less suite cannot see, so reverting it stays green, and the bake-path comment is missing. AI-assisted. |
… read A read-only depth target that a draw's shaders read through a heap-indexed view could be left in DEPTH_READ without SHADER_RESOURCE. The textures picked by index are brought up to date at the start of `State::bind`, before `TESTED_DEPTH` was set for the draw; their views go through `readable`, which marks the depth read (and keeps SHADER_RESOURCE in the state) only when the target it holds is this draw's. It held the previous draw's, so the read was not marked, and `State::prepare_for` then moved the target to DEPTH_READ alone. Set the draw's tested depth before `early_textures`, so the pass reads it with the draw it belongs to. The state decision in `prepare_for` and the states `readable` picks are unchanged.
31e64fc to
4d637c3
Compare
|
Rebased on On the regression test: there is no honest device-free seam. The ordering only matters inside |
KelboLive's review of ProjectLeonida#2866: with the prime in place, `early_textures` runs `heap_textures` on the separate `bake_list`, so that upload list can also record the combined-state barrier for the depth target. It is harmless (same state, tracked per list; the draw's own list gets its transition in `prepare_for`), but the comment now says so. AI-assisted: yes
4d637c3 to
c62d573
Compare
Re-created from the original #2866.
aznohonza/mandy-contribwas made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, rebased onmainat913b88b90; current headc62d57344(the two commits on top of main). The original review thread is at #2866.State::bindbrings the textures picked by index up to date at its start, and those views go throughreadable(heap_textures, andflush_for_bakebefore it).readableis what notes that a draw reads a view of the depth target it only tests: it setsTESTED_DEPTH's read bit, and a read-only depth target then keepsSHADER_RESOURCEin the stateState::prepare_forgives it (DEPTH_READ | SHADER_RESOURCE).TESTED_DEPTHwas primed for the draw after that pass, so during it the cell still held the previous draw's target. A heap-indexed read of this draw's own depth target was therefore not marked, the pass left the target inSHADER_RESOURCEalone, andprepare_forthen moved it toDEPTH_READalone while the shader samples it.This moves the priming before
early_textures; the state decision inprepare_forand the statesreadablepicks are unchanged. Reads found by the table walk later inbindwere already covered, since that walk is after the priming.Reported in #2570 by @zmasi (
finding: read-only depth plus a heap-indexed read gets DEPTH_READ without SHADER_RESOURCE, pointing at this call).Verification: rebased over main's
draw.rsindirect-batch changes;cargo xwin test --target x86_64-pc-windows-msvc -p leonida-gpu --lib --no-runbuilds and the suite under Wine (no device here) gives 641 passed / 3 failed / 59 ignored. The three failures arewatch::*tests that fail identically on unmodifiedmainunder Wine (ran those three frommainto confirm). The pass itself could only be read-verified here; thed3d12CI job builds and runs the workspace's tests. No game data, no new switches.AI-assisted.