-
Notifications
You must be signed in to change notification settings - Fork 943
Open
Labels
SPIR-VSpecificationbugsev:miscompileGiven a valid input, glslang produces incorrect or invalid SPIR-VGiven a valid input, glslang produces incorrect or invalid SPIR-V
Description
According to the SPIR-V specification, gl_PrimitiveID is available with capabilities
Geometry, Tessellation, RayTracingNV, RayTracingKHR, MeshShadingNV, MeshShadingEXT
But glslang always uses "Geometry".
That means if you driver supports tessellation (or mesh or ray-tracing), but not geometry shaders, you always get a validation error.
vkCreateShaderModule(): SPIR-V Capability Geometry was declared, but one of the following requirements is required (VkPhysicalDeviceFeatures::geometryShader).
The Vulkan spec states: If pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://vulkan.lunarg.com/doc/view/1.4.321.0/mac/antora/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08740)
Notably this is the case with MoltenVK, which has tessellation but not geometry shaders.
I believe glslang should instead use the "Tessellation" capability by default for fragment shaders, since it's a lot more likely that you have tessellation shaders but not geometry shaders, than of the opposite. Obviously being able to choose would be the best option.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SPIR-VSpecificationbugsev:miscompileGiven a valid input, glslang produces incorrect or invalid SPIR-VGiven a valid input, glslang produces incorrect or invalid SPIR-V