Shaders: gather stencil coverage as unsigned texels #4648

Open
github-bot wants to merge 2 commits from github-bot/gh-4647 into main AGit
Owner

@⁠faycalbaklouti on GitHub · 2026-12-01 00:41 UTC · original
faycalbaklouti:fix/stencil-srv-unsigned-gather-ci → main · +55 −3 · 2 files · 2 commits · open

What it changes

Mark supported stencil-plane SRVs as unsigned with no buffer stride. For the matched coverage shader, use an unsigned green gather when the bound view is stencil; keep the float gather for float views. The regression checks stencil, depth, and color view formats.

How it was tested

Windows MSVC target under CPU-only Wine. Head cdd590f829d798d85224d52a3893cb672039fba3; base 7d93ee07599bff5ceffdd1b50a1ed822bb854383.

base-victory-gpu-suite.log:
head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast 
test result: FAILED. 1117 passed; 16 failed; 66 ignored; 0 measured; 0 filtered out; finished in 65.76s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
exit=101

16-head-victory-gpu-suite.log:
head_sha=cdd590f829d798d85224d52a3893cb672039fba3
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast 
test result: FAILED. 1118 passed; 16 failed; 66 ignored; 0 measured; 0 filtered out; finished in 65.35s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
exit=101

base-victory-shader-suite.log:
head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-shader --no-fail-fast 
test result: FAILED. 474 passed; 62 failed; 10 ignored; 0 measured; 0 filtered out; finished in 9.67s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
exit=101

16-head-victory-shader-suite.log:
head_sha=cdd590f829d798d85224d52a3893cb672039fba3
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-shader --no-fail-fast 
test result: FAILED. 474 passed; 62 failed; 10 ignored; 0 measured; 0 filtered out; finished in 9.60s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
exit=101

16-head-exact.log:
head_sha=cdd590f829d798d85224d52a3893cb672039fba3
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s
exit=0

16-base-exact.log:
head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s
exit=0

16-control-exact.log:
head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383
command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s
exit=101
assertion `left == right` failed
  • victory-gpu: 16 identical named failures; none head-only.
  • victory-shader: 62 identical named failures; none head-only.
  • Exact head/base/test-only-control outcomes matched expectations.
  • GPU and profile: no game or physical GPU run.
  • Before/after: package comparison above; no game or performance claim.
  • Shader wave sizes on hardware: not tested.
  • Touched package suites did not establish native Windows CI success.

The exact descriptor regression does not execute a title shader. The branch includes the register-width follow-up.

Earlier workspace tests under Winefailed the same four CLI tests on head and base: the explicit !on_wine() assertion in tests::windows_is_not_wine, the system Direct3D version assertion, and two late-DLL visibility tests. This is baseline-identical on Wine, not a native Windows result. The target’s CI workflow has not run on our fork PRs yet; it may require maintainer approval. Those workspace results are historical; this is not a fresh workspace or CI result.

Checked for overlap

  • I searched open PRs for the same issue and touched files. Related: #4549 is about bound depth state around compute reads; it does not classify stencil SRVs or lower an unsigned gather. #4369 adds stencil command methods, not gather lowering.

Radicle project hub (open-source porting and preservation history): https://radicle.network/nodes/rosa.radicle.network/rad:z3rqQw7796wMbgj8RszExtWR4wMSE
Live development stream: https://vdo.ninja/?view=gta6rtx4090live1080p60

**@⁠faycalbaklouti** on GitHub · 2026-12-01 00:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4647) `faycalbaklouti:fix/stencil-srv-unsigned-gather-ci` → `main` · +55 −3 · 2 files · 2 commits · open ## What it changes Mark supported stencil-plane SRVs as unsigned with no buffer stride. For the matched coverage shader, use an unsigned green gather when the bound view is stencil; keep the float gather for float views. The regression checks stencil, depth, and color view formats. ## How it was tested Windows MSVC target under CPU-only Wine. Head `cdd590f829d798d85224d52a3893cb672039fba3`; base `7d93ee07599bff5ceffdd1b50a1ed822bb854383`. ```text base-victory-gpu-suite.log: head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast test result: FAILED. 1117 passed; 16 failed; 66 ignored; 0 measured; 0 filtered out; finished in 65.76s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s exit=101 16-head-victory-gpu-suite.log: head_sha=cdd590f829d798d85224d52a3893cb672039fba3 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast test result: FAILED. 1118 passed; 16 failed; 66 ignored; 0 measured; 0 filtered out; finished in 65.35s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s exit=101 base-victory-shader-suite.log: head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-shader --no-fail-fast test result: FAILED. 474 passed; 62 failed; 10 ignored; 0 measured; 0 filtered out; finished in 9.67s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s exit=101 16-head-victory-shader-suite.log: head_sha=cdd590f829d798d85224d52a3893cb672039fba3 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-shader --no-fail-fast test result: FAILED. 474 passed; 62 failed; 10 ignored; 0 measured; 0 filtered out; finished in 9.60s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s exit=101 16-head-exact.log: head_sha=cdd590f829d798d85224d52a3893cb672039fba3 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s exit=0 16-base-exact.log: head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s exit=0 16-control-exact.log: head_sha=7d93ee07599bff5ceffdd1b50a1ed822bb854383 command=cargo xwin test --locked --target x86_64-pc-windows-msvc -p victory-gpu --no-fail-fast --lib -- --exact descriptor::host::tests::stencil_view_kind_follows_the_view_not_the_depth_resource --nocapture --test-threads=1 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1199 filtered out; finished in 0.00s exit=101 assertion `left == right` failed ``` - `victory-gpu`: 16 identical named failures; none head-only. - `victory-shader`: 62 identical named failures; none head-only. - Exact head/base/test-only-control outcomes matched expectations. - GPU and profile: no game or physical GPU run. - Before/after: package comparison above; no game or performance claim. - Shader wave sizes on hardware: not tested. - Touched package suites did not establish native Windows CI success. The exact descriptor regression does not execute a title shader. The branch includes the register-width follow-up. Earlier workspace tests under Winefailed the same four CLI tests on head and base: the explicit `!on_wine()` assertion in `tests::windows_is_not_wine`, the system Direct3D version assertion, and two late-DLL visibility tests. This is baseline-identical on Wine, not a native Windows result. The target’s CI workflow has not run on our fork PRs yet; it may require maintainer approval. Those workspace results are historical; this is not a fresh workspace or CI result. ## Checked for overlap - [x] I searched open PRs for the same issue and touched files. Related: #4549 is about bound depth state around compute reads; it does not classify stencil SRVs or lower an unsigned gather. #4369 adds stencil command methods, not gather lowering. --- **Radicle project hub (open-source porting and preservation history):** https://radicle.network/nodes/rosa.radicle.network/rad:z3rqQw7796wMbgj8RszExtWR4wMSE **Live development stream:** https://vdo.ninja/?view=gta6rtx4090live1080p60
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:46:35 +00:00
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 01:15 UTC · original · edited 2026-12-01 01:21 UTC

I ran this exact head (cdd590f8) on native Windows 11 / RTX 4060 with Rust 1.98.1. cargo test --locked -p victory-gpu --lib passed: 1,134 passed, 0 failed, 66 ignored, including stencil_view_kind_follows_the_view_not_the_depth_resource.

This checks the descriptor classification and the native GPU suite without Wine. It does not exercise the hash-gated gather from the title. cargo test --locked -p victory-shader --lib passed on the same head: 536 passed, 0 failed, 10 ignored.

**@⁠tyr0nsur** on GitHub · 2026-12-01 01:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4647#issuecomment-7297283701) · edited 2026-12-01 01:21 UTC I ran this exact head (`cdd590f8`) on native Windows 11 / RTX 4060 with Rust 1.98.1. `cargo test --locked -p victory-gpu --lib` passed: **1,134 passed, 0 failed, 66 ignored**, including `stencil_view_kind_follows_the_view_not_the_depth_resource`. This checks the descriptor classification and the native GPU suite without Wine. It does not exercise the hash-gated gather from the title. `cargo test --locked -p victory-shader --lib` passed on the same head: **536 passed, 0 failed, 10 ignored**.
@ -13426,0 +13445,4 @@
let int_ret = self.s.m.named_struct("dx.types.ResRet.i32", vec![self.s.t.i32; 5]);
let float = self.s.op(fp, "textureGather.f32", Attr::ReadOnly, self.s.t.res_ret, 73, &args);
args[0] = int_handle;
let uint = self.s.op(ui, "textureGather.i32", Attr::ReadOnly, int_ret, 73, &args);
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 01:18 UTC · original · edited 2026-12-01 01:21 UTC

There is a format-capability gap on two native D3D12 devices. I queried D3D12_FEATURE_FORMAT_SUPPORT on an RTX 4060 (621.14) and Microsoft WARP. Both report SHADER_LOAD and clear SHADER_GATHER for X24_TYPELESS_G8_UINT (47) and X32_TYPELESS_G8X24_UINT (22). The same query reports gather support for the R8G8B8A8_UNORM control on both devices. D3D12 format support flags

For comparison, Windows SDK DXC compiled a synthetic Texture2D<uint4>.GatherGreen to this same textureGather.i32 overload and resource type on both cs_6_6 and cs_6_8. This validates the operation's DXIL shape. It leaves the bound stencil formats' missing gather capability open. Could this case use a supported stencil load path on those formats and get a synthetic D3D12 readback test? The descriptor regression alone cannot catch the capability gap.

Follow-up readback: I cleared the four texels of private 2×2 depth/stencil textures to stencil bytes 11, 33, 55 and 77. A one-thread shader read the green component with four integer Texture2D<uint2>.Load calls at mip 0. Both formats returned [55, 77, 33, 11] in the same quad order on both the RTX 4060 and WARP. This verifies the load path and channel mapping on those adapters. A general replacement still needs the gather's coordinate and sampler addressing rules.

**@⁠tyr0nsur** on GitHub · 2026-12-01 01:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4647#discussion_r4747894536) · edited 2026-12-01 01:21 UTC There is a format-capability gap on two native D3D12 devices. I queried `D3D12_FEATURE_FORMAT_SUPPORT` on an RTX 4060 (621.14) and Microsoft WARP. Both report `SHADER_LOAD` and clear `SHADER_GATHER` for `X24_TYPELESS_G8_UINT` (47) and `X32_TYPELESS_G8X24_UINT` (22). The same query reports gather support for the `R8G8B8A8_UNORM` control on both devices. [D3D12 format support flags](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_format_support1) For comparison, Windows SDK DXC compiled a synthetic `Texture2D<uint4>.GatherGreen` to this same `textureGather.i32` overload and resource type on both cs_6_6 and cs_6_8. This validates the operation's DXIL shape. It leaves the bound stencil formats' missing gather capability open. Could this case use a supported stencil load path on those formats and get a synthetic D3D12 readback test? The descriptor regression alone cannot catch the capability gap. Follow-up readback: I cleared the four texels of private 2×2 depth/stencil textures to stencil bytes 11, 33, 55 and 77. A one-thread shader read the green component with four integer `Texture2D<uint2>.Load` calls at mip 0. Both formats returned `[55, 77, 33, 11]` in the same quad order on both the RTX 4060 and WARP. This verifies the load path and channel mapping on those adapters. A general replacement still needs the gather's coordinate and sampler addressing rules.
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/4648/head:github-bot/gh-4647'
git switch 'github-bot/gh-4647'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4647'
git switch 'github-bot/gh-4647'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4647'
git switch 'github-bot/gh-4647'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4647'
git switch 'main'
git merge --squash 'github-bot/gh-4647'
git switch 'main'
git merge --ff-only 'github-bot/gh-4647'
git switch 'main'
git merge 'github-bot/gh-4647'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4648
No description provided.