Add support for es extension GL_EXT_blend_func_extended

* Introduces builtin variables gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT
* Introduces builtin constant gl_MaxDualSourceDrawBuffersEXT
* enables support for layout qualifier "index" in es profile
This commit is contained in:
Pankaj Mistry
2020-04-21 11:33:57 -07:00
parent 2c53baedbb
commit e05cc20ec2
14 changed files with 173 additions and 65 deletions

View File

@@ -201,6 +201,19 @@ float fooinittest()
return fooinit();
}
// Test extension GL_EXT_blend_func_extended
void blendFuncFail() // Error since extension GL_EXT_blend_func_extended is disabled
{
gl_SecondaryFragColorEXT = vec4(1.0);
gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT - 1] = vec4(0.1);
}
#extension GL_EXT_blend_func_extended : enable
void blendFunc()
{
gl_SecondaryFragColorEXT = vec4(1.0);
gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT - 1] = vec4(0.1);
}
// Test extra-function initializers
const float fi1 = 3.0;
const float fi2 = 4.0;

View File

@@ -177,6 +177,11 @@ void testmixFail()
int ival = mix(x, y, b); // Error since extenson GL_EXT_shader_integer_mix is disabled
}
// Test layout qualifier "index" with extension GL_EXT_blend_func_extended
layout(location = 0, index = 1) out vec4 outVarFail; // Error Index supported with extension GL_EXT_blend_func_extended enabled
#extension GL_EXT_blend_func_extended : enable
layout(location = 0, index = 2) out vec4 outVarPass;
#ifndef GL_FRAGMENT_PRECISION_HIGH
#error missing GL_FRAGMENT_PRECISION_HIGH
#endif

View File

@@ -82,15 +82,19 @@ ERROR: 0:192: '.' : cannot apply to an array: nothing
ERROR: 0:193: '.length' : not supported for this version or the enabled extensions
ERROR: 0:194: '.' : cannot apply to an array: method
ERROR: 0:194: 'a' : can't use function syntax on variable
ERROR: 0:214: 'non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)' : not supported for this version or the enabled extensions
ERROR: 0:222: '#define' : names containing consecutive underscores are reserved, and an error if version < 300: A__B
ERROR: 0:223: 'a__b' : identifiers containing consecutive underscores ("__") are reserved, and an error if version < 300
ERROR: 0:207: 'gl_SecondaryFragColorEXT' : required extension not requested: GL_EXT_blend_func_extended
ERROR: 0:208: 'gl_SecondaryFragDataEXT' : required extension not requested: GL_EXT_blend_func_extended
ERROR: 0:208: 'gl_MaxDualSourceDrawBuffersEXT' : required extension not requested: GL_EXT_blend_func_extended
ERROR: 0:227: 'non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)' : not supported for this version or the enabled extensions
ERROR: 0:235: '#define' : names containing consecutive underscores are reserved, and an error if version < 300: A__B
ERROR: 0:236: 'a__b' : identifiers containing consecutive underscores ("__") are reserved, and an error if version < 300
ERROR: 0:3000: '#error' : line of this error should be 3000
ERROR: 0:3002: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 79 compilation errors. No code generated.
ERROR: 82 compilation errors. No code generated.
Shader version: 100
Requested GL_EXT_blend_func_extended
Requested GL_EXT_frag_depth
Requested GL_EXT_shader_non_constant_global_initializers
Requested GL_EXT_shader_texture_lod
@@ -361,36 +365,76 @@ ERROR: node is still EOpNull!
0:201 Sequence
0:201 Branch: Return with expression
0:201 Function Call: fooinit( ( global mediump float)
0:209 Function Definition: fooinit( ( global mediump float)
0:209 Function Parameters:
0:211 Sequence
0:211 Branch: Return with expression
0:211 Constant:
0:211 12.000000
0:214 Sequence
0:214 move second child to first child ( temp mediump int)
0:214 'init1' ( global mediump int)
0:214 Test condition and select ( temp mediump int)
0:214 Condition
0:214 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:214 true case
0:205 Function Definition: blendFuncFail( ( global void)
0:205 Function Parameters:
0:207 Sequence
0:207 move second child to first child ( temp mediump 4-component vector of float)
0:207 'gl_SecondaryFragColorEXT' ( out mediump 4-component vector of float SecondaryFragColorEXT)
0:207 Constant:
0:207 1.000000
0:207 1.000000
0:207 1.000000
0:207 1.000000
0:208 move second child to first child ( temp mediump 4-component vector of float)
0:208 direct index ( temp mediump 4-component vector of float SecondaryFragDataEXT)
0:208 'gl_SecondaryFragDataEXT' ( out 1-element array of mediump 4-component vector of float SecondaryFragDataEXT)
0:208 Constant:
0:208 0 (const int)
0:208 Constant:
0:208 0.100000
0:208 0.100000
0:208 0.100000
0:208 0.100000
0:211 Function Definition: blendFunc( ( global void)
0:211 Function Parameters:
0:213 Sequence
0:213 move second child to first child ( temp mediump 4-component vector of float)
0:213 'gl_SecondaryFragColorEXT' ( out mediump 4-component vector of float SecondaryFragColorEXT)
0:213 Constant:
0:213 1.000000
0:213 1.000000
0:213 1.000000
0:213 1.000000
0:214 move second child to first child ( temp mediump 4-component vector of float)
0:214 direct index ( temp mediump 4-component vector of float SecondaryFragDataEXT)
0:214 'gl_SecondaryFragDataEXT' ( out 1-element array of mediump 4-component vector of float SecondaryFragDataEXT)
0:214 Constant:
0:214 0 (const int)
0:214 Constant:
0:214 1 (const int)
0:214 false case
0:214 Constant:
0:214 2 (const int)
0:220 Sequence
0:220 move second child to first child ( temp mediump int)
0:220 'init2' ( global mediump int)
0:220 Test condition and select ( temp mediump int)
0:220 Condition
0:220 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:220 true case
0:220 Constant:
0:220 1 (const int)
0:220 false case
0:220 Constant:
0:220 2 (const int)
0:214 0.100000
0:214 0.100000
0:214 0.100000
0:214 0.100000
0:222 Function Definition: fooinit( ( global mediump float)
0:222 Function Parameters:
0:224 Sequence
0:224 Branch: Return with expression
0:224 Constant:
0:224 12.000000
0:227 Sequence
0:227 move second child to first child ( temp mediump int)
0:227 'init1' ( global mediump int)
0:227 Test condition and select ( temp mediump int)
0:227 Condition
0:227 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:227 true case
0:227 Constant:
0:227 1 (const int)
0:227 false case
0:227 Constant:
0:227 2 (const int)
0:233 Sequence
0:233 move second child to first child ( temp mediump int)
0:233 'init2' ( global mediump int)
0:233 Test condition and select ( temp mediump int)
0:233 Condition
0:233 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:233 true case
0:233 Constant:
0:233 1 (const int)
0:233 false case
0:233 Constant:
0:233 2 (const int)
0:? Linker Objects
0:? 'a' ( global 3-element array of mediump int)
0:? 'uint' ( global mediump int)
@@ -430,6 +474,7 @@ Linked fragment stage:
Shader version: 100
Requested GL_EXT_blend_func_extended
Requested GL_EXT_frag_depth
Requested GL_EXT_shader_non_constant_global_initializers
Requested GL_EXT_shader_texture_lod
@@ -520,30 +565,30 @@ ERROR: node is still EOpNull!
0:152 'f124' ( global mediump float)
0:152 Constant:
0:152 50000000000.000000
0:214 Sequence
0:214 move second child to first child ( temp mediump int)
0:214 'init1' ( global mediump int)
0:214 Test condition and select ( temp mediump int)
0:214 Condition
0:214 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:214 true case
0:214 Constant:
0:214 1 (const int)
0:214 false case
0:214 Constant:
0:214 2 (const int)
0:220 Sequence
0:220 move second child to first child ( temp mediump int)
0:220 'init2' ( global mediump int)
0:220 Test condition and select ( temp mediump int)
0:220 Condition
0:220 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:220 true case
0:220 Constant:
0:220 1 (const int)
0:220 false case
0:220 Constant:
0:220 2 (const int)
0:227 Sequence
0:227 move second child to first child ( temp mediump int)
0:227 'init1' ( global mediump int)
0:227 Test condition and select ( temp mediump int)
0:227 Condition
0:227 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:227 true case
0:227 Constant:
0:227 1 (const int)
0:227 false case
0:227 Constant:
0:227 2 (const int)
0:233 Sequence
0:233 move second child to first child ( temp mediump int)
0:233 'init2' ( global mediump int)
0:233 Test condition and select ( temp mediump int)
0:233 Condition
0:233 'gl_FrontFacing' ( gl_FrontFacing bool Face)
0:233 true case
0:233 Constant:
0:233 1 (const int)
0:233 false case
0:233 Constant:
0:233 2 (const int)
0:? Linker Objects
0:? 'a' ( global 3-element array of mediump int)
0:? 'uint' ( global mediump int)

View File

@@ -41,15 +41,18 @@ ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset,
ERROR: 0:148: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type)
ERROR: 0:150: 'early_fragment_tests' : not supported for this version or the enabled extensions
ERROR: 0:177: 'specific signature of builtin mix' : required extension not requested: GL_EXT_shader_integer_mix
ERROR: 0:184: 'invariant' : can only apply to an output
ERROR: 0:185: 'invariant' : can only apply to an output
ERROR: 0:186: 'invariant' : can only apply to an output
ERROR: 0:188: 'imageBuffer' : Reserved word.
ERROR: 0:188: '' : syntax error, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON
ERROR: 47 compilation errors. No code generated.
ERROR: 0:181: 'index layout qualifier on fragment output' : not supported for this version or the enabled extensions
ERROR: 0:183: 'index' : value must be 0 or 1
ERROR: 0:189: 'invariant' : can only apply to an output
ERROR: 0:190: 'invariant' : can only apply to an output
ERROR: 0:191: 'invariant' : can only apply to an output
ERROR: 0:193: 'imageBuffer' : Reserved word.
ERROR: 0:193: '' : syntax error, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON
ERROR: 49 compilation errors. No code generated.
Shader version: 300
Requested GL_EXT_blend_func_extended
Requested GL_EXT_shader_integer_mix
using early_fragment_tests
ERROR: node is still EOpNull!
@@ -530,6 +533,8 @@ ERROR: node is still EOpNull!
0:? 'y' ( global mediump int)
0:? 'z' ( global mediump uint)
0:? 'w' ( global mediump uint)
0:? 'outVarFail' (layout( location=0 index=1) out lowp 4-component vector of float)
0:? 'outVarPass' (layout( location=0 index=0) out lowp 4-component vector of float)
0:? 'fooinv' ( invariant smooth in lowp 4-component vector of float)
@@ -538,6 +543,7 @@ Linked fragment stage:
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers
Shader version: 300
Requested GL_EXT_blend_func_extended
Requested GL_EXT_shader_integer_mix
using early_fragment_tests
ERROR: node is still EOpNull!
@@ -769,5 +775,7 @@ ERROR: node is still EOpNull!
0:? 'y' ( global mediump int)
0:? 'z' ( global mediump uint)
0:? 'w' ( global mediump uint)
0:? 'outVarFail' (layout( location=0 index=1) out lowp 4-component vector of float)
0:? 'outVarPass' (layout( location=0 index=0) out lowp 4-component vector of float)
0:? 'fooinv' ( invariant smooth in lowp 4-component vector of float)

View File

@@ -90,6 +90,7 @@ MaxTaskWorkGroupSizeX_NV 32
MaxTaskWorkGroupSizeY_NV 1
MaxTaskWorkGroupSizeZ_NV 1
MaxMeshViewCountNV 4
MaxDualSourceDrawBuffersEXT 1
nonInductiveForLoops 1
whileLoops 1
doWhileLoops 1