mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #802] [MERGED] rdna2spirv: list %ms_cull before %ms_out_vtx in OpEntryPoint MeshEXT (AMD LLPC crash, SHADER-MS-CLIP-IFACE) #841
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#841
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/802
Author: @whoalin1
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:shader-ms-clip-iface📝 Commits (2)
355fe0crdna2spirv: list %ms_cull before %ms_out_vtx in OpEntryPoint MeshEXT (AMD Windows LLPC crash)052883fdocs: the mesh interface order crash is one driver report, not every AMD driver📊 Changes
3 files changed (+17 additions, -2 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
tests/test_translate.py(+11 -0)📝
tools/rdna2spirv.py(+5 -1)📄 Description
Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133575269 (
SHADER-MS-CLIP-IFACE)Problem
On AMD's proprietary Windows Vulkan driver (
24.10.24, LLPC, AMD Ryzen 5 7600 RDNA2 iGPU),ms_clipsegfaults (0xC0000005) duringvkCreateGraphicsPipelinesinsideamdvlk64.dll.Bisecting the SPIR-V (including compiling an equivalent GLSL mesh shader with
glslangValidator) narrowed the trigger to a single condition: AMD Windows LLPC crashes whenever aMeshEXTshader lists aBlock-decorated vertex output struct containingBuiltIn ClipDistance/CullDistance(%ms_out_vtx) before theBlock-decoratedPerPrimitiveEXTBuiltIn CullPrimitiveEXToutput (%ms_cull) inOpEntryPoint's interface list. EvenglslangValidator's own output (gl_MeshVerticesEXTbeforegl_MeshPrimitivesEXT) triggers the exact same0xC0000005crash.Fix
tools/rdna2spirv.py(assemble): list%ms_cullbefore%ms_out_vtx/%ms_out_posinOpEntryPoint MeshEXT's interface list. Keeps%ms_cull_blkasBlock+boolso SPIRV-Tools ≤2025.1 (SHADER-30),test_mesh_cull_primitive_is_block_bool,test_mesh_cull_store, and SPIRV-Cross/Metal remain completely unchanged.tests/test_translate.py: addstest_mesh_cull_precedes_clip_vertex_block_in_entrypoint.docs/design.md: documents the rule in the Mesh shaders contract row.Verification (before/after on
main47c651174,LEONIDA_VK_VALIDATION=1)LEONIDA_PC_TAIL_UBO=1):main):ms_clipFAIL (vk_harnesscrash0xC0000005)ms_clipPASS (2048/4096 pixels covered, 0 validation errors),ms_triPASS (4096/4096 pixels exact); also verifiedClipDistance + CullDistancecombined (2048/2048clipped,2048/2048drawn) andCullPrimitiveEXT = true(4096/4096culled).--filter ms_withLEONIDA_VK_VALIDATION=1: 5/6 passed, 1 skipped (ms_clip2048/4096,ms_f16_pack,ms_tri,ms_v5_workgroup,ms_wave_info_s3;ms_w64x_ballotskipped on 32-wide), 0 validation errors;CullPrimitiveEXT = trueverified4096/4096culled.pytest tests/test_translate.py -k "mesh or clip"— 21 passedunittest discover -s tests/semantic -p "test_ms_*.py"— 6 passedunittest discover -s tests/semantic -p "test_mesh_*.py"— 2 passedpython -I tests/test_text_write_line_endings.py— 3 passedAI-assisted (Gemini 4 Neon).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.