* Introduces builtin variables gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT
* Introduces builtin constant gl_MaxDualSourceDrawBuffersEXT
* enables support for layout qualifier "index" in es profile
/* .maxTaskWorkGroupSizeY_NV = */ 1,
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
/* .maxMeshViewCountNV = */ 4,
+ /* .maxDualSourceDrawBuffersEXT = */ 1,
/* .limits = */ {
/* .nonInductiveForLoops = */ 1,
<< "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n"
<< "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n"
<< "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n"
+ << "MaxDualSourceDrawBuffersEXT " << DefaultTBuiltInResource.maxDualSourceDrawBuffersEXT << "\n"
<< "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n"
<< "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n"
<< "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n"
return fooinit();\r
}\r
\r
+// Test extension GL_EXT_blend_func_extended\r
+void blendFuncFail() // Error since extension GL_EXT_blend_func_extended is disabled\r
+{\r
+ gl_SecondaryFragColorEXT = vec4(1.0); \r
+ gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT - 1] = vec4(0.1);\r
+}\r
+#extension GL_EXT_blend_func_extended : enable\r
+void blendFunc() \r
+{\r
+ gl_SecondaryFragColorEXT = vec4(1.0);\r
+ gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT - 1] = vec4(0.1);\r
+}\r
+\r
// Test extra-function initializers\r
const float fi1 = 3.0;\r
const float fi2 = 4.0;\r
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
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
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)
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
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)
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!
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)
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!
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)
MaxTaskWorkGroupSizeY_NV 1
MaxTaskWorkGroupSizeZ_NV 1
MaxMeshViewCountNV 4
+MaxDualSourceDrawBuffersEXT 1
nonInductiveForLoops 1
whileLoops 1
doWhileLoops 1
EbvFragSizeEXT,
EbvFragInvocationCountEXT,
+ EbvSecondaryFragDataEXT,
+ EbvSecondaryFragColorEXT,
+
EbvViewportMaskNV,
EbvSecondaryPositionNV,
EbvSecondaryViewportMaskNV,
case EbvFragSizeEXT: return "FragSizeEXT";
case EbvFragInvocationCountEXT: return "FragInvocationCountEXT";
+ case EbvSecondaryFragDataEXT: return "SecondaryFragDataEXT";
+ case EbvSecondaryFragColorEXT: return "SecondaryFragColorEXT";
+
case EbvViewportMaskNV: return "ViewportMaskNV";
case EbvSecondaryPositionNV: return "SecondaryPositionNV";
case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
int maxTaskWorkGroupSizeY_NV;
int maxTaskWorkGroupSizeZ_NV;
int maxMeshViewCountNV;
+ int maxDualSourceDrawBuffersEXT;
TLimits limits;
};
int max_task_work_group_size_y_nv;
int max_task_work_group_size_z_nv;
int max_mesh_view_count_nv;
+ int maxDualSourceDrawBuffersEXT;
glslang_limits_t limits;
} glslang_resource_t;
s.append(builtInConstant);
}
+ if (version >= 100) {
+ // GL_EXT_blend_func_extended
+ snprintf(builtInConstant, maxSize, "const mediump int gl_MaxDualSourceDrawBuffersEXT = %d;", resources.maxDualSourceDrawBuffersEXT);
+ s.append(builtInConstant);
+ // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxDualSourceDrawBuffersEXT
+ if (language == EShLangFragment) {
+ s.append(
+ "mediump vec4 gl_SecondaryFragColorEXT;"
+ "mediump vec4 gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT];"
+ "\n");
+ }
+ }
} else {
// non-ES profile
symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData));
SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable);
}
+
+ // GL_EXT_blend_func_extended
+ if (profile == EEsProfile && version >= 100) {
+ symbolTable.setVariableExtensions("gl_MaxDualSourceDrawBuffersEXT", 1, &E_GL_EXT_blend_func_extended);
+ symbolTable.setVariableExtensions("gl_SecondaryFragColorEXT", 1, &E_GL_EXT_blend_func_extended);
+ symbolTable.setVariableExtensions("gl_SecondaryFragDataEXT", 1, &E_GL_EXT_blend_func_extended);
+ SpecialQualifier("gl_SecondaryFragColorEXT", EvqVaryingOut, EbvSecondaryFragColorEXT, symbolTable);
+ SpecialQualifier("gl_SecondaryFragDataEXT", EvqVaryingOut, EbvSecondaryFragDataEXT, symbolTable);
+ }
+
break;
case EShLangTessControl:
case EShLangFragment:
if (id == "index") {
- requireProfile(loc, ECompatibilityProfile | ECoreProfile, "index layout qualifier on fragment output");
+ requireProfile(loc, ECompatibilityProfile | ECoreProfile | EEsProfile, "index layout qualifier on fragment output");
const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location };
profileRequires(loc, ECompatibilityProfile | ECoreProfile, 330, 2, exts, "index layout qualifier on fragment output");
-
+ profileRequires(loc, EEsProfile ,310, E_GL_EXT_blend_func_extended, "index layout qualifier on fragment output");
// "It is also a compile-time error if a fragment shader sets a layout index to less than 0 or greater than 1."
if (value < 0 || value > 1) {
value = 0;
extensionBehavior[E_GL_EXT_ray_tracing] = EBhDisable;
extensionBehavior[E_GL_EXT_ray_query] = EBhDisable;
extensionBehavior[E_GL_EXT_ray_flags_primitive_culling] = EBhDisable;
+ extensionBehavior[E_GL_EXT_blend_func_extended] = EBhDisable;
// OVR extensions
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
"#define GL_EXT_texture_buffer 1\n"
"#define GL_EXT_texture_cube_map_array 1\n"
"#define GL_EXT_shader_integer_mix 1\n"
+ "#define GL_EXT_blend_func_extended 1\n"
// OES matching AEP
"#define GL_OES_geometry_shader 1\n"
const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing";
const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query";
const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling";
+const char* const E_GL_EXT_blend_func_extended = "GL_EXT_blend_func_extended";
// Arrays of extensions for the above viewportEXTs duplications
/* .maxTaskWorkGroupSizeY_NV = */ 1,
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
/* .maxMeshViewCountNV = */ 4,
+ /* .maxDualSourceDrawBuffersEXT = */ 1,
/* .limits = */ {
/* .nonInductiveForLoops = */ 1,