shader/gpu: link mesh+pixel shaders to prune outputs under DXIL 32 KiB limit #278
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!278
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-278"
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?
@Texbirds on GitHub · 2026-12-01 08:37 UTC · original
Texbirds:pr/mesh-link-32k→main· +346 −46 · 4 files · 68 commits · closed without mergingSupersedes #239 (rebased onto rewritten
main297f58a, port ofMarvisak/VIctory#2398adapted for FoxHound).Summary
MESH_OUTPUT_LIMIT) even after tighteningmax_vertices/max_primitivesto the thread-group count,HostPipelinere-translates the mesh shader paired with its pixel shader (or depth-only when no pixel shader is bound) viaemit::translate_linked, cached by(mesh_hash, pixel_hash).kind == 0) vertex/primitive outputs and unread leading/trailing channels that the pixel shader never reads while keeping both stages' signatures linked for D3D12.FIRST_HALFretry,EARLY_DEPTH_COUNTS,loops_wave,TablePlan, andShader::ambientwithout touching standalone translation for shaders that already fit under 32 KiB.Testing
cargo run --locked -p xtask -- policy(293 files ok)cargo clippy --locked -p victory-shader -p victory-gpu --tests -- -D warnings(0 warnings)cargo test --locked -p victory-shader -- mesh_link_tests mesh_output_bytes_matches_dxil_budget: 3/3 passed (hardware RTX 3080 Ti + D3D12 WARP mesh PSO creation and exact pixel readback)cargo test --locked -p victory-gpu -- pipeline::: 27/27 passed on RTX 3080 TiChecklist from #239
main(297f58a)@Aniseto on GitHub · 2026-12-01 08:58 UTC · original
Ran the
mesh_link_tests/mesh_output_bytes_matches_dxil_budgetselections and thepipeline::group at4efa188on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.Both counts match the description's groups, including
linked_mesh_and_pixel_prune_unused_outputs_under_32k_and_drawandmesh_exceeding_32k_tightens_counts_to_group_threads. This adapter reports mesh-shader support and a 32-lane wave; the description's hardware checks were on an RTX 3080 Ti and WARP, so these are a second host for the synthetic cases, not a title draw.Not tested: clippy, the full workspace suite, a retail title, a mesh draw that actually exceeds 32 KiB in a scene, depth-only linked pipelines, AMD adapters, Wine, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@bannnned on GitHub · 2026-12-01 10:25 UTC · original · reviewed
I found two cases where a mesh/pixel pair can still lose its draw. The first is reproduced on a hardware D3D12 device. The second is specific to the existing strict-output switch.
@ -571,0 +661,4 @@.ok_or(ShaderError::Malformed("truncated"))?;if rw != 0 {let key = (String::from_utf8_lossy(name).to_ascii_uppercase(), index);*reads.entry(key).or_insert(0) |= rw;@bannnned on GitHub · 2026-12-01 10:25 UTC · original
[P2] Track reads relative to the semantic's first component
The read mask here uses packed PS register columns. D3D12 links mesh and pixel stages by semantic name and index, so the same
float2 TEXCOORD15can be packed in PSxyand MSzw. Passing0b0011unchanged intoprune_signaturedrops the mesh output in that case, even though the PS reads both components.I adapted the synthetic draw to use exactly that packing on an RTX 5070 Ti. The driver refused PSO creation with the current mask. Translating the mask to the MS columns in the same fixture produced the expected pixel values. Could we store the reads relative to the semantic's own first column, then apply them in each stage's packing? The mixed-column pair would make a regression test.
@ -455,0 +455,4 @@// Mesh shaders whose standalone output footprint exceeds D3D12's 32 KiB// limit are re-translated together with their paired pixel shader,// pruning outputs the pixel shader never reads.let linked = if let Some(ms) = mesh@bannnned on GitHub · 2026-12-01 10:25 UTC · original
[P3] Try linking after the standalone mesh output-limit refusal
With
VICTORY_MESH_OUTPUT_STRICT=1, the standalone 34,816-byte fixture fails inmesh_prologuebeforeHostPipeline::newreaches this branch. That same fixture fits under 32 KiB after linking.Could we route the standalone output-budget failure through linking and enforce the strict budget on the linked result?
pipeline::translate_linkedalso callsms.translated()for metadata, so that part would need to read the metadata independently of a successful standalone translation.@readmet3xt-lab on GitHub · 2026-12-01 11:38 UTC · original
Checked: nothing harmful in it, it merges and passes the lint check. Because it changes a run at default settings (or code on the submission path), it is not merged to main directly: it is on the batch being tested for the next release, as one commit with you as its author. Nothing is needed from you now; the result of the run will be posted here.
@Texbirds on GitHub · 2026-12-01 12:00 UTC · original
Thanks @readmet3xt-lab, @Aniseto, and @bannnned!
Pushed
b7f6eefaddressing both of @bannnned's findings:pixel_input_readsnow records reads relative to each semantic's first declared component ((rw & mask) >> mask.trailing_zeros()), andprune_signatureapplies them in each stage's own packing. Addedlinked_mesh_and_pixel_preserve_mixed_column_packing(MSTEXCOORD15inzw, PS inxy) — passes on RTX 3080 Ti and WARP.VICTORY_MESH_OUTPUT_STRICT=1(P3):HostPipeline::newnow routes standalone mesh translation refusal intotranslate_linked, andtranslate_linkedreads shader metadata viashader_metadirectly from the container instead of requiringms.translated()to have succeeded.@Aniseto on GitHub · 2026-12-01 12:15 UTC · original
This is a new response on the same thread as my report at
4efa188(#278); the head moved tob7f6eef(semantic-relative PS reads and strict-MS link retry), so I am not editing that comment.Ran the
mesh_link_testsmodule and thepipeline::group atb7f6eefon an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.Both groups still pass at the new head; the mesh module now includes the mixed-column packing case named in the new commit. The description's RTX 3080 Ti and WARP readback checks were not repeated here, and no title was run.
Not tested: the full workspace suite, a retail title, WARP as a separate device, AMD adapters, Wine, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
b7f6eef0fdto6600f08be1@readmet3xt-lab on GitHub · 2026-12-01 21:09 UTC · original
Thank you for the update. The new commits are being retested together with the version already in the build.
Pull request closed