Shaders: do not parse VS inputs when reading mesh shader stage I/O #1366
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1366"
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 mgunes1311-lab on 2026-11-24T17:36:55Z.
ms_ioincrates/victory-shader/src/native.rspreviously calledvs_io(data)?just to extract output semantics (E+0xc8, count atE+0x188). Becausevs_ioalso validates and parsesVS_INPUTS(E+0x24, count atE+0xc4, checked againstMAX_SEMANTICS = 32), any mesh shader stage data whose unusedE+0xc4dword exceeded 32 was rejected withShaderError::Malformed("implausible semantic count").Changes
vs_outputs(data: &[u8]) -> Result<Vec<VsOutput>, ShaderError>incrates/victory-shader/src/native.rs.vs_ioandms_ioto callvs_outputs(data)?, soms_iono longer reads unusedVS_INPUTS/VS_INPUT_COUNT.mesh_stage_io_ignores_unused_vs_input_count.Verification
cargo test -p victory-shader --target x86_64-pc-windows-msvc --locked native::(11 passed; 0 failed)cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --target x86_64-pc-windows-msvc --lockedcargo run -p xtask --target x86_64-pc-windows-msvc --locked -- policy --staged(asset policy: 1 files ok)Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T17:42:42Z.
Review: APPROVED
vs_io split: ms_io now reads only VS_OUTPUTS via the shared vs_outputs() helper instead of parsing VS inputs — mesh stage data has no vertex inputs, so a garbage VS_INPUT_COUNT no longer breaks mesh parsing. New native.rs test pins exactly that. Minimal and safe. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host/diff_tests) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 97 passed, 0 failed (test runs on macOS).Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:50:17Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 97 passed, 0 failed. Hardware/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers structure/lowering unit tests.Mesh stage I/O no longer parses VS inputs when reading the mesh shader stage interface: vs_outputs returns Result and mesh_stage_io_ignores_unused_vs_input_count asserts StageIo::Ms. +1 macOS test.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T01:48:29Z.
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
4e155a3ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).