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:
parent
2c53baedbb
commit
e05cc20ec2
14 changed files with 173 additions and 65 deletions
|
|
@ -6755,6 +6755,18 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
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
|
||||
|
||||
|
|
@ -9119,6 +9131,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
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:
|
||||
|
|
|
|||
|
|
@ -5412,10 +5412,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||
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;
|
||||
|
|
@ -365,6 +366,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
"#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"
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_prin
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue