shader: verify depth occlusion between two translated mesh draws #639

Manually merged
github merged 2 commits from gh-pr/639/head into gh-pr/639/base 2026-11-26 22:07:58 +00:00
Owner

@⁠descent81 on GitHub · 2026-11-22 17:04 UTC · original
descent81:mesh/depth-occlusion → main · +190 −7 · 7 files · 2 commits · merged 2026-11-22 17:31 UTC

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.

Color references before and after exchanging triangle depths

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 64235bb on base b03f754 on 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.

ctest --preset dev --no-tests=error -R '^(mesh_.+|depth_mask_draw)_(hardware|warp)$' -V

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.

**@⁠descent81** on GitHub · 2026-11-22 17:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/639) `descent81:mesh/depth-occlusion` → `main` · +190 −7 · 7 files · 2 commits · merged 2026-11-22 17:31 UTC ## 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. ![Color references before and after exchanging triangle depths](https://raw.githubusercontent.com/descent81/Xbox2Windows/64235bb/docs/mesh-depth-pair-reference.png) 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 `64235bb` on base `b03f754` on 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. ```powershell ctest --preset dev --no-tests=error -R '^(mesh_.+|depth_mask_draw)_(hardware|warp)$' -V ``` ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:07:57 +00:00
github manually merged commit fc62f1657c into gh-pr/639/base 2026-11-26 22:07:58 +00:00
Author
Owner

@⁠thepatrickworld on GitHub · 2026-11-22 17:34 UTC · original

@⁠descent81 Independent AMD (RDNA4) result on 64235bb. Measurements only, no code change.

Environment

  • Windows 11 25H2, build 26200.9711
  • MSVC 19.44.35230 (toolset 14.44.35207), Windows SDK 10.0.26100.0, DXC 1.9.2602.17
  • AMD Radeon RX 9070 XT, vendor 1002, device 7550, driver 32.0.32029.2010
  • debug_layer=unavailable (Tools.Graphics.DirectX is NotPresent on this machine), so the negative controls ran without a clean debug layer. Same limitation as your RTX 4060 note.
  • Clean worktree of the PR head 64235bb on base b03f754.

Commands

cmake --preset dev
cmake --build --preset dev --parallel 12 --target offscreen_check
set XBOX2WINDOWS_ADAPTER=AMD Radeon RX 9070 XT
ctest --preset dev --no-tests=error -V -R "^mesh_depth_pair_(hardware|warp)$"

Observed

1/2 Test #226: mesh_depth_pair_hardware ... Passed  1.38 sec
2/2 Test #252: mesh_depth_pair_warp ....... Passed  0.78 sec

adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550  driver=32.0.32029.2010
pixels=1024 mismatches=0
depth_pixels=1024 depth_mismatches=0

…for each of the three scene variants, matching the CPU reference byte-for-byte on both the full colour target and the full D32_FLOAT depth 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:

Expected failure: Draw reference mismatch,  color=190, depth=0
Expected failure: Depth reference mismatch, color=0,   depth=172

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: LESS with 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=0 on both targets — I cannot attribute the counts to a named variant from the output alone.

AI-assisted; runs executed locally.

**@⁠thepatrickworld** on GitHub · 2026-11-22 17:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/639#issuecomment-7082943622) @⁠descent81 **Independent AMD (RDNA4) result on `64235bb`.** Measurements only, no code change. ### Environment - Windows 11 25H2, build **26200.9711** - MSVC **19.44.35230** (toolset 14.44.35207), Windows SDK 10.0.26100.0, DXC **1.9.2602.17** - **AMD Radeon RX 9070 XT**, vendor 1002, device 7550, driver **32.0.32029.2010** - `debug_layer=unavailable` (`Tools.Graphics.DirectX` is `NotPresent` on this machine), so the negative controls ran without a clean debug layer. Same limitation as your RTX 4060 note. - Clean worktree of the PR head `64235bb` on base `b03f754`. ### Commands ``` cmake --preset dev cmake --build --preset dev --parallel 12 --target offscreen_check set XBOX2WINDOWS_ADAPTER=AMD Radeon RX 9070 XT ctest --preset dev --no-tests=error -V -R "^mesh_depth_pair_(hardware|warp)$" ``` ### Observed ``` 1/2 Test #226: mesh_depth_pair_hardware ... Passed 1.38 sec 2/2 Test #252: mesh_depth_pair_warp ....... Passed 0.78 sec adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550 driver=32.0.32029.2010 pixels=1024 mismatches=0 depth_pixels=1024 depth_mismatches=0 ``` …for each of the three scene variants, matching the CPU reference byte-for-byte on both the full colour target and the full `D32_FLOAT` depth 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: ``` Expected failure: Draw reference mismatch, color=190, depth=0 Expected failure: Depth reference mismatch, color=0, depth=172 ``` **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: `LESS` with 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=0` on both targets — I cannot attribute the counts to a named variant from the output alone. _AI-assisted; runs executed locally._
This discussion has been locked. Commenting is limited to contributors.
No description provided.