support GL_EXT_texture_array extention.
This commit is contained in:
parent
c4d34471c4
commit
07e8220d4e
7 changed files with 235 additions and 1 deletions
|
|
@ -1726,6 +1726,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check
|
||||
"vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check
|
||||
|
||||
"vec4 texture1DArray(sampler1DArray, vec2);" // GL_EXT_texture_array
|
||||
"vec4 texture2DArray(sampler2DArray, vec3);" // GL_EXT_texture_array
|
||||
"vec4 shadow1DArray(sampler1DArrayShadow, vec3);" // GL_EXT_texture_array
|
||||
"vec4 shadow2DArray(sampler2DArrayShadow, vec4);" // GL_EXT_texture_array
|
||||
"vec4 texture1DArray(sampler1DArray, vec2, float);" // GL_EXT_texture_array
|
||||
"vec4 texture2DArray(sampler2DArray, vec3, float);" // GL_EXT_texture_array
|
||||
"vec4 shadow1DArray(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array
|
||||
"vec4 texture1DArrayLod(sampler1DArray, vec2, float);" // GL_EXT_texture_array
|
||||
"vec4 texture2DArrayLod(sampler2DArray, vec3, float);" // GL_EXT_texture_array
|
||||
"vec4 shadow1DArrayLod(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array
|
||||
"\n");
|
||||
}
|
||||
}
|
||||
|
|
@ -8002,6 +8012,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers);
|
||||
symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers);
|
||||
}
|
||||
|
||||
// E_GL_EXT_texture_array
|
||||
if (profile != EEsProfile && spvVersion.spv == 0) {
|
||||
symbolTable.setFunctionExtensions("texture1DArray", 1, &E_GL_EXT_texture_array);
|
||||
symbolTable.setFunctionExtensions("texture2DArray", 1, &E_GL_EXT_texture_array);
|
||||
symbolTable.setFunctionExtensions("shadow1DArray", 1, &E_GL_EXT_texture_array);
|
||||
symbolTable.setFunctionExtensions("shadow2DArray", 1, &E_GL_EXT_texture_array);
|
||||
|
||||
symbolTable.setFunctionExtensions("texture1DArrayLod", 1, &E_GL_EXT_texture_array);
|
||||
symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array);
|
||||
symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array);
|
||||
}
|
||||
// Fall through
|
||||
|
||||
case EShLangTessControl:
|
||||
|
|
@ -9967,6 +9989,17 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM);
|
||||
symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM);
|
||||
}
|
||||
|
||||
if (profile != EEsProfile && spvVersion.spv == 0) {
|
||||
symbolTable.relateToOperator("texture1DArray", EOpTexture);
|
||||
symbolTable.relateToOperator("texture2DArray", EOpTexture);
|
||||
symbolTable.relateToOperator("shadow1DArray", EOpTexture);
|
||||
symbolTable.relateToOperator("shadow2DArray", EOpTexture);
|
||||
|
||||
symbolTable.relateToOperator("texture1DArrayLod", EOpTextureLod);
|
||||
symbolTable.relateToOperator("texture2DArrayLod", EOpTextureLod);
|
||||
symbolTable.relateToOperator("shadow1DArrayLod", EOpTextureLod);
|
||||
}
|
||||
}
|
||||
|
||||
switch(language) {
|
||||
|
|
|
|||
|
|
@ -1496,6 +1496,12 @@ int TScanContext::tokenizeIdentifier()
|
|||
case USAMPLERCUBE:
|
||||
case USAMPLER2DARRAY:
|
||||
afterType = true;
|
||||
if (keyword == SAMPLER2DARRAY || keyword == SAMPLER2DARRAYSHADOW) {
|
||||
if (!parseContext.isEsProfile() &&
|
||||
(parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) {
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
return nonreservedKeyword(300, 130);
|
||||
|
||||
case SAMPLER3D:
|
||||
|
|
@ -1539,6 +1545,12 @@ int TScanContext::tokenizeIdentifier()
|
|||
case USAMPLER1D:
|
||||
case USAMPLER1DARRAY:
|
||||
afterType = true;
|
||||
if (keyword == SAMPLER1DARRAYSHADOW) {
|
||||
if (!parseContext.isEsProfile() &&
|
||||
(parseContext.extensionTurnedOn(E_GL_EXT_texture_array) || parseContext.symbolTable.atBuiltInLevel())) {
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
return es30ReservedFromGLSL(130);
|
||||
case ISAMPLER2DRECT:
|
||||
case USAMPLER2DRECT:
|
||||
|
|
@ -1608,7 +1620,9 @@ int TScanContext::tokenizeIdentifier()
|
|||
if (parseContext.isEsProfile() && parseContext.version == 300)
|
||||
reservedWord();
|
||||
else if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 130))
|
||||
((!parseContext.isEsProfile() && parseContext.version < 130) &&
|
||||
!parseContext.symbolTable.atBuiltInLevel() &&
|
||||
!parseContext.extensionTurnedOn(E_GL_EXT_texture_array)))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||
extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_texture_shadow_lod] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_texture_array] = EBhDisable;
|
||||
|
||||
// OVR extensions
|
||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||
|
|
@ -580,6 +581,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
"#define GL_EXT_shader_atomic_float2 1\n"
|
||||
|
||||
"#define GL_EXT_fragment_shader_barycentric 1\n"
|
||||
"#define GL_EXT_texture_array 1\n"
|
||||
;
|
||||
|
||||
if (spvVersion.spv == 0) {
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intr
|
|||
const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric";
|
||||
const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader";
|
||||
const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap";
|
||||
const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue