Shaders: accept known D3D_MIN_PRECISION signature elements #286
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/286"
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 Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T02:03:32Z.
Allow known
D3D_MIN_PRECISIONvalues (1FLOAT_16,2FLOAT_2_8,4SINT_16,5UINT_16,240ANY_16,241ANY_10) at offset+28ofISG1/OSG1/PSG1signature rows incrates/victory-shader/src/emit/mod.rs, instead of failing with"a minimum-precision signature element".DXBC already encodes those elements with a 32-bit
ComponentType(1..=3), and DXIL SM 6.x declares them as 32-bit withMinPrecision = 0. Unknown/reservedMinPrecisionvalues (such as3) continue to returnShaderError::Unsupported.Adds a unit test
signature_accepts_known_min_precision_and_rejects_unknowncovering all knownD3D_MIN_PRECISIONvalues and an unknown value.Verification
cargo test -p victory-shader(57/57 passed on macOS; Windowsdxil.dllvalidation not run)cargo xtask policy(ok)rustfmt --edition 2024 --check crates/victory-shader/src/emit/mod.rs(ok)Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:16:48Z.
Tested PR #286 at head
6afdb58eeb875499ff79b3f8434500894df2ace4(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at6afdb58eeb875499ff79b3f8434500894df2ace4.cargo test --locked -p victory-shader signature_accepts_known_min_precision_and_rejects_unknown— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 69 filtered out; finished in 0.00s ); cases: emit::tests::signature_accepts_known_min_precision_and_rejects_unknown.Behavior covered: Checks known D3D_MIN_PRECISION signature elements are accepted while unknown values are rejected.
Code: crates/victory-shader/src/emit/mod.rs
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T09:00:08Z.
Review: APPROVED
Tested
6afdb58on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed).victory translate <title exe> --validate --pipelinesgives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. None of these 12 has min-precision elements, so this runs on the validator only through the unit test.D3D_MIN_PRECISIONvalues, leaving out 3, which is reserved. Unknown values are still refused, and the message now says "unknown".MinPrecision = 0in the emitted DXIL is consistent on both sides of an interface, since VS outputs and PS inputs go through the samesignaturepath. A min-precision element is allowed to run at 32 bits anyway, so precision is preserved.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:32Z.
Automated triage for the maintainers.
Needs work.
signatureincrates/victory-shader/src/emit/mod.rsnow accepts min-precision signature elements as plain 32-bit ones (half: false); the enum values are right. The open question is how the console program passes these values: main decides 16-bit packing from the signature's component type and, for outputs, from the native program'sfp16/pack2flags (half_outputsinlower.rs). If the console compiler stores or interpolates min16 values packed, declaring them 32-bit unpacked reads or writes the wrong bits, whereas the current refusal at least fails clearly. Please add a console shader (or its translation log) with a min-precision element showing how its GFX10 code accesses it, or a round-trip test that passesdxil.dllvalidation and reads the right values.CI: no check runs on the head commit.
Generated by Claude Code
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.