71 mesh shaders exceed the 32 KB mesh output limit (validator), NVIDIA accepts them #283

Open
opened 2026-11-24 23:13:34 +00:00 by arminkhaleghirod · 2 comments
arminkhaleghirod commented 2026-11-24 23:13:34 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by arminkhaleghirod on 2026-11-24T23:13:34Z.


With #61 applied, the validator stops hiding this one: 71 mesh programs fail with vertex plus primitive output size is greater than 32768.

  • All 71 declare 128 vertices on 128 lanes, with 65–71 output scalars per vertex, every one written. At 128 vertices the limit works out to 64 scalars, so they need 33–36 KB.
  • 27–34 of those scalars are 16-bit values declared as 32-bit. Declaring them as 16-bit would bring them under the limit with every vertex kept.
  • On an RTX 4080, translate --pipelines still creates all 8,762 mesh pipelines, including these 71. So NVIDIA draws them today, and it's a validator-level problem there. Other drivers may refuse them.

Lowering the vertex maximum to 96 makes them validate, but it drops the triangles that use vertices 96–127. I tried it and am not proposing it. The real fix is 16-bit signature elements for the 16-bit outputs.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593314125 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/283). Originally posted by [arminkhaleghirod](https://github.com/arminkhaleghirod) on 2026-11-24T23:13:34Z. --- With #61 applied, the validator stops hiding this one: 71 mesh programs fail with `vertex plus primitive output size is greater than 32768`. - All 71 declare 128 vertices on 128 lanes, with 65–71 output scalars per vertex, every one written. At 128 vertices the limit works out to 64 scalars, so they need 33–36 KB. - 27–34 of those scalars are 16-bit values declared as 32-bit. Declaring them as 16-bit would bring them under the limit with every vertex kept. - On an RTX 4080, `translate --pipelines` still creates all 8,762 mesh pipelines, including these 71. So NVIDIA draws them today, and it's a validator-level problem there. Other drivers may refuse them. Lowering the vertex maximum to 96 makes them validate, but it drops the triangles that use vertices 96–127. I tried it and am not proposing it. The real fix is 16-bit signature elements for the 16-bit outputs.
avt0m4t48 commented 2026-11-25 00:10:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-24T23:32:00Z.


I checked the output limit on 2119b0e with a source-built fixture. The D3D12 rule charges four bytes per signature scalar, including native FP16. At 128 vertices, 65 scalars count as 33,280 bytes. Microsoft dxv rejected both 65-scalar FP32 and true-FP16 versions, including the version with storeVertexOutput.f16. D3D12 specification · Validator implementation

A control packed two already-paired FP16 export values into one flat uint and validated at 64 scalars. The fixture retained 128 vertices and a triangle using indices 125, 126, and 127. A companion pixel shader independently validated when it unpacked each vertex's value before barycentric interpolation.

This suggests a shared mesh/pixel signature layout keyed into the stage cache. The offline check covers DXIL validation. Linked pipeline creation and rendered interpolation still need verification.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147506693 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/283#issuecomment-7147506693). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T23:32:00Z. --- I checked the output limit on `2119b0e` with a source-built fixture. The D3D12 rule charges four bytes per signature scalar, including native FP16. At 128 vertices, 65 scalars count as 33,280 bytes. Microsoft `dxv` rejected both 65-scalar FP32 and true-FP16 versions, including the version with `storeVertexOutput.f16`. [D3D12 specification](https://microsoft.github.io/DirectX-Specs/d3d/MeshShader.html#mesh-shader-output-size-limits) · [Validator implementation](https://github.com/microsoft/DirectXShaderCompiler/blob/01b62ad47db7dee3dd33f90e7339cf9e860b3f93/lib/DxilValidation/DxilValidation.cpp#L6543-L6563) A control packed two already-paired FP16 export values into one flat `uint` and validated at 64 scalars. The fixture retained 128 vertices and a triangle using indices 125, 126, and 127. A companion pixel shader independently validated when it unpacked each vertex's value before barycentric interpolation. This suggests a shared mesh/pixel signature layout keyed into the stage cache. The offline check covers DXIL validation. Linked pipeline creation and rendered interpolation still need verification.
avt0m4t48 commented 2026-11-25 01:11:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T00:18:42Z.


The packed interface now has a native Windows readback check. On a Windows CI runner I used the pinned Microsoft WARP 1.0.22, verified SM 6.6, mesh tier 1 and barycentric support, then created and rendered four mesh/pixel PSOs. The mesh retained 128 declared vertices with triangle indices 125, 126 and 127.

The packed and split reference shaders covered the same 66 pixels of a 16×16 target. The perspective-correct results matched each other and the CPU oracle with unequal clip-space W. Both flat variants matched the provoking vertex. The PSO check rejected the deliberately mismatched pair whose pixel input semantic was absent from the mesh output. Windows run and logs · Synthetic fixture and test

This run used original Microsoft DXC stages. The implementation work in Victory is to select the same layout for both stages, unpack each vertex before weighting, and key both translation caches by that layout. The test covers D3D12 software execution. Results on physical GPUs and title shaders are still pending. The fixture and checks were prepared with Codex assistance.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7148375780 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/283#issuecomment-7148375780). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T00:18:42Z. --- The packed interface now has a native Windows readback check. On a Windows CI runner I used the pinned Microsoft WARP 1.0.22, verified SM 6.6, mesh tier 1 and barycentric support, then created and rendered four mesh/pixel PSOs. The mesh retained 128 declared vertices with triangle indices 125, 126 and 127. The packed and split reference shaders covered the same 66 pixels of a 16×16 target. The perspective-correct results matched each other and the CPU oracle with unequal clip-space W. Both flat variants matched the provoking vertex. The PSO check rejected the deliberately mismatched pair whose pixel input semantic was absent from the mesh output. [Windows run and logs](https://github.com/avt0m4t48/victory-fork/actions/runs/45516754565) · [Synthetic fixture and test](https://github.com/avt0m4t48/victory-fork/commit/43fb96b47c40fa11c02354f448fc7ba7fa762c3e) This run used original Microsoft DXC stages. The implementation work in Victory is to select the same layout for both stages, unpack each vertex before weighting, and key both translation caches by that layout. The test covers D3D12 software execution. Results on physical GPUs and title shaders are still pending. The fixture and checks were prepared with Codex assistance.
Sign in to join this conversation.
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
fxceless/victory-fork#283
No description provided.