Shaders: read PSV0 interpolation for MS outputs and arbitrary PS inputs #1979

Merged
AndyLatimer merged 1 commit from upstream-pr/1979 into main 2026-11-30 14:12:04 +00:00
AndyLatimer commented 2026-11-29 05:40:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AndyLatimer on 2026-11-29T05:40:21Z.


Problem

  1. ertex_output_interpolation only reads PSV0 when DXIL shader kind is 1 (vertex), skipping mesh shader outputs (13), and pixel shader inputs never read PSV0 at all. While #222's
    econcile_row_interp resolves mixed-interpolation rows that contain an integer, SV_IsFrontFace, or a read sibling, standalone
    ointerpolation float MS outputs and unread PS inputs without a constant or read sibling still fall back to linear instead of their title-declared PSV0 mode.
  2. #222 also noted that calculateLOD on array textures lacked a device-free DXIL validation test.

Fix

  • Generalize ertex_output_interpolation into signature_interpolation(data, elements, input) in crates/victory-shader/src/emit/mod.rs to read PSV0 interpolation modes for:
    • vertex and mesh outputs (DXIL shader kinds 1 and 13), and
    • arbitrary pixel inputs (kind == 0, keeping emitter-chosen modes for system values such as SV_Position and SV_IsFrontFace; read pixel inputs still take their barycentric mode in lower).
  • Add unit tests:
    • emit::container::tests::mesh_outputs_and_pixel_inputs_read_psv_interpolation (verifies MS outputs with primitive elements following in PSV0, and PS arbitrary inputs vs preserved system values).
    • emit::tests::calculate_lod_on_array_textures_validates (verifies image_get_lod on 1D_ARRAY and 2D_ARRAY passes dxil.dll validation).

Verification

  • cargo test --release -p victory-shader --locked -- mesh_outputs_and_pixel_inputs_read_psv_interpolation calculate_lod_on_array_textures_validates packed_vertex_outputs_preserve_name_order_and_declared_interpolation immediate_sampler_slots_distinguish_comparison_uses reconcile_row_interp_matches_constant_and_used_siblings: 5 passed, 0 failed.
  • cargo clippy -p victory-shader --all-targets --locked: 0 warnings in mod.rs and container.rs (only the pre-existing lower.rs:2356 manual_checked_ops warning from main).
  • cargo test -p xtask --locked: 0 asset-policy issues in mod.rs or container.rs (lower.rs already exceeds the 655,360-byte limit on main, see #1429/#1493).
  • Offline dxc -dumpbin disassembly comparison on previously-validating MS and PS shaders whose output hashes changed confirmed zero changes inside define void @main() — only PSV0 and signature metadata interpolation modes changed (linear ->
    ointerpolation).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5547974212 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1979). Originally posted by [AndyLatimer](https://github.com/AndyLatimer) on 2026-11-29T05:40:21Z. --- ### Problem 1. ertex_output_interpolation only reads PSV0 when DXIL shader kind is 1 (vertex), skipping mesh shader outputs (13), and pixel shader inputs never read PSV0 at all. While #222's econcile_row_interp resolves mixed-interpolation rows that contain an integer, SV_IsFrontFace, or a read sibling, standalone ointerpolation float MS outputs and unread PS inputs without a constant or read sibling still fall back to linear instead of their title-declared PSV0 mode. 2. #222 also noted that calculateLOD on array textures lacked a device-free DXIL validation test. ### Fix - Generalize ertex_output_interpolation into signature_interpolation(data, elements, input) in crates/victory-shader/src/emit/mod.rs to read PSV0 interpolation modes for: - vertex and mesh outputs (DXIL shader kinds 1 and 13), and - arbitrary pixel inputs (kind == 0, keeping emitter-chosen modes for system values such as SV_Position and SV_IsFrontFace; read pixel inputs still take their barycentric mode in lower). - Add unit tests: - emit::container::tests::mesh_outputs_and_pixel_inputs_read_psv_interpolation (verifies MS outputs with primitive elements following in PSV0, and PS arbitrary inputs vs preserved system values). - emit::tests::calculate_lod_on_array_textures_validates (verifies image_get_lod on 1D_ARRAY and 2D_ARRAY passes dxil.dll validation). ### Verification - cargo test --release -p victory-shader --locked -- mesh_outputs_and_pixel_inputs_read_psv_interpolation calculate_lod_on_array_textures_validates packed_vertex_outputs_preserve_name_order_and_declared_interpolation immediate_sampler_slots_distinguish_comparison_uses reconcile_row_interp_matches_constant_and_used_siblings: **5 passed, 0 failed**. - cargo clippy -p victory-shader --all-targets --locked: **0 warnings** in mod.rs and container.rs (only the pre-existing lower.rs:2356 manual_checked_ops warning from main). - cargo test -p xtask --locked: 0 asset-policy issues in mod.rs or container.rs (lower.rs already exceeds the 655,360-byte limit on main, see #1429/#1493). - Offline dxc -dumpbin disassembly comparison on previously-validating MS and PS shaders whose output hashes changed confirmed zero changes inside define void @main() — only PSV0 and signature metadata interpolation modes changed (linear -> ointerpolation).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!1979
No description provided.