shaders(emit): normalize unread signature row modes and mesh outputs #63

Manually merged
github merged 1 commit from gh-pr/63/head into gh-pr/63/base 2026-12-01 20:05:54 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-28 18:33 UTC · original
Androtim:feat/iter77-signature-row-interpolation → main · +116 −4 · 3 files · 1 commits · merged 2026-11-29 04:14 UTC

Summary

Fixes two DXIL signature validation issues in victory-shader:

  • Mesh shader vertex outputs (crates/victory-shader/src/emit/mod.rs): Extends vertex_output_interpolation from vertex programs (HwStage::Vs, PSV0 stage 1) to mesh programs (HwStage::Ms, PSV0 stage 13) so floats packed beside integers keep their explicitly declared PSV0 interpolation modes while leaving per-primitive elements untouched.
  • Unread pixel input rows (crates/victory-shader/src/emit/shader.rs): Adds one_mode_a_row, called in Shader::finish, so unread packed pixel input rows (kind in 0 | 13, usage == 0, such as _Fire foliage and prop shaders) whose elements disagree on default interpolation mode become constant (1), avoiding DXIL validator rejections.
  • Tests (crates/victory-shader/src/emit/container.rs, shader.rs): Adds mesh_outputs_take_the_declared_interpolation and one_mode_tests::an_unread_row_of_two_modes_becomes_constant.

Upstream reference: Hasusmogus/cool_fox@7fbf561.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Build 26300, NVIDIA driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release & diagnostics @ 7521cfa
  • Console Profile & Internal Resolution / Scale: series-s — quality (0.6666667, 540p internal / 960x540 captured frames)
  • Ray Tracing: off
  • Upscaling: DLSS quality (Streamline 2.14.16)
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: verify-world.ps1 (WorldSeconds=75, AutoNudgeMenu, VICTORY_CACHE_DIR=D:\victory-data\cache-minivi)
  • Scene / Area & Session Length: Open-world exterior + character deck scene (first_world_frame=6717, 75s in-world / 15 windows, up to 11244 draws/frame)

Measurements & Verification

  • Base FPS (without Frame Gen): 10.6 fps median (8.12 fps mean, 0.1 fps min, 94.5 ms median frame time; +1.70 fps vs 8.9 fps baseline)
  • Frame-Gen FPS (if enabled): N/A (framegen=false)
  • VRAM / RAM Usage: 5898 MB peak (5886.5 MB median) / 6862 MB min budget (0 MB over budget)
  • Texture Streaming & Pipeline Drops: 45162 uploaded, 2392 final waiting (-4729 vs 7121 baseline); 256 median pipeline drops (261.0 baseline); mapped() rate 32.02 ms/s (longest 20.7 ms); 11/11 gates PASS on first run, visually verified 19/24 lit frames (luma=104.96, edge_energy=7.13, 0.0% near-black/magenta; inspected frame-6747.png & frame-7349.png).
  • Crashes / DRED Resets: 0 (no_host_texture_errors=0, untranslated_shaders=2)
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (297 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask --locked (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::container::tests --locked -- --test-threads=1 (3 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::shader::one_mode_tests --locked -- --test-threads=1 (1 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory --bin victory --locked + objdump -p (Windows system DLLs only)
**@⁠Androtim** on GitHub · 2026-11-28 18:33 UTC · [original](https://github.com/Androtim/MiniVI/pull/63) `Androtim:feat/iter77-signature-row-interpolation` → `main` · +116 −4 · 3 files · 1 commits · merged 2026-11-29 04:14 UTC ## Summary Fixes two DXIL signature validation issues in `victory-shader`: - **Mesh shader vertex outputs (`crates/victory-shader/src/emit/mod.rs`):** Extends `vertex_output_interpolation` from vertex programs (`HwStage::Vs`, PSV0 stage `1`) to mesh programs (`HwStage::Ms`, PSV0 stage `13`) so floats packed beside integers keep their explicitly declared PSV0 interpolation modes while leaving per-primitive elements untouched. - **Unread pixel input rows (`crates/victory-shader/src/emit/shader.rs`):** Adds `one_mode_a_row`, called in `Shader::finish`, so unread packed pixel input rows (`kind` in `0 | 13`, `usage == 0`, such as `_Fire` foliage and prop shaders) whose elements disagree on default interpolation mode become constant (`1`), avoiding DXIL validator rejections. - **Tests (`crates/victory-shader/src/emit/container.rs`, `shader.rs`):** Adds `mesh_outputs_take_the_declared_interpolation` and `one_mode_tests::an_unread_row_of_two_modes_becomes_constant`. Upstream reference: `Hasusmogus/cool_fox@7fbf561`. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Build 26300, NVIDIA driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** `release` & `diagnostics` @ `7521cfa` - **Console Profile & Internal Resolution / Scale:** `series-s` — `quality` (`0.6666667`, 540p internal / 960x540 captured frames) - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` (Streamline 2.14.16) - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `verify-world.ps1` (`WorldSeconds=75`, `AutoNudgeMenu`, `VICTORY_CACHE_DIR=D:\victory-data\cache-minivi`) - **Scene / Area & Session Length:** Open-world exterior + character deck scene (`first_world_frame=6717`, 75s in-world / 15 windows, up to `11244` draws/frame) ## Measurements & Verification - **Base FPS (without Frame Gen):** `10.6 fps` median (`8.12 fps` mean, `0.1 fps` min, `94.5 ms` median frame time; `+1.70 fps` vs `8.9 fps` baseline) - **Frame-Gen FPS (if enabled):** N/A (`framegen=false`) - **VRAM / RAM Usage:** `5898 MB` peak (`5886.5 MB` median) / `6862 MB` min budget (`0 MB` over budget) - **Texture Streaming & Pipeline Drops:** `45162` uploaded, `2392` final waiting (`-4729` vs `7121` baseline); `256` median pipeline drops (`261.0` baseline); `mapped()` rate `32.02 ms/s` (longest `20.7 ms`); `11/11` gates PASS on first run, visually verified `19/24` lit frames (`luma=104.96`, `edge_energy=7.13`, `0.0%` near-black/magenta; inspected `frame-6747.png` & `frame-7349.png`). - **Crashes / DRED Resets:** `0` (`no_host_texture_errors=0`, `untranslated_shaders=2`) - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`297 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask --locked` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings` - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings` - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::container::tests --locked -- --test-threads=1` (`3 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib emit::shader::one_mode_tests --locked -- --test-threads=1` (`1 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory --bin victory --locked` + `objdump -p` (Windows system DLLs only)
Ensures DXIL signatures match host validation requirements: applies PSV0 vertex output interpolation modes to mesh shader outputs (stage 13) in emit/mod.rs, and forces constant interpolation on unread pixel input rows with mixed default modes (kind 0/13, usage == 0, e.g. _Fire foliage/prop shaders) via one_mode_a_row in emit/shader.rs. Adds mesh_outputs_take_the_declared_interpolation and an_unread_row_of_two_modes_becomes_constant tests. Adapted from Hasusmogus/cool_fox@7fbf561. Verified with unit tests and 75s open-world run (11/11 gates PASS).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:05:53 +00:00
github manually merged commit 7521cfa529 into gh-pr/63/base 2026-12-01 20:05:54 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 18:35 UTC · original · edited 2026-11-29 00:03 UTC

Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

Logic and scope look clean and well-targeted, with unit tests covering both paths and CI passing.

  • crates/victory-shader/src/emit/mod.rs (emit_program_plain, vertex_output_interpolation): Extending vertex_output_interpolation from HwStage::Vs (PSV0 stage 1) to HwStage::Ms (PSV0 stage 13) matches the PSV0 layout in crates/victory-shader/src/emit/container.rs (psv()): info[28] is input count, info[29] is vertex output count, and primitive elements (info[30]) follow vertex outputs in the element table, so skipping info[28] and reading info[29] records updates only vertex outputs and leaves primitive outputs untouched.
  • crates/victory-shader/src/emit/shader.rs (one_mode_a_row, Shader::finish): Normalizing mixed-mode pixel input rows to constant (1) only when every element in the row has kind in 0 | 13 (arbitrary semantic or SV_IsFrontFace) and usage == 0 (unread) is safe—constant interpolation is valid for both integer and float components, and rows with any read element or other system value are left untouched.
  • Tests (crates/victory-shader/src/emit/container.rs, crates/victory-shader/src/emit/shader.rs): mesh_outputs_take_the_declared_interpolation and one_mode_tests::an_unread_row_of_two_modes_becomes_constant cover both behaviors.

Because this PR changes emitted DXIL signature metadata for mesh and pixel shaders, a local D3D12 GPU smoke test (with shader translation active) is warranted before merging.

Note: This is an automated technical triage review and does not constitute formal maintainer approval.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 18:35 UTC · [original](https://github.com/Androtim/MiniVI/pull/63#issuecomment-7243905847) · edited 2026-11-29 00:03 UTC <!-- minivi-triage v1 head=7521cfa529c86f46d8155c4af070195af3e6e229 verdict=needs-gpu-test ci=passing at=2026-11-29T00:04:08Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Logic and scope look clean and well-targeted, with unit tests covering both paths and CI passing. - **`crates/victory-shader/src/emit/mod.rs` (`emit_program_plain`, `vertex_output_interpolation`):** Extending `vertex_output_interpolation` from `HwStage::Vs` (PSV0 stage `1`) to `HwStage::Ms` (PSV0 stage `13`) matches the PSV0 layout in `crates/victory-shader/src/emit/container.rs` (`psv()`): `info[28]` is input count, `info[29]` is vertex output count, and primitive elements (`info[30]`) follow vertex outputs in the element table, so skipping `info[28]` and reading `info[29]` records updates only vertex outputs and leaves primitive outputs untouched. - **`crates/victory-shader/src/emit/shader.rs` (`one_mode_a_row`, `Shader::finish`):** Normalizing mixed-mode pixel input rows to constant (`1`) only when every element in the row has `kind` in `0 | 13` (arbitrary semantic or `SV_IsFrontFace`) and `usage == 0` (unread) is safe—constant interpolation is valid for both integer and float components, and rows with any read element or other system value are left untouched. - **Tests (`crates/victory-shader/src/emit/container.rs`, `crates/victory-shader/src/emit/shader.rs`):** `mesh_outputs_take_the_declared_interpolation` and `one_mode_tests::an_unread_row_of_two_modes_becomes_constant` cover both behaviors. Because this PR changes emitted DXIL signature metadata for mesh and pixel shaders, a local D3D12 GPU smoke test (with shader translation active) is warranted before merging. > *Note: This is an automated technical triage review and does not constitute formal maintainer approval.* --- _Generated with Antigravity CLI (`agy`)._
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Androtim--MiniVI!63
No description provided.