Shaders: keep mesh outputs within D3D12's 32 KiB #459

Closed
github-bot wants to merge 1 commit from gh-pr/459/head into gh-pr/459/base
Owner

@⁠AnoHunted on GitHub · 2026-11-24 03:41 UTC · original
AnoHunted:mesh-output-budget → main · +201 −1 · 3 files · 1 commits · closed without merging

What

  • container::mesh_output_bytes measures a mesh shader's outputs the way the DXIL validator does: 4 bytes per
    component of every vertex and every primitive signature element, times the vertex and primitive maxima, each
    rounded up to a multiple of 32. It reads the same SigElements the signature metadata, OSG1/PSG1 and PSV0 are
    written from. MESH_OUTPUT_LIMIT is 32 KiB.
  • mesh_prologue checks the size before it calls setMeshOutputCounts:
    • Within 32 KiB, nothing changes.
    • Past it, the maxima come down to the group's lane count. setMeshOutputCounts, the entry's mesh state and
      PSV0 all get the lowered values.
    • If the outputs still pass 32 KiB at the lane count, the module is emitted as before, with the lower maxima
      (marked shortcut:): drivers have been seen to take such modules, and refusing them would drop draws that may
      work today. Whether to refuse them instead is the owner's call; it is a one-line change.
  • Tests:
    • emit::container::tests::mesh_output_size_counts_components_and_aligned_maxima: the size on synthetic
      signature elements. Components count, not rows (two elements sharing a row add up separately), the maxima
      round up to 32, and the boundary is exactly 32,768 bytes.
    • emit::tests::mesh_maxima_past_the_lanes_come_down_to_fit: a synthetic mesh program goes through emit. It
      has 64 lanes, declares 256 vertices and 256 primitives, and exports the position plus 6 vertex rows and 2
      primitive rows. That is 28 + 8 components: 36 KiB at 256, 9 KiB at 64. PSV0 must now say 64/64. With 1 + 1
      rows it fits at 256 and must keep 256/256. Where dxil.dll is found, each module must also pass the validator.
    • emit::tests::mesh_outputs_past_32_kib_at_the_lane_count_keep_the_lane_maxima: 128 lanes, 256/256, position
      plus 15 vertex rows and 2 primitive rows. That is 72 components, 36 KiB even at 128. It still translates, and
      PSV0 must say 128/128.

Why

#201 lists 53 translated mesh shaders that dxil.dll refuses with "vertex plus primitive output size is greater
than 32768". The prologue declared the console's maxima (up to 256 and 256) whatever the outputs took. It refused
only maxima above 256.

The rule:

  • Microsoft's DirectX-Specs, d3d/MeshShader.md, section "Mesh shader output size limits":
    vert_attr_bytes * ALIGN32(n_verts) + prim_attr_bytes * ALIGN32(n_prims) <= 32,768. The attribute bytes are the
    number of scalar attributes times 4.
  • DXC implements it as rule Sm.MeshShaderOutputSize ("For shader '%0', vertex plus primitive output size is
    greater than %1.", utils/hct/hctdb.py). ValidateEntrySignatures in lib/DxilValidation/DxilValidation.cpp
    (v1.8.2502, the version #201 used) sums GetRows() * GetCols() over every element of the output signature
    times ALIGN32(maxVertexCount). It adds the same sum over the primitive signature times
    ALIGN32(maxPrimitiveCount). The total times 4 is compared with kMaxMSOutputTotalBytes = 1024 * 32
    (include/dxc/DXIL/DxilConstants.h). Our elements are one row each, so the count is cols.

Why lowering is safe. The same spec makes SetMeshOutputCounts counts past the declared maxima undefined, and
writes past them too: "The hardware implementation is not required to clamp or mask out of bounds writes." So the
maxima may only come down where the module provably writes no more than the new values. In the translated module,
lane n writes only vertex n and primitive n: storeVertexOutput, storePrimitiveOutput and emitIndices all
take the flat thread id, as the console's NGG exports do. No vertex or primitive index reaches the lane count
([numthreads]), so maxima above it name slots that no lane ever writes. Lowering them takes away nothing the
shader writes.

  • The one case that changes is a primitive whose indices name a vertex at or past the lane count. No lane wrote
    that vertex before either, so it was already undefined.
  • A side effect: primitives past the lane count used to be counted by setMeshOutputCounts but never written, not
    even culled by the prologue, so their indices were undefined. With the lowered count they are not declared.

What cannot be derived. The console's real counts come from one lane's s_sendmsg GS_ALLOC_REQ
(m0 = vertices | primitives << 12), a run-time value. The translator finds that message only to place barriers,
and it lowers to nothing. It does not track the counts. So nothing below the lane count is provable, and a
shader whose outputs pass 32 KiB even there keeps an out-of-spec module (with smaller maxima than before).

No draw is lost. #201 says the D3D12 runtime created pipelines for all 8,191 emitted mesh modules, so these
shaders may draw today on drivers that accept them; this change keeps emitting the ones it cannot bring under the
cap. I could not check how the 53 split between "fits at the lane count" and "still over" (no access to that
corpus). #71 reports NVIDIA hangs in mesh passes; outputs past the limit are one possible factor,
not shown to be the cause.

Tested

Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1. dxil.dll from Microsoft's DXC release v1.9.2609
(VICTORY_DXIL pointing at its bin\x64\dxil.dll), so the validator steps of the tests ran (no "validation
skipped" line on either side).

Main and branch side by side in one job (--test-threads=1):

  • cargo test -p victory-shader --lib mesh_ -- --nocapture: main 4 passed; branch 7 passed, 0 failed. The new
    mesh_maxima_past_the_lanes_come_down_to_fit modules pass dxil.dll's validator.
  • cargo test -p victory-shader --lib: main 69 passed; branch 72 passed, 0 failed (constant_color_validates
    and the existing translated-mesh draw test pass on both).
  • cargo test --workspace: main 264 passed, 0 failed, 4 ignored; branch 267 passed, 0 failed, 4 ignored.
  • cargo clippy -p victory-shader --tests: no warnings on main or on the branch.
  • The new emit tests on main with the tests alone and no fix (an earlier version of the second test, which then
    expected a refusal): mesh_maxima_past_the_lanes_come_down_to_fit fails (PSV0 declares (256, 256) where
    (64, 64) is expected). The current ..._keep_the_lane_maxima test was not run on main; main declares
    (256, 256) there, so it would fail its (128, 128) check the same way.

Not tested

  • The 53 shaders of #201, or any title: no game files.
  • AMD and Intel GPUs. Nothing here changes what runs on a GPU beyond the declared maxima.

AI-assisted (Claude Code, Claude Opus 5.5). No game files were used.

**@⁠AnoHunted** on GitHub · 2026-11-24 03:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/459) `AnoHunted:mesh-output-budget` → `main` · +201 −1 · 3 files · 1 commits · closed without merging ## What - `container::mesh_output_bytes` measures a mesh shader's outputs the way the DXIL validator does: 4 bytes per component of every vertex and every primitive signature element, times the vertex and primitive maxima, each rounded up to a multiple of 32. It reads the same `SigElement`s the signature metadata, `OSG1`/`PSG1` and `PSV0` are written from. `MESH_OUTPUT_LIMIT` is 32 KiB. - `mesh_prologue` checks the size before it calls `setMeshOutputCounts`: - Within 32 KiB, nothing changes. - Past it, the maxima come down to the group's lane count. `setMeshOutputCounts`, the entry's mesh state and `PSV0` all get the lowered values. - If the outputs still pass 32 KiB at the lane count, the module is emitted as before, with the lower maxima (marked `shortcut:`): drivers have been seen to take such modules, and refusing them would drop draws that may work today. Whether to refuse them instead is the owner's call; it is a one-line change. - Tests: - `emit::container::tests::mesh_output_size_counts_components_and_aligned_maxima`: the size on synthetic signature elements. Components count, not rows (two elements sharing a row add up separately), the maxima round up to 32, and the boundary is exactly 32,768 bytes. - `emit::tests::mesh_maxima_past_the_lanes_come_down_to_fit`: a synthetic mesh program goes through `emit`. It has 64 lanes, declares 256 vertices and 256 primitives, and exports the position plus 6 vertex rows and 2 primitive rows. That is 28 + 8 components: 36 KiB at 256, 9 KiB at 64. `PSV0` must now say 64/64. With 1 + 1 rows it fits at 256 and must keep 256/256. Where `dxil.dll` is found, each module must also pass the validator. - `emit::tests::mesh_outputs_past_32_kib_at_the_lane_count_keep_the_lane_maxima`: 128 lanes, 256/256, position plus 15 vertex rows and 2 primitive rows. That is 72 components, 36 KiB even at 128. It still translates, and `PSV0` must say 128/128. ## Why #201 lists 53 translated mesh shaders that `dxil.dll` refuses with "vertex plus primitive output size is greater than 32768". The prologue declared the console's maxima (up to 256 and 256) whatever the outputs took. It refused only maxima above 256. The rule: - Microsoft's DirectX-Specs, `d3d/MeshShader.md`, section "Mesh shader output size limits": `vert_attr_bytes * ALIGN32(n_verts) + prim_attr_bytes * ALIGN32(n_prims) <= 32,768`. The attribute bytes are the number of scalar attributes times 4. - DXC implements it as rule `Sm.MeshShaderOutputSize` ("For shader '%0', vertex plus primitive output size is greater than %1.", `utils/hct/hctdb.py`). `ValidateEntrySignatures` in `lib/DxilValidation/DxilValidation.cpp` (v1.8.2502, the version #201 used) sums `GetRows() * GetCols()` over every element of the output signature times `ALIGN32(maxVertexCount)`. It adds the same sum over the primitive signature times `ALIGN32(maxPrimitiveCount)`. The total times 4 is compared with `kMaxMSOutputTotalBytes = 1024 * 32` (`include/dxc/DXIL/DxilConstants.h`). Our elements are one row each, so the count is `cols`. Why lowering is safe. The same spec makes `SetMeshOutputCounts` counts past the declared maxima undefined, and writes past them too: "The hardware implementation is not required to clamp or mask out of bounds writes." So the maxima may only come down where the module provably writes no more than the new values. In the translated module, lane n writes only vertex n and primitive n: `storeVertexOutput`, `storePrimitiveOutput` and `emitIndices` all take the flat thread id, as the console's NGG exports do. No vertex or primitive index reaches the lane count (`[numthreads]`), so maxima above it name slots that no lane ever writes. Lowering them takes away nothing the shader writes. - The one case that changes is a primitive whose indices name a vertex at or past the lane count. No lane wrote that vertex before either, so it was already undefined. - A side effect: primitives past the lane count used to be counted by `setMeshOutputCounts` but never written, not even culled by the prologue, so their indices were undefined. With the lowered count they are not declared. What cannot be derived. The console's real counts come from one lane's `s_sendmsg` GS_ALLOC_REQ (m0 = vertices | primitives << 12), a run-time value. The translator finds that message only to place barriers, and it lowers to nothing. It does not track the counts. So nothing below the lane count is provable, and a shader whose outputs pass 32 KiB even there keeps an out-of-spec module (with smaller maxima than before). No draw is lost. #201 says the D3D12 runtime created pipelines for all 8,191 emitted mesh modules, so these shaders may draw today on drivers that accept them; this change keeps emitting the ones it cannot bring under the cap. I could not check how the 53 split between "fits at the lane count" and "still over" (no access to that corpus). #71 reports NVIDIA hangs in mesh passes; outputs past the limit are one possible factor, not shown to be the cause. ## Tested Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1. `dxil.dll` from Microsoft's DXC release v1.9.2609 (`VICTORY_DXIL` pointing at its `bin\x64\dxil.dll`), so the validator steps of the tests ran (no "validation skipped" line on either side). Main and branch side by side in one job (`--test-threads=1`): - `cargo test -p victory-shader --lib mesh_ -- --nocapture`: main 4 passed; branch 7 passed, 0 failed. The new `mesh_maxima_past_the_lanes_come_down_to_fit` modules pass `dxil.dll`'s validator. - `cargo test -p victory-shader --lib`: main 69 passed; branch 72 passed, 0 failed (`constant_color_validates` and the existing translated-mesh draw test pass on both). - `cargo test --workspace`: main 264 passed, 0 failed, 4 ignored; branch 267 passed, 0 failed, 4 ignored. - `cargo clippy -p victory-shader --tests`: no warnings on main or on the branch. - The new `emit` tests on main with the tests alone and no fix (an earlier version of the second test, which then expected a refusal): `mesh_maxima_past_the_lanes_come_down_to_fit` fails (`PSV0` declares `(256, 256)` where `(64, 64)` is expected). The current `..._keep_the_lane_maxima` test was not run on main; main declares `(256, 256)` there, so it would fail its `(128, 128)` check the same way. ## Not tested - The 53 shaders of #201, or any title: no game files. - AMD and Intel GPUs. Nothing here changes what runs on a GPU beyond the declared maxima. AI-assisted (Claude Code, Claude Opus 5.5). No game files were used.
A translated mesh shader declared the console's vertex and primitive
maxima (up to 256 each) whatever its outputs took, so wide outputs at
those maxima passed the 32 KiB that D3D12 allows a mesh shader and the
validator refused the module ("vertex plus primitive output size is
greater than 32768").

The prologue now measures the outputs as the validator does (4 bytes
per component of every vertex and primitive signature element, times
the maxima rounded up to 32). Past the cap, the maxima come down to the
lane count: lane n writes only vertex n and primitive n, so no group
writes more. Outputs that pass the cap even at the lane count are still
emitted as before, with the lower maxima, so no draw that works today is
dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:04:49 +00:00
github-bot closed this pull request 2026-11-26 04:04:49 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 03:42 UTC · original

Verified dc838d6 on Arch Linux x86_64 (rustc 1.98.1, cargo test -p victory-shader): 59 passed, 0 failed, 0 ignored.

Not covered: DispatchMesh on a real host device (no game data or Windows GPU run here) and the interaction with the game's mesh pipelines.

**@⁠DaviTostes** on GitHub · 2026-11-24 03:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7121349720) Verified `dc838d6` on **Arch Linux x86_64** (rustc 1.98.1, `cargo test -p victory-shader`): **59 passed, 0 failed, 0 ignored**. Not covered: DispatchMesh on a real host device (no game data or Windows GPU run here) and the interaction with the game's mesh pipelines.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 04:10 UTC · original

Native DispatchMesh check for dc838d6 on Windows 11 build 26200, Rust 1.98.1 MSVC and Windows SDK dxil.dll 1.8.2502. The original synthetic fixture uses 64 threads, declared maxima 256/256, 28 vertex scalars and 8 primitive scalars (36 KiB). Only primitive 63 draws a nondegenerate triangle, using vertices 61, 62 and 63.

  • With lower.rs from d2a4bae, the same input emits 256/256 and the validator rejects it for exceeding 32,768 bytes. This control was validator-only.
  • At dc838d6, the 256/256 input emits 64/64 and validates. Its entire DXIL container matches the otherwise identical input declaring 64/64 from the start.
  • The RTX 5090 (10de:2b85) and Radeon iGPU (1002:13c0) both created the mesh pipeline and returned all 64 expected pixels from actual DispatchMesh for both inputs. The D3D12 debug queues contained no error or corruption messages.

The local test ran with cargo test --locked --offline -p victory-shader mesh_clamp_hardware_probe -- --nocapture --test-threads=1. The readback covers the last valid primitive and vertex indices for this synthetic mesh; the pixel shader uses a constant color.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7121769998) Native DispatchMesh check for `dc838d6` on Windows 11 build 26200, Rust 1.98.1 MSVC and Windows SDK `dxil.dll` 1.8.2502. The original synthetic fixture uses 64 threads, declared maxima 256/256, 28 vertex scalars and 8 primitive scalars (36 KiB). Only primitive 63 draws a nondegenerate triangle, using vertices 61, 62 and 63. - With `lower.rs` from `d2a4bae`, the same input emits 256/256 and the validator rejects it for exceeding 32,768 bytes. This control was validator-only. - At `dc838d6`, the 256/256 input emits 64/64 and validates. Its entire DXIL container matches the otherwise identical input declaring 64/64 from the start. - The RTX 5090 (10de:2b85) and Radeon iGPU (1002:13c0) both created the mesh pipeline and returned all 64 expected pixels from actual DispatchMesh for both inputs. The D3D12 debug queues contained no error or corruption messages. The local test ran with `cargo test --locked --offline -p victory-shader mesh_clamp_hardware_probe -- --nocapture --test-threads=1`. The readback covers the last valid primitive and vertex indices for this synthetic mesh; the pixel shader uses a constant color.
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 04:18 UTC · original

Tested on Windows 11 + retail shaders.rpf (1.0.2.1) using victory translate --validate.

Tested

  • Commit: dc838d6 (pr-459, clean tree)
  • Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, Rust 1.98.1 (x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0 dxil.dll
  • cargo xtask policy: asset policy: 151 files ok
  • cargo test --workspace: 267 passed, 0 failed, 4 ignored
  • victory translate <shaders.rpf> --validate (diag build): 26084 / 26084 translated; mesh DXIL stayed at 8191 emitted of 8506; 8129 validated (unchanged vs main d2a4bae; VS/PS 12272 / 12172 and CS 1693 / 1670 also unchanged).

Not tested: Live GPU / WARP runtime execution.

AI use: Antigravity (Gemini 4 Hydrogen) ran the checks and victory translate --validate and drafted this report from the command outputs.

**@⁠LocranKing** on GitHub · 2026-11-24 04:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7121897859) Tested on Windows 11 + retail `shaders.rpf` (1.0.2.1) using `victory translate --validate`. **Tested** - Commit: `dc838d6` (`pr-459`, clean tree) - Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, Rust `1.98.1` (`x86_64-pc-windows-msvc`), Windows SDK `10.0.26100.0` `dxil.dll` - `cargo xtask policy`: `asset policy: 151 files ok` - `cargo test --workspace`: **267 passed, 0 failed, 4 ignored** - `victory translate <shaders.rpf> --validate` (`diag` build): `26084 / 26084` translated; mesh `DXIL` stayed at **8191 emitted of 8506; 8129 validated** (unchanged vs `main` `d2a4bae`; VS/PS `12272 / 12172` and CS `1693 / 1670` also unchanged). **Not tested:** Live GPU / WARP runtime execution. **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the checks and `victory translate --validate` and drafted this report from the command outputs.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-24 05:00 UTC · original

I measured #459 on the full 26,503-container corpus (A/B: main d2a4bae + Agility, with and without #180 + #459; release, translate --validate --list, 10 chunks, all exit 0). Result posted on #201: the mesh output-size group is 53 → 53, none cleared. (The compute group 23 → 0 is from #180.)

Reason, from one failing module ((MS_VS_PedTransformFire_52f61330_Wrapped~3.dxbc): it declares NumThreads=(128,1,1), 79 vertex outputs, and setMeshOutputCounts(…, 128, 128), so by mesh_output_bytes' own formula the size is 4 × (79 × 128) = 40,448 B > 32 KiB. The clamp lowers the maxima to the lane count — but the lane count is already 128, so nothing changes. The emitted DXIL is byte-identical between base and fix (27,368 B, same hash).

So the programs in this group are the ones where the lanes already reach the maximum; lowering the maxima to the lane count cannot reduce them. To clear them the maxima would have to go below the lane count, with the prologue culling lanes whose vertex/primitive index exceeds the new maximum (and their exports), or the output rows reduced. I haven't checked whether either is safe for these programs — just reporting that the current rule does not touch them.

AI-assisted (Claude Code). I ran the census on Windows 10, RTX 4080; no game data beyond shader hashes.

**@⁠Proudnoob4** on GitHub · 2026-11-24 05:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7122538741) I measured #459 on the full 26,503-container corpus (A/B: `main d2a4bae` + Agility, with and without #180 + #459; release, `translate --validate --list`, 10 chunks, all exit 0). Result posted on #201: the mesh output-size group is **53 → 53**, none cleared. (The compute group 23 → 0 is from #180.) Reason, from one failing module (`(MS_VS_PedTransformFire_52f61330_Wrapped~3.dxbc`): it declares `NumThreads=(128,1,1)`, 79 vertex outputs, and `setMeshOutputCounts(…, 128, 128)`, so by `mesh_output_bytes`' own formula the size is 4 × (79 × 128) = 40,448 B > 32 KiB. The clamp lowers the maxima to the lane count — but the lane count is *already 128*, so nothing changes. The emitted DXIL is byte-identical between base and fix (27,368 B, same hash). So the programs in this group are the ones where the lanes already reach the maximum; lowering the maxima to the lane count cannot reduce them. To clear them the maxima would have to go below the lane count, with the prologue culling lanes whose vertex/primitive index exceeds the new maximum (and their exports), or the output rows reduced. I haven't checked whether either is safe for these programs — just reporting that the current rule does not touch them. AI-assisted (Claude Code). I ran the census on Windows 10, RTX 4080; no game data beyond shader hashes.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 06:02 UTC · original

Data point, offline against main d2a4bae: victory translate --list --validate over the title's shaders.rpf + executable (26,096 programs), dxil.dll 1.9.2602.17.

With this PR, the 53 mesh modules rejected with vertex plus primitive output size is greater than 32768 (#201) are still 53. Mesh emitted is unchanged at 8,191, the other validator failures are unchanged too (185 total), and nothing regresses. So on this corpus none of the 53 seem to qualify for lowering the maximums (the "lane n only writes n" case). It may help to log which check refuses them.

After #306, these 53 are the only validator rejections left on this corpus (see my comment on #306).

**@⁠iurysf** on GitHub · 2026-11-24 06:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7123514645) Data point, offline against main `d2a4bae`: `victory translate --list --validate` over the title's `shaders.rpf` + executable (26,096 programs), dxil.dll 1.9.2602.17. With this PR, the 53 mesh modules rejected with `vertex plus primitive output size is greater than 32768` (#201) are still 53. Mesh emitted is unchanged at 8,191, the other validator failures are unchanged too (185 total), and nothing regresses. So on this corpus none of the 53 seem to qualify for lowering the maximums (the "lane n only writes n" case). It may help to log which check refuses them. After #306, these 53 are the only validator rejections left on this corpus (see my comment on #306).
Author
Owner

@⁠slint6614-dev on GitHub · 2026-11-24 07:47 UTC · original

Measured on the full retail shader pack (26,503 containers) with victory translate --validate, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100.

With this PR the 53 mesh programs refused with "vertex plus primitive output size is greater than 32768" are still all refused (VS/PS 12172, CS 1670, MS 8129 validated, same as main). So on the real pack the lowered maxima do not bring them under 32 KiB, or the path is not taken for them: they may all be in the "still past 32 KiB at the lane count" shortcut: case. cargo test -p victory-shader passes (72).

**@⁠slint6614-dev** on GitHub · 2026-11-24 07:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7125371080) Measured on the full retail shader pack (26,503 containers) with `victory translate --validate`, against main d2a4bae (emitted / validated). Windows 11, dxil.dll from SDK 10.0.26100. With this PR the 53 mesh programs refused with "vertex plus primitive output size is greater than 32768" are **still all refused** (VS/PS 12172, CS 1670, MS 8129 validated, same as main). So on the real pack the lowered maxima do not bring them under 32 KiB, or the path is not taken for them: they may all be in the "still past 32 KiB at the lane count" `shortcut:` case. `cargo test -p victory-shader` passes (72).
Author
Owner

@⁠AnoHunted on GitHub · 2026-11-24 10:21 UTC · original

Thank you @⁠Proudnoob4, @⁠iurysf, @⁠slint6614-dev and @⁠LocranKing for the corpus runs, and @⁠fuzeofficlal for the native DispatchMesh check. Together they settle it. The lowering is correct: the 64/64 module validates, is identical to one declaring 64/64 from the start, and draws the same on NVIDIA and AMD. But it clears none of the real 53, so they must all exceed 32 KiB even at their lane count.

Getting them under the limit needs the program's real vertex and primitive counts: the GS_ALLOC_REQ value in m0, which the translator doesn't track today. Lowering to the lane count can't get there. With the review queue as long as it is, I'm closing this rather than ask for a review of a change with no effect on the title. The size measurement (mesh_output_bytes) is on the branch if a count-based fix wants it.

**@⁠AnoHunted** on GitHub · 2026-11-24 10:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/459#issuecomment-7128664768) Thank you @⁠Proudnoob4, @⁠iurysf, @⁠slint6614-dev and @⁠LocranKing for the corpus runs, and @⁠fuzeofficlal for the native DispatchMesh check. Together they settle it. The lowering is correct: the 64/64 module validates, is identical to one declaring 64/64 from the start, and draws the same on NVIDIA and AMD. But it clears none of the real 53, so they must all exceed 32 KiB even at their lane count. Getting them under the limit needs the program's real vertex and primitive counts: the `GS_ALLOC_REQ` value in m0, which the translator doesn't track today. Lowering to the lane count can't get there. With the review queue as long as it is, I'm closing this rather than ask for a review of a change with no effect on the title. The size measurement (`mesh_output_bytes`) is on the branch if a count-based fix wants it.

Pull request closed

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/Marvisak--VIctory!459
No description provided.