shader(dxil): include comparison flag in static sampler slot deduplication key #344
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!344
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-344"
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?
@Caasares on GitHub · 2026-11-24 23:43 UTC · original
Caasares:fix/dxil-static-sampler-cmp-dedup→main· +429 −10 · 1 files · 1 commits · openFixes #250
Root cause
In
crates/victory-shader/src/emit/lower.rs,Lower::samplersdeduplicated static sampler slots by the four sampler words[u32; 4]alone and updatedShader::cmp_samplersin place whenever a comparison sample (props.0 & 0x8000 != 0) reused an existing slot. When a shader used the same four sampler words for both ordinary (Sample) and comparison (SampleCmp) sampling:dx.resourcesdeclared that slot as a comparison sampler.dx.resourcessampler kind (1) and handle annotations to disagree with the ordinary sample.Fix
Lower::samplersby([u32; 4], bool)(the four sampler words together withcmp = props.0 & 0x8000 != 0) incrates/victory-shader/src/emit/lower.rs, setting thecmp_samplersbit when allocating a new comparison slot and stripping the flag back to[u32; 4]when constructingLowered::samplers.emit::shader::Shader::sampler_handle,Shader::finish,emit::mod::emit_program,victory-gpuroot signature / shader cache) all key by slot indexnand require no changes.crates/victory-shader/src/emit/lower.rs(no game data) covering:SamplethenSampleCmp) allocation of two distinct static sampler slots (s0ordinary,s1comparison) with matchingannotateHandleproperties anddx.resourcessampler kinds;SampleCmpthenSample) allocation of two distinct static sampler slots (s0comparison,s1ordinary) with matching annotations anddx.resourceskinds;Sample+Sample,SampleCmp+SampleCmp) to a single static sampler slot.Verification
All checks run inside
wt-vf-250after the final edit:cargo clippy --workspace --all-targets --locked -- -D warnings— passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passed (0 warnings)cargo test --workspace --locked— passed: 496 passed, 0 failed, 7 ignored (including 213 passed / 2 ignored invictory-shader, 4 passed inxtaskpolicy checks)rustfmt --edition 2024 --check crates\victory-shader\src\emit\lower.rs— 0 formatting diffs on new/modified linesgit status -s— onlycrates/victory-shader/src/emit/lower.rsmodifiedAI-assisted fix; contains no game files or assets.
@kaayzouee on GitHub · 2026-11-25 01:02 UTC · original
Duplicate of #276?
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.