Repository navigation
Shaders: a uniform branch can pick between immediate samplers - #223
Conversation
Ported from DexNom's ddb73326 (shader half; the blending half is its own PR). (cherry picked from commit ddb73326b58f6baafce0d0b7d9d2ce30e66a7b44) Co-authored-by: DexNom <29156494+DexNom@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
Shaders: a uniform branch can pick between immediate samplers
Port of the shader half of DexNom's ddb73326 (author kept; the blending half of that commit is separate and already in main).
Two different immediate samplers (say wrap in one arm, clamp in the other) that
reach one
image_*through a phi were treated as "an untracked sampler", or asa single static binding.
Lower::imagenow samples once per constant with theoriginal derivatives, selects the texel on the same edge that supplied the
console's sampler, and otherwise falls back to the single tracked sampler
(
image_with_sampler, which the old body became).Test:
lower.rs::a_uniform_branch_can_choose_between_immediate_samplersbuildshand-written instruction words for
s_cmp_eq_u32+s_cbranch_scc1around twos_mov_b32sampler writes, followed byimage_sample_lz, and asserts bothsampler words (
0x00000000and0x00000092) reach the module.Gates
cargo test -p victory-shader: 199 passed, 0 failed (3 ignored).cargo xwin clippy --workspace --all-targets -- -D warnings: clean.victory-run2,912: 2,909 ok, the same 3 known dxil-spirvconverter crashes; 0 of 2,912 programs' DXIL changed — no program in these
dumps takes this path, so the fix only affects programs that do (off-dump).
cargo xtask policy: 258 files ok; no title names.Off switch: none — the change only replaces a refusal (or a wrong sampler) with
the console's choice.
Not tested in a game run.
Summary by CodeRabbit