Fix bounds-only depth testing on D3D12 WARP #27

Open
github-bot wants to merge 3 commits from github-bot/gh-27 into beta AGit
Owner

@⁠HandshakeHackin on GitHub · 2026-11-25 17:30 UTC · original
HandshakeHackin:fix-bounds-only-depth-read → beta · +46 −5 · 1 files · 3 commits · open

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.

**@⁠HandshakeHackin** on GitHub · 2026-11-25 17:30 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27) `HandshakeHackin:fix-bounds-only-depth-read` → `beta` · +46 −5 · 1 files · 3 commits · open 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:52:51 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 18:38 UTC · original

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

**@⁠PastiiJay** on GitHub · 2026-11-25 18:38 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7171183237) Thanks a lot @⁠HandshakeHackin! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here.
Author
Owner

@⁠HandshakeHackin on GitHub · 2026-11-25 20:34 UTC · original

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.

**@⁠HandshakeHackin** on GitHub · 2026-11-25 20:34 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7173861268) 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).
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 20:35 UTC · original

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.

**@⁠PastiiJay** on GitHub · 2026-11-25 20:35 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7173891152) 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.
Author
Owner

@⁠HandshakeHackin on GitHub · 2026-11-26 11:35 UTC · original

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.

**@⁠HandshakeHackin** on GitHub · 2026-11-26 11:35 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7190913829) `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`.
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-26 11:38 UTC · original

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.

**@⁠PastiiJay** on GitHub · 2026-11-26 11:38 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/27#issuecomment-7190989190) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/27/head:github-bot/gh-27'
git switch 'github-bot/gh-27'

Merge

Merge the changes and update on Forgejo.
git switch 'beta'
git merge --no-ff 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'beta'
git switch 'beta'
git merge --ff-only 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'beta'
git switch 'beta'
git merge --no-ff 'github-bot/gh-27'
git switch 'beta'
git merge --squash 'github-bot/gh-27'
git switch 'beta'
git merge --ff-only 'github-bot/gh-27'
git switch 'beta'
git merge 'github-bot/gh-27'
git push origin 'beta'
This discussion has been locked. Commenting is limited to contributors.
No description provided.