Repository navigation
Conversation
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.
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(SPIR-V codegen andspirv-valcheck for wave32 and wave64, with and without layer export) andkyty_shim_mesh_per_primitive_block_draw(builds both a pre-rasterization pipeline library and a whole mesh pipeline, draws one culled primitive on layer 0 and one visible primitive on layer 1, and reads back both layers).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, 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_blockpasses;kyty_shim_mesh_per_primitive_block_drawpasses (layer0=0 layer1=16/16 on AMD Radeon RX 6800, 0VUID-lines).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)