AGC: mesh draws render nothing on Intel because the mesh stage runs at the driver's default subgroup width, not 32 #2815
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
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,VkPipelineShaderStageRequiredSubgroupSizeCreateInfooncomputeWave32), never for the mesh stage.Setup: Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release,
main57f96fd2. Intel Graphics in a Core Ultra 9 275HX (Arrow Lake, device 0x7d67, driver 32.0.101.8991). The driver reportssubgroupSize = 32butmaxPreferredMeshWorkGroupInvocations = 16,minSubgroupSize = 8,maxSubgroupSize = 32, and listsSHADER_STAGE_MESH_BIT_EXTinrequiredSubgroupSizeStages.What happens
agc_driver_meshfails its first check (indexed triangle list, one-wave subgroups: triangle 0 was not rendered in its color). I changedCheckTriangleslocally 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 withAPS5_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 toOpSetMeshOutputsEXTcome from a workgroup variable that lane 0 writes behind anOpGroupNonUniformBallotover 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:meshWave32is set when mesh shaders are enabled,subgroupSizeControlis supported, 32 lies within[minSubgroupSize, maxSubgroupSize]andrequiredSubgroupSizeStagesincludesVK_SHADER_STAGE_MESH_BIT_EXT. ThesubgroupSizeControlfeature is enabled when eithercomputeWave32ormeshWave32is.Graphics::ContextcarriesmeshWave32.Pipeline: the mesh stage getsVkPipelineShaderStageRequiredSubgroupSizeCreateInfo{32}whenmeshWave32is set and the program'shostSubgroupSizeis 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 commit377829econmain57f96fd2, 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
hostSubgroupSize64, so they don't get the request either.Results
Full ctest on
main57f96fd2with the fix:APS5_NO_PIPELINE_LTO=1:agc_driver_meshnow passes. 5 failures remain and none are new:f64_fma_subnormalsandfp16_overflow(missing shaderFloat64 skip, #2114),lds_beyond_device_limit(#2805),vop1_float_unaryandvopc_compare(#2114).tools/check_conventions.pyandtools/check_skips.py --job windowspass.agc_driver_meshon the iGPU: passes 3/3 (withAPS5_NO_PIPELINE_LTO=1, since this branch is onmainwithout 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_meshamong 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 inrequiredSubgroupSizeStages, this fix should cover it. Worth a run if you get the chance.There's no new test:
agc_driver_meshalready 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.
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. With377829econmain57f96fd2:agc_driver_meshpasses 3/3 (log:Wave32 programs run on subgroups of 32: compute 1, mesh 1), the validation layer reports nothing, and fullctesthas no new failure on Intel Arc or lavapipe (onlyagc_driver_meshchanges, from failing to passing). I'm closing #2862, which proposed the same fix later, as a duplicate of this one.AI-assisted: yes.