GLSL: Fix tessellation control shader bounding box support. (#1730)

Prior to this change, OES_primitive_bounding_box and EXT_primitive_bounding_box were both recognised as extensions, but only the name gl_BoundingBoxOES could be used. However the EXT version uses the name gl_BoundingBoxEXT instead. In addition, since GLES 3.2, the extension has been included in the core standard and the name gl_BoundingBox may be used instead. This change aims to make both extensions and the 3.2 core version all work.
This commit is contained in:
Laurie 2019-03-19 01:49:27 +00:00 committed by John Kessenich
parent bd0f5ad278
commit e442a03897
5 changed files with 326 additions and 197 deletions

View file

@ -5794,7 +5794,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"patch out highp float gl_TessLevelOuter[4];"
"patch out highp float gl_TessLevelInner[2];"
"patch out highp vec4 gl_BoundingBoxOES[2];"
"patch out highp vec4 gl_BoundingBoxEXT[2];"
"\n");
if (profile == EEsProfile && version >= 320) {
stageBuiltins[EShLangTessControl].append(
"patch out highp vec4 gl_BoundingBox[2];"
"\n"
);
}
}
if ((profile != EEsProfile && version >= 140) ||
@ -8014,10 +8021,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
case EShLangTessControl:
if (profile == EEsProfile && version >= 310) {
BuiltInVariable("gl_BoundingBoxEXT", EbvBoundingBox, symbolTable);
symbolTable.setVariableExtensions("gl_BoundingBoxEXT", 1,
&E_GL_EXT_primitive_bounding_box);
BuiltInVariable("gl_BoundingBoxOES", EbvBoundingBox, symbolTable);
if (version < 320)
symbolTable.setVariableExtensions("gl_BoundingBoxOES", Num_AEP_primitive_bounding_box,
AEP_primitive_bounding_box);
symbolTable.setVariableExtensions("gl_BoundingBoxOES", 1,
&E_GL_OES_primitive_bounding_box);
if (version >= 320) {
BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable);
}
}
// Fall through