AGC: mesh draws render nothing on Intel because the mesh stage runs at the driver's default subgroup width, not 32 #2815

Closed
opened 2026-10-10 16:00:44 +00:00 by Silverash-i8 · 1 comment
Silverash-i8 commented 2026-10-10 16:00:44 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T16:00:44Z.


Mesh shader draws render nothing on Intel's Windows driver because the mesh stage is compiled at the driver's default subgroup width, while the translated mesh program assumes 32-lane subgroups. AnyPS5 only requests a 32-wide subgroup for compute pipelines (VulkanDevice.cpp, VkPipelineShaderStageRequiredSubgroupSizeCreateInfo on computeWave32), never for the mesh stage.

Setup: Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release, main 57f96fd2. Intel Graphics in a Core Ultra 9 275HX (Arrow Lake, device 0x7d67, driver 32.0.101.8991). The driver reports subgroupSize = 32 but maxPreferredMeshWorkGroupInvocations = 16, minSubgroupSize = 8, maxSubgroupSize = 32, and lists SHADER_STAGE_MESH_BIT_EXT in requiredSubgroupSizeStages.

What happens

agc_driver_mesh fails its first check (indexed triangle list, one-wave subgroups: triangle 0 was not rendered in its color). I changed CheckTriangles locally to count instead of stopping at the first miss, and every mesh draw in the test draws 0 of 40 triangles on the iGPU: indexed and non-indexed, one-wave and two-wave subgroups, wave32 and wave64, and the indirect draw. The same build draws 40 of 40 everywhere on the RTX 5060 Laptop GPU in the same machine. It's the same with APS5_NO_GPL=1, so pipeline libraries aren't involved.

The mesh SPIR-V passes spirv-val --target-env vulkan1.3. The vertex and primitive counts handed to OpSetMeshOutputsEXT come from a workgroup variable that lane 0 writes behind an OpGroupNonUniformBallot over the 32-lane layout (idx + (idx & ~31) maps wave64 lanes onto the host subgroup), and primitives start culled until they're exported. Run at a narrower width, the ballots and the lane mapping don't line up and every primitive ends up culled or not counted.

Fix

Request a 32-lane subgroup on the mesh stage the same way compute does, when the device lets the mesh stage take a required size:

  • VulkanDevice: meshWave32 is set when mesh shaders are enabled, subgroupSizeControl is supported, 32 lies within [minSubgroupSize, maxSubgroupSize] and requiredSubgroupSizeStages includes VK_SHADER_STAGE_MESH_BIT_EXT. The subgroupSizeControl feature is enabled when either computeWave32 or meshWave32 is.
  • Graphics::Context carries meshWave32.
  • Pipeline: the mesh stage gets VkPipelineShaderStageRequiredSubgroupSizeCreateInfo{32} when meshWave32 is set and the program's hostSubgroupSize is 32, mirroring the compute condition. The stage structs are copied into the pre-rasterization library, so the pipeline library path gets it too.

Branch: Silverash-i8/AnyPS5-fork:fix/agc-mesh-wave32-subgroup, one commit 377829ec on main 57f96fd2, 9 lines in 3 files.

Devices that already run mesh shaders at 32 lanes (NVIDIA) don't change, and devices whose subgroup is 64 (AMD) compile mesh programs with hostSubgroupSize 64, so they don't get the request either.

Results

Full ctest on main 57f96fd2 with the fix:

  • RTX 5060 Laptop GPU (driver 32.0.16.1742): 709/709.
  • Arrow Lake iGPU with APS5_NO_PIPELINE_LTO=1: agc_driver_mesh now passes. 5 failures remain and none are new: f64_fma_subnormals and fp16_overflow (missing shaderFloat64 skip, #2114), lds_beyond_device_limit (#2805), vop1_float_unary and vopc_compare (#2114).

tools/check_conventions.py and tools/check_skips.py --job windows pass.

agc_driver_mesh on the iGPU: passes 3/3 (with APS5_NO_PIPELINE_LTO=1, since this branch is on main without the #2777 fix and the LTO race would otherwise fault the later draws). Every mesh draw now draws 40 of 40.

@ThatsLeo lists agc_driver_mesh among the Intel Arc failures under Mesa ANV in #2805. I can't test ANV here, but if it's the same width mismatch and ANV lists the mesh stage in requiredSubgroupSizeStages, this fix should cover it. Worth a run if you get the chance.

There's no new test: agc_driver_mesh already covers it on any device whose default mesh width isn't 32, and CI's lavapipe skips mesh shaders.

AI-assisted (Claude Code); every number above is from runs on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5792898678 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2815). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-10T16:00:44Z. --- Mesh shader draws render nothing on Intel's Windows driver because the mesh stage is compiled at the driver's default subgroup width, while the translated mesh program assumes 32-lane subgroups. AnyPS5 only requests a 32-wide subgroup for compute pipelines (`VulkanDevice.cpp`, `VkPipelineShaderStageRequiredSubgroupSizeCreateInfo` on `computeWave32`), never for the mesh stage. **Setup:** Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release, `main` 57f96fd2. Intel Graphics in a Core Ultra 9 275HX (Arrow Lake, device 0x7d67, driver 32.0.101.8991). The driver reports `subgroupSize = 32` but `maxPreferredMeshWorkGroupInvocations = 16`, `minSubgroupSize = 8`, `maxSubgroupSize = 32`, and lists `SHADER_STAGE_MESH_BIT_EXT` in `requiredSubgroupSizeStages`. ### What happens `agc_driver_mesh` fails its first check (`indexed triangle list, one-wave subgroups: triangle 0 was not rendered in its color`). I changed `CheckTriangles` locally to count instead of stopping at the first miss, and every mesh draw in the test draws 0 of 40 triangles on the iGPU: indexed and non-indexed, one-wave and two-wave subgroups, wave32 and wave64, and the indirect draw. The same build draws 40 of 40 everywhere on the RTX 5060 Laptop GPU in the same machine. It's the same with `APS5_NO_GPL=1`, so pipeline libraries aren't involved. The mesh SPIR-V passes `spirv-val --target-env vulkan1.3`. The vertex and primitive counts handed to `OpSetMeshOutputsEXT` come from a workgroup variable that lane 0 writes behind an `OpGroupNonUniformBallot` over the 32-lane layout (`idx + (idx & ~31)` maps wave64 lanes onto the host subgroup), and primitives start culled until they're exported. Run at a narrower width, the ballots and the lane mapping don't line up and every primitive ends up culled or not counted. ### Fix Request a 32-lane subgroup on the mesh stage the same way compute does, when the device lets the mesh stage take a required size: - `VulkanDevice`: `meshWave32` is set when mesh shaders are enabled, `subgroupSizeControl` is supported, 32 lies within `[minSubgroupSize, maxSubgroupSize]` and `requiredSubgroupSizeStages` includes `VK_SHADER_STAGE_MESH_BIT_EXT`. The `subgroupSizeControl` feature is enabled when either `computeWave32` or `meshWave32` is. - `Graphics::Context` carries `meshWave32`. - `Pipeline`: the mesh stage gets `VkPipelineShaderStageRequiredSubgroupSizeCreateInfo{32}` when `meshWave32` is set and the program's `hostSubgroupSize` is 32, mirroring the compute condition. The stage structs are copied into the pre-rasterization library, so the pipeline library path gets it too. Branch: [`Silverash-i8/AnyPS5-fork:fix/agc-mesh-wave32-subgroup`](https://github.com/Silverash-i8/AnyPS5-fork/tree/fix/agc-mesh-wave32-subgroup), one commit `377829ec` on `main` 57f96fd2, 9 lines in 3 files. Devices that already run mesh shaders at 32 lanes (NVIDIA) don't change, and devices whose subgroup is 64 (AMD) compile mesh programs with `hostSubgroupSize` 64, so they don't get the request either. ### Results Full ctest on `main` 57f96fd2 with the fix: - RTX 5060 Laptop GPU (driver 32.0.16.1742): 709/709. - Arrow Lake iGPU with `APS5_NO_PIPELINE_LTO=1`: `agc_driver_mesh` now passes. 5 failures remain and none are new: `f64_fma_subnormals` and `fp16_overflow` (missing shaderFloat64 skip, #2114), `lds_beyond_device_limit` (#2805), `vop1_float_unary` and `vopc_compare` (#2114). `tools/check_conventions.py` and `tools/check_skips.py --job windows` pass. `agc_driver_mesh` on the iGPU: passes 3/3 (with `APS5_NO_PIPELINE_LTO=1`, since this branch is on `main` without the #2777 fix and the LTO race would otherwise fault the later draws). Every mesh draw now draws 40 of 40. @ThatsLeo lists `agc_driver_mesh` among the Intel Arc failures under Mesa ANV in #2805. I can't test ANV here, but if it's the same width mismatch and ANV lists the mesh stage in `requiredSubgroupSizeStages`, this fix should cover it. Worth a run if you get the chance. There's no new test: `agc_driver_mesh` already covers it on any device whose default mesh width isn't 32, and CI's lavapipe skips mesh shaders. AI-assisted (Claude Code); every number above is from runs on this machine.
ThatsLeo commented 2026-10-10 17:22:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-10T17:22:13Z.


Tested on Mesa ANV as you asked: Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Core Ultra 7 155H), Mesa 26.2.3, which also lists the mesh stage in requiredSubgroupSizeStages. With 377829ec on main 57f96fd2: agc_driver_mesh passes 3/3 (log: Wave32 programs run on subgroups of 32: compute 1, mesh 1), the validation layer reports nothing, and full ctest has no new failure on Intel Arc or lavapipe (only agc_driver_mesh changes, from failing to passing). I'm closing #2862, which proposed the same fix later, as a duplicate of this one.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100192007 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2815#issuecomment-6100192007). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-10T17:22:13Z. --- Tested on Mesa ANV as you asked: Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Core Ultra 7 155H), Mesa 26.2.3, which also lists the mesh stage in `requiredSubgroupSizeStages`. With `377829ec` on `main` `57f96fd2`: `agc_driver_mesh` passes 3/3 (log: `Wave32 programs run on subgroups of 32: compute 1, mesh 1`), the validation layer reports nothing, and full `ctest` has no new failure on Intel Arc or lavapipe (only `agc_driver_mesh` changes, from failing to passing). I'm closing #2862, which proposed the same fix later, as a duplicate of this one. AI-assisted: yes.
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
boykopovar/AnyPS5#2815
No description provided.