Shaders: one sampler's words used for both Sample and SampleCmp get two static slots #333
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/333"
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?
Imported from fxceless/victory-fork. Originally posted by RenzoWit35 on 2026-11-24T23:34:56Z.
Fixes #250.
Immediate samplers were deduplicated by their four words alone, and a comparison use marked the
shared slot as a comparison sampler (a
shortcut:in the code). Comparison first, the ordinarysample got a comparison handle (the DXIL validator rejects it). Ordinary first, its default
handle pointed at a comparison static sampler (the validator accepts that, but it is wrong).
The slot key is now the words plus the comparison flag, and a slot's kind is set once at
creation. Lowering more than 64 immediate samplers now fails cleanly instead of overflowing the
u64 kind mask.
Test
one_samplers_words_with_and_without_comparison_get_two_slots: a synthetic GFX10 computeprogram samples with and without comparison through the same words, in both orders, and checks
two slots with the right kinds; it also runs dxil.dll's validator when present (no GPU needed).
Fails on
main.Note: affected shaders get one more static sampler in their root signature.
Testing
On Windows 11, MSVC Rust 1.98.1, branch alone on top of
main(2119b0e):cargo clippy --workspace --all-targets --locked -- -D warnings, the same with--all-features, andcargo test --workspace --lockedall pass. The new regression test fails onmainand passes here. All nine fix branches for #242-#250 also pass together when merged.🤖 Generated with Claude Code
Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:02:00Z.
Duplicate of #276?
Imported from fxceless/victory-fork. Originally posted by UncommonDLL on 2026-11-27T04:28:55Z.
I tested this PR (
d31b2d01) on top of main67429060with an RTX 5070 Ti, driver32.0.16.2140. The test uses the same sampler settings for a regular texture sample and a depth comparison, then runs them in both orders.On main, the shader validator rejected the comparison first case because the regular sample needed a default sampler. With the PR applied, both orders passed validation.
All four runs reached the GPU and returned the expected values:
0.25for the regular sample and0.0for the comparison. No cases were skipped.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.