Shaders: recompute ISG1 input usage and barycentrics flag after bitcode opt #122
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!122
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@davi713albano-coder on GitHub · 2026-11-24 21:39 UTC · original
davi713albano-coder:shader/sync-isg1-usage-after-opt→main· +65 −0 · 3 files · 1 commits · openSummary
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.)
@adriaespii on GitHub · 2026-11-24 21:52 UTC · original
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.
@arminkhaleghirod on GitHub · 2026-11-24 22:23 UTC · original
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.