shader(dxil): include comparison flag in static sampler slot deduplication key #344
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by Caasares on 2026-11-24T23:43:08Z.
Fixes #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.
Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:02:52Z.
Duplicate of #276?
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.