Shaders: gather stencil coverage as unsigned texels #4648
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4648
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4647"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@faycalbaklouti on GitHub · 2026-12-01 00:41 UTC · original
faycalbaklouti:fix/stencil-srv-unsigned-gather-ci→main· +55 −3 · 2 files · 2 commits · openWhat 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; base7d93ee07599bff5ceffdd1b50a1ed822bb854383.victory-gpu: 16 identical named failures; none head-only.victory-shader: 62 identical named failures; none head-only.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 intests::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
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
@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 --libpassed: 1,134 passed, 0 failed, 66 ignored, includingstencil_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 --libpassed 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);@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_SUPPORTon an RTX 4060 (621.14) and Microsoft WARP. Both reportSHADER_LOADand clearSHADER_GATHERforX24_TYPELESS_G8_UINT(47) andX32_TYPELESS_G8X24_UINT(22). The same query reports gather support for theR8G8B8A8_UNORMcontrol on both devices. D3D12 format support flagsFor comparison, Windows SDK DXC compiled a synthetic
Texture2D<uint4>.GatherGreento this sametextureGather.i32overload 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>.Loadcalls 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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.