|
|
@@ -316,6 +316,7 @@ const CustomFunction CustomFunctions[] = {
|
|
|
|
|
|
{ EOpTextureQuerySize, "textureSize", nullptr },
|
|
|
{ EOpTextureQueryLod, "textureQueryLod", nullptr },
|
|
|
+ { EOpTextureQueryLod, "textureQueryLOD", nullptr }, // extension GL_ARB_texture_query_lod
|
|
|
{ EOpTextureQueryLevels, "textureQueryLevels", nullptr },
|
|
|
{ EOpTextureQuerySamples, "textureSamples", nullptr },
|
|
|
{ EOpTexture, "texture", nullptr },
|
|
|
@@ -4553,11 +4554,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
"\n");
|
|
|
}
|
|
|
|
|
|
- // GL_ARB_shader_clock
|
|
|
+ // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock
|
|
|
if (profile != EEsProfile && version >= 450) {
|
|
|
commonBuiltins.append(
|
|
|
"uvec2 clock2x32ARB();"
|
|
|
"uint64_t clockARB();"
|
|
|
+ "uvec2 clockRealtime2x32EXT();"
|
|
|
+ "uint64_t clockRealtimeEXT();"
|
|
|
"\n");
|
|
|
}
|
|
|
|
|
|
@@ -6245,38 +6248,44 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int
|
|
|
//
|
|
|
// textureQueryLod(), fragment stage only
|
|
|
// Also enabled with extension GL_ARB_texture_query_lod
|
|
|
+ // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension.
|
|
|
|
|
|
if (profile != EEsProfile && version >= 150 && sampler.isCombined() && sampler.dim != EsdRect &&
|
|
|
! sampler.isMultiSample() && ! sampler.isBuffer()) {
|
|
|
- for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
|
|
|
- if (f16TexAddr && sampler.type != EbtFloat16)
|
|
|
- continue;
|
|
|
- stageBuiltins[EShLangFragment].append("vec2 textureQueryLod(");
|
|
|
- stageBuiltins[EShLangFragment].append(typeName);
|
|
|
+
|
|
|
+ const TString funcName[2] = {"vec2 textureQueryLod(", "vec2 textureQueryLOD("};
|
|
|
+
|
|
|
+ for (int i = 0; i < 2; ++i){
|
|
|
+ for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
|
|
|
+ if (f16TexAddr && sampler.type != EbtFloat16)
|
|
|
+ continue;
|
|
|
+ stageBuiltins[EShLangFragment].append(funcName[i]);
|
|
|
+ stageBuiltins[EShLangFragment].append(typeName);
|
|
|
+ if (dimMap[sampler.dim] == 1)
|
|
|
+ if (f16TexAddr)
|
|
|
+ stageBuiltins[EShLangFragment].append(", float16_t");
|
|
|
+ else
|
|
|
+ stageBuiltins[EShLangFragment].append(", float");
|
|
|
+ else {
|
|
|
+ if (f16TexAddr)
|
|
|
+ stageBuiltins[EShLangFragment].append(", f16vec");
|
|
|
+ else
|
|
|
+ stageBuiltins[EShLangFragment].append(", vec");
|
|
|
+ stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
|
|
|
+ }
|
|
|
+ stageBuiltins[EShLangFragment].append(");\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ stageBuiltins[EShLangCompute].append(funcName[i]);
|
|
|
+ stageBuiltins[EShLangCompute].append(typeName);
|
|
|
if (dimMap[sampler.dim] == 1)
|
|
|
- if (f16TexAddr)
|
|
|
- stageBuiltins[EShLangFragment].append(", float16_t");
|
|
|
- else
|
|
|
- stageBuiltins[EShLangFragment].append(", float");
|
|
|
+ stageBuiltins[EShLangCompute].append(", float");
|
|
|
else {
|
|
|
- if (f16TexAddr)
|
|
|
- stageBuiltins[EShLangFragment].append(", f16vec");
|
|
|
- else
|
|
|
- stageBuiltins[EShLangFragment].append(", vec");
|
|
|
- stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
|
|
|
+ stageBuiltins[EShLangCompute].append(", vec");
|
|
|
+ stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
|
|
|
}
|
|
|
- stageBuiltins[EShLangFragment].append(");\n");
|
|
|
+ stageBuiltins[EShLangCompute].append(");\n");
|
|
|
}
|
|
|
-
|
|
|
- stageBuiltins[EShLangCompute].append("vec2 textureQueryLod(");
|
|
|
- stageBuiltins[EShLangCompute].append(typeName);
|
|
|
- if (dimMap[sampler.dim] == 1)
|
|
|
- stageBuiltins[EShLangCompute].append(", float");
|
|
|
- else {
|
|
|
- stageBuiltins[EShLangCompute].append(", vec");
|
|
|
- stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
|
|
|
- }
|
|
|
- stageBuiltins[EShLangCompute].append(");\n");
|
|
|
}
|
|
|
|
|
|
//
|
|
|
@@ -8061,7 +8070,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
}
|
|
|
|
|
|
if (profile != EEsProfile && version < 400) {
|
|
|
- symbolTable.setFunctionExtensions("textureQueryLod", 1, &E_GL_ARB_texture_query_lod);
|
|
|
+ symbolTable.setFunctionExtensions("textureQueryLOD", 1, &E_GL_ARB_texture_query_lod);
|
|
|
}
|
|
|
|
|
|
if (profile != EEsProfile && version >= 460) {
|
|
|
@@ -8324,6 +8333,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock);
|
|
|
symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock);
|
|
|
|
|
|
+ symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock);
|
|
|
+ symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock);
|
|
|
+
|
|
|
if (profile == EEsProfile && version < 320) {
|
|
|
symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader);
|
|
|
symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader);
|