Fix interaction between GL_EXT_mesh_shader and GL_EXT_fragment_shading_rate
Before this change, using gl_MeshPrimitivesEXT in mesh shader would unconditionally create gl_MeshPrimitivesEXT.gl_PrimitiveShadingRateEXT field and add PrimitiveShadingRateKHR capability to the output SPIRV file, which would subsequently trigger validation errors when creating the shader module unless the application requested primitive shading rate feature. What should happen instead is that unless GL_EXT_fragment_shading_rate extension is enabled, we should not allow using gl_PrimitiveShadingRateEXT and should not emit the associated fields into the output. This change fixes this by using existing filterMember mechanism that is already used in a few other cases like this, and adjusting the required extension on the field member which will generate an error when gl_PrimitiveShadingRateEXT is used without enabling the extension.
This commit is contained in:
parent
79a9f7f652
commit
34d4f78f03
8 changed files with 373 additions and 19 deletions
|
|
@ -9206,7 +9206,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_Layer", 1, &E_GL_EXT_mesh_shader);
|
||||
symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_ViewportIndex", 1, &E_GL_EXT_mesh_shader);
|
||||
symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", 1, &E_GL_EXT_mesh_shader);
|
||||
symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_mesh_shader);
|
||||
|
||||
// note: technically this member requires both GL_EXT_mesh_shader and GL_EXT_fragment_shading_rate
|
||||
// since setVariableExtensions only needs *one of* the extensions to validate, it's more useful to specify EXT_fragment_shading_rate
|
||||
// GL_EXT_mesh_shader will be required in practice by use of other fields of gl_MeshPrimitivesEXT
|
||||
symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
|
||||
BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveID", EbvPrimitiveId, symbolTable);
|
||||
BuiltInVariable("gl_MeshPrimitivesEXT", "gl_Layer", EbvLayer, symbolTable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue