Repository navigation
fix(kyty): place mesh per-primitive built-ins in a Block struct - #328
Conversation
simnJS
left a comment
There was a problem hiding this comment.
The SPIR-V check passes, but the draw aborts with LLVM ERROR: Cannot emit physreg copy instruction on both Linux jobs. Please use the actual supported mesh subgroup size in the draw fixture and check the dynamic cull case on the CI driver. If the driver still aborts, please verify a driver update or scope an exclusion to the affected configuration in both jobs, including offline CI’s skip check. Keep the wave64 SPIR-V checks for host sizes 32 and 64, with and without layer export, and attach the AMD validation run for the updated draw and pipeline library.
852e455 to
68da14a
Compare
|
Addressed all review items in 68da14a and updated the PR description:
AI-assisted: yes (Antigravity). |
simnJS
left a comment
There was a problem hiding this comment.
The subgroup change, both block layouts and the AMD validation run address the earlier fixture feedback. Please remove the unconditional draw entry in tools/lavapipe_skip.txt so offline CI runs the fixture and records its version-specific skip. Its the device has no reason already matches the skip checker. Please confirm the output on the affected runner and keep the wave64 structural check enabled.
Place MeshEXT PerPrimitiveEXT built-in outputs (CullPrimitiveEXT and, when exported, Layer) inside a Block-decorated OpTypeStruct array (gl_MeshPerPrimitiveEXT / gl_MeshPrimitivesEXT) with member-level BuiltIn and PerPrimitiveEXT decorations instead of standalone output array variables. On AMD's Windows Vulkan driver (amdvlk64.dll 26.10.1 / 2.0.353 on RX 6800), compiling a MeshEXT pipeline whose PerPrimitiveEXT BuiltIn Layer is a standalone OpVariable crashes inside vkCreateGraphicsPipelines (0xc0000005, read of 0x4) in both pre-rasterization pipeline libraries and whole pipelines. Grouping per-primitive built-ins in a Block struct matches GL_EXT_mesh_shader / glslang, passes spirv-val and VK_LAYER_KHRONOS_validation with zero errors, and compiles and renders correctly.
|
I prepared the requested one-line skip-list fix against this PR's exact head The companion diff is one deletion. Conventions and the skip-reason policy check pass locally; the original PR's affected Linux runner still needs to run after this is merged into the branch. The committed overlap audit reports only #335's workflow overlap inherited from this PR. |
68da14a to
5d427a9
Compare
|
Removed Confirmed on the Ubuntu 24.04
AI-assisted: yes (Antigravity). |
simnJS
left a comment
There was a problem hiding this comment.
Reviewed this revision and validated it together with the other changes in the integration branch. The Linux, Windows, sanitizer, and offline checks passed on the exact candidate.
What
Place
MeshEXTPerPrimitiveEXTbuilt-in outputs (BuiltIn CullPrimitiveEXT, andBuiltIn Layerwhen the shader exports layer) inside aBlock-decoratedOpTypeStructarray (gl_MeshPerPrimitiveEXT/gl_MeshPrimitivesEXT) with member-levelBuiltInandPerPrimitiveEXTdecorations instead of emitting standaloneOpVariableoutput arrays.On AMD's Windows Vulkan driver (
amdvlk64.dll26.10.1 / 2.0.353 on RX 6800),vkCreateGraphicsPipelinescrashes with an access violation (0xc0000005, read of0x4atamdvlk64.dll+0x21f30d1) when compiling aMeshEXTshader that declaresBuiltIn LayerwithPerPrimitiveEXTas a standaloneOpVariable(reproduced in bothVK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXTpipeline libraries and whole graphics pipelines, including with a minimal 20-line syntheticMeshEXTshader). Moving the per-primitive built-ins into aBlockstruct matchesGL_EXT_mesh_shader/glslang, validates cleanly underspirv-valandVK_LAYER_KHRONOS_validation, compiles without crashing, and routes culled and layered primitives to the expected render target layers.Adds:
kyty_shim_mesh_per_primitive_block— wave64 SPIR-V codegen andspirv-valchecks for host subgroup sizes 32 and 64, both with and without layer export.kyty_shim_mesh_per_primitive_block_draw— uses the device's actualprops11.subgroupSize(withVkPhysicalDeviceMeshShaderPropertiesEXTlimits check), builds both pre-rasterization pipeline libraries and whole graphics pipelines for both the layered 2-memberBlockstruct ({CullPrimitiveEXT, Layer}) and cull-only 1-memberBlockstruct ({CullPrimitiveEXT}), and runs dynamic-cull draws controlled by push-constant user data (s8/s9) across all cull combinations with 2-layer pixel readback.llvmpipeexclusion (driverID == eMesaLlvmpipe && driverVersion <= VK_MAKE_API_VERSION(0, 26, 2, 4)inMeshPerPrimitiveBlock.cpp, returning exit code77withthe device has no ...) because Mesa 25.2.8 / LLVM 20.1.2llvmpipestill aborts withLLVM ERROR: Cannot emit physreg copy instructioneven withsubgroupSize = 8(lane_count = 1, noGroupNonUniformBallot), matching 1d69682 / Mesa#14376. Not listed intools/lavapipe_skip.txt, so offline CI runs the fixture and records the version-specific skip.Tested
Machine: Windows 11 Pro (10.0.26300), Intel Core i9-9900K, AMD Radeon RX 6800 (vendor
0x1002, device0x73bf), AMD proprietary driver 26.10.1 (2.0.353, Vulkan 1.4.315), Vulkan SDK 1.4.363.0 (VK_LAYER_KHRONOS_validation).ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LAYER_ENABLES=VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT, andVK_LOADER_DEBUG=layer(confirmedVK_LAYER_KHRONOS_validationinserted at instance and device):kyty_shim_mesh_per_primitive_blockfails (BuiltIn Layer must not be a standalone output variable);kyty_shim_mesh_per_primitive_block_drawcrashes withSEGFAULTinamdvlk64.dll(0VUID-lines).kyty_shim_mesh_per_primitive_blockandkyty_shim_mesh_per_primitive_block_drawpass on AMD Radeon RX 6800 with 0VUID-and 0SYNC-findings:llvmpipe(Ubuntu 24.04, Mesa 25.2.8 / LLVM 20.1.2,subgroupSize = 8):props11.subgroupSize = 8(lane_count = 1,words=757layered +words=673cull-only dynamic-cull shaders, 0VUID-/SYNC-errors):llvmpipestill aborted withLLVM ERROR: Cannot emit physreg copy instruction.llvmpipeexclusion inMeshPerPrimitiveBlock.cppandtools/lavapipe_skip.txtuntouched:kyty_shim_mesh_per_primitive_blockpasses (0.01 sec),kyty_shim_mesh_per_primitive_block_drawexits77(kyty_shim_mesh_per_primitive_block_draw: skipped, the device has no mesh shader compiler that handles these programs (llvmpipe Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))),check_skips.pyreportsskipped: kyty_shim_mesh_per_primitive_block_draw: expected, and the Khronos validation + synchronization validation pass finishes95 tests passed, 2 skipped, 0 failed.kyty_shim_merged_hull,kyty_shim_recompiler_robustness,kyty_shim_recompiler_valid_spirv,kyty_shim_shader_store_encode,kyty_shim_wave_split_codegen, andkyty_shim_pair_codegenall pass on both with 0VUID-lines (kyty_shim_merged_hull_drawfails identically on both ea03d75 and this branch with0 of 4096 pixels, 0VUID-lines).tools/check_conventions.py --base origin/AnyKyty,tools/check_kyty_settings.py,tools/debt_fold.py --check, andtools/check_emutls_imports.py build/core/libs/libsall pass.0xc0000005(read of 0x4,amdvlk64.dll+0x21f30d1) when compilingstage=MS shader=d95bc66607ad635f, in both default GPL mode andKYTY_PIPELINE_LIBRARIES=0, with 0VUID-lines underVK_LAYER_KHRONOS_validation/KYTY_VULKAN_VALIDATION=1.flips 1007), warm boot (45 s,loaded 64 programs, 81 modules, 60 pipelines in 12 ms,flips 423), and cold boot withKYTY_VULKAN_VALIDATION=1+VK_LOADER_DEBUG=layer(60 s,flips 1018, 0VUID-lines) all compiled95bc66607ad635f, switch to3200x1800, and sustain ~60 FPS with no crash. WithKYTY_PIPELINE_LIBRARIES=0, theamdvlk64.dll+0x21f30d1crash is also gone (gets pastd95bc66607ad635fand3200x1800), though a separateVK_ERROR_DEVICE_LOSToccurs later in that non-default mode at tick 9–11.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)