shader/gpu: link mesh+pixel shaders to prune outputs under DXIL 32 KB limit #239

Closed
github-bot wants to merge 0 commits from github-bot/gh-239 into main AGit
Owner

@⁠Texbirds on GitHub · 2026-12-01 00:15 UTC · original
Texbirds:pr/mesh-link-32k → main · +871 −27 · 5 files · 47 commits · closed without merging

Port of Marvisak/VIctory#2398 adapted for FoxHound.

Summary

  • When a mesh shader's standalone output footprint still exceeds D3D12's 32 KiB limit (MESH_OUTPUT_LIMIT) even after tightening max_vertices/max_primitives to the thread-group count, HostPipeline now re-translates the mesh shader paired with its pixel shader (or depth-only when no pixel shader is bound) via emit::translate_linked, cached by (mesh_hash, pixel_hash).
  • Prunes arbitrary (kind == 0) vertex/primitive outputs and unread leading/trailing channels that the pixel shader never reads while keeping both stages' signatures linked for D3D12.
  • Refuses the pipeline cleanly if retained outputs still exceed 32 KiB instead of emitting over-budget DXIL.

Testing

  • cargo run --locked -p xtask -- policy (289 files ok)
  • cargo clippy --locked -p victory-shader -p victory-gpu --tests -- -D warnings (0 warnings)
  • victory-shader mesh_link_tests + mesh_output_bytes_matches_dxil_budget: 3/3 passed (hardware RTX 3080 Ti + D3D12 WARP mesh pipeline creation and exact pixel readback)
  • victory-gpu pipeline::: 25/25 passed on RTX 3080 Ti
**@⁠Texbirds** on GitHub · 2026-12-01 00:15 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/239) `Texbirds:pr/mesh-link-32k` → `main` · +871 −27 · 5 files · 47 commits · closed without merging Port of Marvisak/VIctory#2398 adapted for FoxHound. ### Summary - When a mesh shader's standalone output footprint still exceeds D3D12's 32 KiB limit (`MESH_OUTPUT_LIMIT`) even after tightening `max_vertices`/`max_primitives` to the thread-group count, `HostPipeline` now re-translates the mesh shader paired with its pixel shader (or depth-only when no pixel shader is bound) via `emit::translate_linked`, cached by `(mesh_hash, pixel_hash)`. - Prunes arbitrary (`kind == 0`) vertex/primitive outputs and unread leading/trailing channels that the pixel shader never reads while keeping both stages' signatures linked for D3D12. - Refuses the pipeline cleanly if retained outputs still exceed 32 KiB instead of emitting over-budget DXIL. ### Testing - `cargo run --locked -p xtask -- policy` (289 files ok) - `cargo clippy --locked -p victory-shader -p victory-gpu --tests -- -D warnings` (0 warnings) - `victory-shader` `mesh_link_tests` + `mesh_output_bytes_matches_dxil_budget`: 3/3 passed (hardware RTX 3080 Ti + D3D12 WARP mesh pipeline creation and exact pixel readback) - `victory-gpu` `pipeline::`: 25/25 passed on RTX 3080 Ti
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:17:14 +00:00
github-bot closed this pull request 2026-12-01 01:10:15 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:34 UTC · original

Thanks. This is on hold, not rejected. What it needs before it can go in:

  1. a rebase onto the current main (see below; emit/lower.rs and pipeline.rs have also changed);
  2. the translator census and pipeline replay before and after: how many pipelines that were refused are now made, and no change in the ones that already built;
  3. one check in the game of a draw that uses a linked mesh and pixel pair.

Every translator change makes all users translate their shaders again once, so we collect translator PRs into one release; the next one is being tested now, and this would be for the one after. In code and comments, please name title shaders by their 16-digit hash, not by name.

Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:34 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/239#issuecomment-7297654798) Thanks. This is on hold, not rejected. What it needs before it can go in: 1. a rebase onto the current main (see below; `emit/lower.rs` and `pipeline.rs` have also changed); 2. the translator census and pipeline replay before and after: how many pipelines that were refused are now made, and no change in the ones that already built; 3. one check in the game of a draw that uses a linked mesh and pixel pair. Every translator change makes all users translate their shaders again once, so we collect translator PRs into one release; the next one is being tested now, and this would be for the one after. In code and comments, please name title shaders by their 16-digit hash, not by name. Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:35 UTC · original

One more note: GitHub closed this pull request by itself when main's history was rewritten, and it cannot be reopened. That is not a rejection. The points above still apply; please open a new pull request from the current main when you have them.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:35 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/239#issuecomment-7297683597) One more note: GitHub closed this pull request by itself when main's history was rewritten, and it cannot be reopened. That is not a rejection. The points above still apply; please open a new pull request from the current main when you have them.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.