shader: verify depth occlusion between two translated mesh draws #633
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/639"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-22T17:04:38Z.
Change
Run two translated indexed mesh draws against one RGBA8 render target and one D32_FLOAT depth buffer. Each dispatch uses its own indexed geometry and PARAM0 color, with the existing translated attribute pixel shader. The harness clears once, enables LESS and depth writes, and reads back the full color and depth targets along with both position/index traces.
These are CPU references verified byte-for-byte against the final GPU readbacks. Reversing submission order produces the same color and depth. Exchanging the triangles' depths changes the winning color in the 190 overlapping pixels. The depth changes in 172 pixels that are covered by just one triangle; the minimum depth in the overlap is unchanged.
Verification
Tested
64235bbon baseb03f754on Windows with RTX 4060 (32.0.16.1088) and WARP (10.0.26100.9818). Both matched all 1,024 pixels of both targets for all three scene variants. Keeping the stale color reference gave exactly 190 color mismatches and zero depth mismatches. Keeping only the stale depth reference gave zero color mismatches and 172 depth mismatches. Both controls preserved the expected mesh traces and completed with zero D3D12 debug warnings or errors.All 16 local mesh and depth-mask CTest entries passed. The existing LLVM 15 mesh-attribute binary fixture (the mesh input reused here), docs links and bidi checks passed.
Evidence and follow-up
The inputs and CPU pixel-center reference are source-built under the repository's MIT license. Reuses the indexed attribute pipeline from #546. The #633 texture work also touches the mesh draw harness; this branch builds independently from main. The fixture covers opaque triangles with distinct depths and LESS.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-22T17:34:37Z.
@descent81 Independent AMD (RDNA4) result on
64235bb. Measurements only, no code change.Environment
debug_layer=unavailable(Tools.Graphics.DirectXisNotPresenton this machine), so the negative controls ran without a clean debug layer. Same limitation as your RTX 4060 note.64235bbon baseb03f754.Commands
Observed
…for each of the three scene variants, matching the CPU reference byte-for-byte on both the full colour target and the full
D32_FLOATdepth target.WARP in the same build:
adapter=Microsoft Basic Render Driver vendor=1414 device=008c, driver 10.0.26100.9711, identical counts.Negative controls
Both controls fail exactly where your report says they should:
190 and 172 are the same numbers you measured on the RTX 4060, on a different vendor and a different depth-buffer implementation. So the controls are detecting the intended fault, not an adapter artefact.
Conclusion
The depth interaction between two translated indexed mesh draws holds on RDNA 4:
LESSwith depth writes, per-draw PARAM0 colour, submission-order independence, and the overlap bookkeeping (190 overlapping pixels, 172 single-coverage pixels, unchanged minimum depth in the overlap) all reproduce.One honest gap: the harness prints no per-case label, so I can report only that all three scene variants produced
mismatches=0on both targets — I cannot attribute the counts to a named variant from the output alone.AI-assisted; runs executed locally.