Add missing GL_ARB_shader_ballot builtins to Geometry and Tessellation shaders
When processing Geometry and Tessellation Control/Evaluation shaders, the builtins defined by GL_ARB_shader_ballot were not processed by glslang. This specially a problem for gl_SubGroupSizeARB because, it is treated as shader input instead of uniform on Vulkan. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
		
							parent
							
								
									a549bb8175
								
							
						
					
					
						commit
						dbe6b06dde
					
				@ -7885,19 +7885,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
            symbolTable.setFunctionExtensions("readInvocationARB",      1, &E_GL_ARB_shader_ballot);
 | 
					            symbolTable.setFunctionExtensions("readInvocationARB",      1, &E_GL_ARB_shader_ballot);
 | 
				
			||||||
            symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot);
 | 
					            symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_SubGroupEqMaskARB",     EbvSubGroupEqMask,     symbolTable);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_SubGroupGeMaskARB",     EbvSubGroupGeMask,     symbolTable);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_SubGroupGtMaskARB",     EbvSubGroupGtMask,     symbolTable);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_SubGroupLeMaskARB",     EbvSubGroupLeMask,     symbolTable);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_SubGroupLtMaskARB",     EbvSubGroupLtMask,     symbolTable);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (spvVersion.vulkan > 0)
 | 
					 | 
				
			||||||
                // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
 | 
					 | 
				
			||||||
                SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (version >= 430) {
 | 
					            if (version >= 430) {
 | 
				
			||||||
                symbolTable.setFunctionExtensions("anyInvocationARB",       1, &E_GL_ARB_shader_group_vote);
 | 
					                symbolTable.setFunctionExtensions("anyInvocationARB",       1, &E_GL_ARB_shader_group_vote);
 | 
				
			||||||
                symbolTable.setFunctionExtensions("allInvocationsARB",      1, &E_GL_ARB_shader_group_vote);
 | 
					                symbolTable.setFunctionExtensions("allInvocationsARB",      1, &E_GL_ARB_shader_group_vote);
 | 
				
			||||||
@ -8159,6 +8146,27 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
            BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
 | 
					            BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (profile != EEsProfile) {
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable);
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupEqMaskARB",     EbvSubGroupEqMask,     symbolTable);
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupGeMaskARB",     EbvSubGroupGeMask,     symbolTable);
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupGtMaskARB",     EbvSubGroupGtMask,     symbolTable);
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupLeMaskARB",     EbvSubGroupLeMask,     symbolTable);
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupLtMaskARB",     EbvSubGroupLtMask,     symbolTable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (spvVersion.vulkan > 0)
 | 
				
			||||||
 | 
					                // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
 | 
				
			||||||
 | 
					                SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (spvVersion.vulkan > 0)
 | 
				
			||||||
 | 
					            // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
 | 
				
			||||||
 | 
					            SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
					            BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // GL_KHR_shader_subgroup
 | 
					        // GL_KHR_shader_subgroup
 | 
				
			||||||
        if ((profile == EEsProfile && version >= 310) ||
 | 
					        if ((profile == EEsProfile && version >= 310) ||
 | 
				
			||||||
            (profile != EEsProfile && version >= 140)) {
 | 
					            (profile != EEsProfile && version >= 140)) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user