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

Merged
descent81 merged 2 commits from upstream-pr/639 into main 2026-11-22 17:31:30 +00:00
descent81 commented 2026-11-22 17:04:38 +00:00 (Migrated from github.com)

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.

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6545204491 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/639). Originally posted by [descent81](https://github.com/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. ![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.
upstream-sync closed this pull request 2026-11-24 06:44:06 +00:00
thepatrickworld commented 2026-11-24 06:48:36 +00:00 (Migrated from github.com)

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

  • 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7082943622 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/639#issuecomment-7082943622). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-22T17:34:37Z. --- @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._
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!633
No description provided.