Shaders: recompute ISG1 input usage and barycentrics flag after bitcode opt #122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/122"
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 davi713albano-coder on 2026-11-24T21:39:31Z.
Summary
In
Shader::finish()(crates/victory-shader/src/emit/shader.rs),self.m.optimise(passes)runs dead-code elimination (opt::DEAD) before writingdx.entryPointsandISG1. Becausedx.op.loadInput.*anddx.op.attributeAtVertex.*are declaredAttr::ReadNone(Effect::Pure), dead input reads can be eliminated during clean-up. PreviouslyShader::finish()recomputedself.flagsviaself.m.usage(), but leftself.inputs[id].usage(andflags::BARYCENTRICS) at their pre-optimization values, soISG1could still mark eliminated channels as read (see #53).Changes
crates/victory-shader/src/emit/bitcode/opt.rs:barycentrics(dx.op.attributeAtVertex.*) inModule::usage().Module::input_usage(count)to compute the surviving per-element read bitmask from reachabledx.op.loadInput.*anddx.op.attributeAtVertex.*calls.crates/victory-shader/src/emit/shader.rs:self.m.optimise(passes), refreshself.inputs[id].usagefromself.m.input_usage(...)and clearflags::BARYCENTRICSif neitherattributeAtVertexnor anSV_Barycentrics(kind == 28) input remains.crates/victory-shader/src/emit/mod.rs:dead_input_read_is_cleared_from_isg1_after_optverifying that an unused interpolated channel is cleared fromISG1'sReadWriteMaskand passesdxil.dllvalidation.Verification
windows-latest): https://github.com/davi713albano-coder/victory-fork/actions/runs/45491513609cargo clippy --workspace --all-targets --locked -- -D warnings: passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passedcargo test --workspace --locked(includingxtaskasset-policy check anddxil.dllvalidation): 497 passed, 0 failed (emit::barycentric_tests::dead_input_read_is_cleared_from_isg1_after_opt ... ok)(No title data used. AI-assisted.)
Imported from fxceless/victory-fork. Originally posted by adriaespii on 2026-11-24T21:52:04Z.
Independent test run on commit
442d7c2(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-shader: 211 passed, 0 failed, 2 ignored;victory-gpu: 110 passed, 0 failed, 1 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
Imported from fxceless/victory-fork. Originally posted by arminkhaleghirod on 2026-11-24T22:23:51Z.
Merged onto main
90228a7and ranvictory translate --validateover the full title (26,148 programs) on Windows 11 / RTX 4080.No change: every failure count matches main, and no new reason appears. What it changes at run time isn't covered by this check.
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.