Fix bounds-only depth testing on D3D12 WARP #27

Open
HandshakeHackin wants to merge 79 commits from upstream-pr/27 into main
HandshakeHackin commented 2026-11-25 17:30:30 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-25T17:30:30Z.


The existing depth-bounds rendering test fails on unmodified beta c71c7d6 on the Windows software renderer. A draw whose stored depth is outside the bounds writes 255 to the render target when the expected value is 0.

For a pipeline with depth bounds, a known depth format, and ordinary depth comparison disabled, enable a read-only depth test with ALWAYS and a zero write mask. Give that combination a distinct pipeline-cache key so an older cached descriptor cannot be reused. The pixel regression now puts the triangle at 0.25 and the stored depth at 0.5, so it distinguishes which depth the bounds test reads. A descriptor test also covers ordinary depth testing, disabled bounds and a missing depth format.

Windows verification

I also tested this change together with #13, #14, #17, #18, #20, #21 and #25. Both strict Clippy passes and the 190-file asset check passed. The combined Windows workspace passed 584 tests, with 12 ignored and one physical-GPU-plus-WARP test filtered on this software-only runner. The release build and CLI smoke tests also passed.

Physical Radeon testing is still pending. Direct3D depth-bounds specification.

The depth regression uses shader model 6.0 for its vertex and pixel shaders so both Windows Server 2022 and 2025 WARP can run the same pixel readback.

<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:5496057358 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-25T17:30:30Z. --- The existing depth-bounds rendering test fails on unmodified beta `c71c7d6` on the Windows software renderer. A draw whose stored depth is outside the bounds writes 255 to the render target when the expected value is 0. For a pipeline with depth bounds, a known depth format, and ordinary depth comparison disabled, enable a read-only depth test with `ALWAYS` and a zero write mask. Give that combination a distinct pipeline-cache key so an older cached descriptor cannot be reused. The pixel regression now puts the triangle at 0.25 and the stored depth at 0.5, so it distinguishes which depth the bounds test reads. A descriptor test also covers ordinary depth testing, disabled bounds and a missing depth format. **Windows verification** - [Unmodified beta](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45662763978/job/139376715569) painted the out-of-range pixel. - [Four-case WARP comparison](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45663562406/job/139379555362) showed that enabling the read-only test fixed the pixel with both replayed and directly set bounds. - [Patched native GPU suite and explicit WARP readbacks](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45666204704/job/139388903100) passed. The GPU library recorded **155 passed, 3 ignored**. Forced WARP then measured **0 outside** and **255 inside**. I also tested this change together with #13, #14, #17, #18, #20, #21 and #25. Both strict Clippy passes and the 190-file asset check passed. The [combined Windows workspace](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45666204704/job/139388902478) passed 584 tests, with 12 ignored and one physical-GPU-plus-WARP test filtered on this software-only runner. The [release build and CLI smoke tests](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45666204704/job/139388903161) also passed. Physical Radeon testing is still pending. [Direct3D depth-bounds specification](https://microsoft.github.io/DirectX-Specs/d3d/DepthBoundsTest.html). The depth regression uses shader model 6.0 for its vertex and pixel shaders so both Windows Server 2022 and 2025 WARP can run the [same pixel readback](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45811197270).
PastiiJay commented 2026-11-25 18:38:12 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T18:38:12Z.


Thanks a lot @HandshakeHackin! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7171183237 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7171183237). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-25T18:38:12Z. --- Thanks a lot @HandshakeHackin! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here.
HandshakeHackin commented 2026-11-25 20:34:01 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-25T20:34:01Z.


I tested the eight beta PRs together on 742f436 with your WARP runner change from main (448b737). The Windows workspace ran without a test filter: 585 passed, 0 failed, 12 ignored. Both the UAV load/store/atomic test and depth_bounds_pipeline_loads_and_filters_draws passed. Both strict Clippy runs and the 190-file asset check passed too. This covers the software adapter ahead of the RX 9070 XT check. Full Windows job.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7173861268 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7173861268). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-25T20:34:01Z. --- I tested the eight beta PRs together on `742f436` with your WARP runner change from `main` (`448b737`). The Windows workspace ran without a test filter: **585 passed, 0 failed, 12 ignored**. Both the UAV load/store/atomic test and `depth_bounds_pipeline_loads_and_filters_draws` passed. Both strict Clippy runs and the 190-file asset check passed too. This covers the software adapter ahead of the RX 9070 XT check. [Full Windows job](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45694810958/job/139489312214).
PastiiJay commented 2026-11-25 20:35:16 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T20:35:16Z.


Thanks a lot @HandshakeHackin! 585 passed / 0 failed with all eight beta PRs together, and both clippy runs plus the asset check green, is exactly the safety net we needed. Next is the RX 9070 XT run, then I merge them in one go.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7173891152 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7173891152). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-25T20:35:16Z. --- Thanks a lot @HandshakeHackin! 585 passed / 0 failed with all eight beta PRs together, and both clippy runs plus the asset check green, is exactly the safety net we needed. Next is the RX 9070 XT run, then I merge them in one go.
HandshakeHackin commented 2026-11-26 11:35:04 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-26T11:35:04Z.


06f4fcc changes the vertex and pixel shaders in the depth-bounds regression to shader model 6.0. The triangle uses no 6.5 features. With the old profiles, the Server 2022 WARP runner rejected the pipeline before it could check a pixel.

I ran the PR head on both Windows Server 2022 and 2025, with a missing device, bounds support or DXC treated as a test failure. Both loaded the pipeline a second time and read 0 outside the bounds and 255 inside. Reverting only the production depth-state change in the same checkout made both runners paint the out-of-range pixel 255. Paired runs and raw assertions.

The regular beta PR check also passed all 162 active GPU tests. Its remaining failure is the separate shader test requiring both hardware and WARP on a software-only runner, covered on main by 448b737.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7190913829 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7190913829). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-26T11:35:04Z. --- `06f4fcc` changes the vertex and pixel shaders in the depth-bounds regression to shader model 6.0. The triangle uses no 6.5 features. With the old profiles, the Server 2022 WARP runner rejected the pipeline before it could check a pixel. I ran the PR head on both Windows Server 2022 and 2025, with a missing device, bounds support or DXC treated as a test failure. Both loaded the pipeline a second time and read **0 outside the bounds and 255 inside**. Reverting only the production depth-state change in the same checkout made both runners paint the out-of-range pixel **255**. [Paired runs and raw assertions](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45811197270). The [regular beta PR check](https://github.com/PastiiJay/klbf-lab/actions/runs/45810893998) also passed all 162 active GPU tests. Its remaining failure is the separate shader test requiring both hardware and WARP on a software-only runner, covered on `main` by `448b737`.
PastiiJay commented 2026-11-26 11:38:41 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T11:38:41Z.


Thanks, the paired runs with the production change reverted make this one easy to trust. It goes in with the next beta batch; if you have a minute, a one-line note in the PR description about the shader model 6.0 switch would help whoever reads the history later.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7190989190 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7190989190). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T11:38:41Z. --- Thanks, the paired runs with the production change reverted make this one easy to trust. It goes in with the next beta batch; if you have a minute, a one-line note in the PR description about the shader model 6.0 switch would help whoever reads the history later.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/27:upstream-pr/27'
git switch 'upstream-pr/27'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/27'
git switch 'upstream-pr/27'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/27'
git switch 'upstream-pr/27'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/27'
git switch 'main'
git merge --squash 'upstream-pr/27'
git switch 'main'
git merge --ff-only 'upstream-pr/27'
git switch 'main'
git merge 'upstream-pr/27'
git push origin 'main'
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
PastiiJay/klbf-lab!27
No description provided.