mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 12:00:05 +00:00
Add GL_EXT_fragment_shading_rate
This commit is contained in:
parent
f4f1d8a352
commit
a315b5633b
@ -48,4 +48,5 @@ static const char* const E_SPV_KHR_shader_clock = "SPV_KHR_shade
|
||||
static const char* const E_SPV_KHR_non_semantic_info = "SPV_KHR_non_semantic_info";
|
||||
static const char* const E_SPV_KHR_ray_tracing = "SPV_KHR_ray_tracing";
|
||||
static const char* const E_SPV_KHR_ray_query = "SPV_KHR_ray_query";
|
||||
static const char* const E_SPV_KHR_fragment_shading_rate = "SPV_KHR_fragment_shading_rate";
|
||||
#endif // #ifndef GLSLextKHR_H
|
||||
|
@ -769,6 +769,16 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
builder.addCapability(spv::CapabilityStencilExportEXT);
|
||||
return spv::BuiltInFragStencilRefEXT;
|
||||
|
||||
case glslang::EbvShadingRateKHR:
|
||||
builder.addExtension(spv::E_SPV_KHR_fragment_shading_rate);
|
||||
builder.addCapability(spv::CapabilityFragmentShadingRateKHR);
|
||||
return spv::BuiltInShadingRateKHR;
|
||||
|
||||
case glslang::EbvPrimitiveShadingRateKHR:
|
||||
builder.addExtension(spv::E_SPV_KHR_fragment_shading_rate);
|
||||
builder.addCapability(spv::CapabilityFragmentShadingRateKHR);
|
||||
return spv::BuiltInPrimitiveShadingRateKHR;
|
||||
|
||||
case glslang::EbvInvocationId: return spv::BuiltInInvocationId;
|
||||
case glslang::EbvTessLevelInner: return spv::BuiltInTessLevelInner;
|
||||
case glslang::EbvTessLevelOuter: return spv::BuiltInTessLevelOuter;
|
||||
|
@ -372,6 +372,8 @@ const char* BuiltInString(int builtIn)
|
||||
case 4424: return "BaseVertex";
|
||||
case 4425: return "BaseInstance";
|
||||
case 4426: return "DrawIndex";
|
||||
case 4432: return "PrimitiveShadingRateKHR";
|
||||
case 4444: return "ShadingRateKHR";
|
||||
case 5014: return "FragStencilRefEXT";
|
||||
|
||||
case 4992: return "BaryCoordNoPerspAMD";
|
||||
@ -952,6 +954,8 @@ const char* CapabilityString(int info)
|
||||
case CapabilityFragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT";
|
||||
case CapabilityFragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT";
|
||||
|
||||
case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR";
|
||||
|
||||
case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT";
|
||||
case CapabilityShaderClockKHR: return "ShaderClockKHR";
|
||||
|
||||
|
@ -558,8 +558,10 @@ enum BuiltIn {
|
||||
BuiltInBaseVertex = 4424,
|
||||
BuiltInBaseInstance = 4425,
|
||||
BuiltInDrawIndex = 4426,
|
||||
BuiltInPrimitiveShadingRateKHR = 4432,
|
||||
BuiltInDeviceIndex = 4438,
|
||||
BuiltInViewIndex = 4440,
|
||||
BuiltInShadingRateKHR = 4444,
|
||||
BuiltInBaryCoordNoPerspAMD = 4992,
|
||||
BuiltInBaryCoordNoPerspCentroidAMD = 4993,
|
||||
BuiltInBaryCoordNoPerspSampleAMD = 4994,
|
||||
@ -870,6 +872,7 @@ enum Capability {
|
||||
CapabilityGroupNonUniformQuad = 68,
|
||||
CapabilityShaderLayer = 69,
|
||||
CapabilityShaderViewportIndex = 70,
|
||||
CapabilityFragmentShadingRateKHR = 4422,
|
||||
CapabilitySubgroupBallotKHR = 4423,
|
||||
CapabilityDrawParameters = 4427,
|
||||
CapabilitySubgroupVoteKHR = 4431,
|
||||
@ -1024,6 +1027,22 @@ enum RayQueryCandidateIntersectionType {
|
||||
RayQueryCandidateIntersectionTypeMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
enum FragmentShadingRateShift {
|
||||
FragmentShadingRateVertical2PixelsShift = 0,
|
||||
FragmentShadingRateVertical4PixelsShift = 1,
|
||||
FragmentShadingRateHorizontal2PixelsShift = 2,
|
||||
FragmentShadingRateHorizontal4PixelsShift = 3,
|
||||
FragmentShadingRateMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
enum FragmentShadingRateMask {
|
||||
FragmentShadingRateMaskNone = 0,
|
||||
FragmentShadingRateVertical2PixelsMask = 0x00000001,
|
||||
FragmentShadingRateVertical4PixelsMask = 0x00000002,
|
||||
FragmentShadingRateHorizontal2PixelsMask = 0x00000004,
|
||||
FragmentShadingRateHorizontal4PixelsMask = 0x00000008,
|
||||
};
|
||||
|
||||
enum Op {
|
||||
OpNop = 0,
|
||||
OpUndef = 1,
|
||||
@ -1369,6 +1388,7 @@ enum Op {
|
||||
OpPtrEqual = 401,
|
||||
OpPtrNotEqual = 402,
|
||||
OpPtrDiff = 403,
|
||||
OpTerminateInvocation = 4416,
|
||||
OpSubgroupBallotKHR = 4421,
|
||||
OpSubgroupFirstInvocationKHR = 4422,
|
||||
OpSubgroupAllKHR = 4428,
|
||||
@ -1939,6 +1959,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpPtrEqual: *hasResult = true; *hasResultType = true; break;
|
||||
case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break;
|
||||
case OpPtrDiff: *hasResult = true; *hasResultType = true; break;
|
||||
case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
|
||||
case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
|
||||
@ -2164,6 +2185,7 @@ inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask
|
||||
inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
|
||||
inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
|
||||
inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
|
||||
inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
|
||||
|
||||
} // end namespace spv
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
spv.builtin.PrimitiveShadingRateEXT.vert
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 26
|
||||
|
||||
Capability Shader
|
||||
Capability FragmentShadingRateKHR
|
||||
Extension "SPV_KHR_fragment_shading_rate"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 8 16
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_fragment_shading_rate"
|
||||
Name 4 "main"
|
||||
Name 8 "id"
|
||||
Name 16 "gl_PrimitiveShadingRateEXT"
|
||||
Decorate 8(id) Location 0
|
||||
Decorate 16(gl_PrimitiveShadingRateEXT) BuiltIn PrimitiveShadingRateKHR
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Input 6(int)
|
||||
8(id): 7(ptr) Variable Input
|
||||
15: TypePointer Output 6(int)
|
||||
16(gl_PrimitiveShadingRateEXT): 15(ptr) Variable Output
|
||||
17: 6(int) Constant 5
|
||||
19: 6(int) Constant 9
|
||||
21: 6(int) Constant 6
|
||||
23: 6(int) Constant 10
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9: 6(int) Load 8(id)
|
||||
SelectionMerge 14 None
|
||||
Switch 9 14
|
||||
case 0: 10
|
||||
case 1: 11
|
||||
case 2: 12
|
||||
case 3: 13
|
||||
10: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 17
|
||||
Branch 14
|
||||
11: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 19
|
||||
Branch 14
|
||||
12: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 21
|
||||
Branch 14
|
||||
13: Label
|
||||
Store 16(gl_PrimitiveShadingRateEXT) 23
|
||||
Branch 14
|
||||
14: Label
|
||||
Return
|
||||
FunctionEnd
|
36
Test/baseResults/spv.builtin.ShadingRateEXT.frag.out
Normal file
36
Test/baseResults/spv.builtin.ShadingRateEXT.frag.out
Normal file
@ -0,0 +1,36 @@
|
||||
spv.builtin.ShadingRateEXT.frag
|
||||
WARNING: 0:5: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
|
||||
"precision mediump int; precision highp float;"
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 12
|
||||
|
||||
Capability Shader
|
||||
Capability FragmentShadingRateKHR
|
||||
Extension "SPV_KHR_fragment_shading_rate"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 8 10
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_fragment_shading_rate"
|
||||
Name 4 "main"
|
||||
Name 8 "val"
|
||||
Name 10 "gl_ShadingRateEXT"
|
||||
Decorate 8(val) Location 0
|
||||
Decorate 10(gl_ShadingRateEXT) Flat
|
||||
Decorate 10(gl_ShadingRateEXT) BuiltIn ShadingRateKHR
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Output 6(int)
|
||||
8(val): 7(ptr) Variable Output
|
||||
9: TypePointer Input 6(int)
|
||||
10(gl_ShadingRateEXT): 9(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
11: 6(int) Load 10(gl_ShadingRateEXT)
|
||||
Store 8(val) 11
|
||||
Return
|
||||
FunctionEnd
|
28
Test/spv.builtin.PrimitiveShadingRateEXT.vert
Normal file
28
Test/spv.builtin.PrimitiveShadingRateEXT.vert
Normal file
@ -0,0 +1,28 @@
|
||||
#version 450
|
||||
|
||||
#extension GL_EXT_fragment_shading_rate : enable
|
||||
|
||||
layout(location = 0) in int id;
|
||||
|
||||
void main()
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
// V2 | H2 => 5
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT;
|
||||
break;
|
||||
case 1:
|
||||
// V2 | H4 => 9
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag2VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT;
|
||||
break;
|
||||
case 2:
|
||||
// V4 | H2 => 6
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag2HorizontalPixelsEXT;
|
||||
break;
|
||||
case 3:
|
||||
// V4 | H4 => 10
|
||||
gl_PrimitiveShadingRateEXT = gl_ShadingRateFlag4VerticalPixelsEXT | gl_ShadingRateFlag4HorizontalPixelsEXT;
|
||||
break;
|
||||
}
|
||||
}
|
8
Test/spv.builtin.ShadingRateEXT.frag
Normal file
8
Test/spv.builtin.ShadingRateEXT.frag
Normal file
@ -0,0 +1,8 @@
|
||||
#version 450
|
||||
|
||||
#extension GL_EXT_fragment_shading_rate : enable
|
||||
|
||||
out highp int val;
|
||||
void main () {
|
||||
val = gl_ShadingRateEXT;
|
||||
}
|
@ -228,6 +228,9 @@ enum TBuiltInVariable {
|
||||
EbvViewIndex,
|
||||
EbvDeviceIndex,
|
||||
|
||||
EbvShadingRateKHR,
|
||||
EbvPrimitiveShadingRateKHR,
|
||||
|
||||
EbvFragSizeEXT,
|
||||
EbvFragInvocationCountEXT,
|
||||
|
||||
@ -480,6 +483,9 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvWarpID: return "WarpIDNV";
|
||||
case EbvSMID: return "SMIDNV";
|
||||
|
||||
case EbvShadingRateKHR: return "ShadingRateKHR";
|
||||
case EbvPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR";
|
||||
|
||||
default: return "unknown built-in variable";
|
||||
}
|
||||
}
|
||||
|
@ -4928,6 +4928,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate
|
||||
"\n");
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
@ -5041,6 +5046,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate
|
||||
"\n");
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// Define the interface to the tessellation control shader.
|
||||
@ -5338,6 +5349,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in vec3 gl_BaryCoordNoPerspNV;"
|
||||
);
|
||||
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"flat in int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate
|
||||
);
|
||||
|
||||
} else {
|
||||
// ES profile
|
||||
|
||||
@ -5396,6 +5412,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in vec3 gl_BaryCoordNV;"
|
||||
"in vec3 gl_BaryCoordNoPerspNV;"
|
||||
);
|
||||
if (version >= 310)
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -5692,6 +5712,18 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2
|
||||
"\n");
|
||||
}
|
||||
|
||||
// Adding these to common built-ins triggers an assert due to a memory corruption in related code when testing
|
||||
// So instead add to each stage individually, avoiding the GLSLang bug
|
||||
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
|
||||
for (int stage=EShLangVertex; stage<EShLangCount; stage++)
|
||||
{
|
||||
stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag2VerticalPixelsEXT = 1;\n");
|
||||
stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag4VerticalPixelsEXT = 2;\n");
|
||||
stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag2HorizontalPixelsEXT = 4;\n");
|
||||
stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag4HorizontalPixelsEXT = 8;\n");
|
||||
}
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
// printf("%s\n", commonBuiltins.c_str());
|
||||
@ -7650,6 +7682,20 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
}
|
||||
|
||||
if (language == EShLangGeometry || language == EShLangVertex) {
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
BuiltInVariable("gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable);
|
||||
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
@ -8156,6 +8202,17 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
}
|
||||
|
||||
symbolTable.setFunctionExtensions("helperInvocationEXT", 1, &E_GL_EXT_demote_to_helper_invocation);
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
BuiltInVariable("gl_ShadingRateEXT", EbvShadingRateKHR, symbolTable);
|
||||
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
@ -8288,6 +8345,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives);
|
||||
symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives);
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
@ -8437,6 +8502,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
}
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
break;
|
||||
|
||||
case EShLangMeshNV:
|
||||
@ -8581,6 +8653,14 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
break;
|
||||
|
||||
case EShLangTaskNV:
|
||||
@ -8681,6 +8761,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
}
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -4226,6 +4226,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
|
||||
(identifier == "gl_FragCoord" && ((nonEsRedecls && version >= 150) || esRedecls)) ||
|
||||
identifier == "gl_ClipDistance" ||
|
||||
identifier == "gl_CullDistance" ||
|
||||
identifier == "gl_ShadingRateEXT" ||
|
||||
identifier == "gl_PrimitiveShadingRateEXT" ||
|
||||
identifier == "gl_FrontColor" ||
|
||||
identifier == "gl_BackColor" ||
|
||||
identifier == "gl_FrontSecondaryColor" ||
|
||||
|
@ -327,6 +327,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_ray_flags_primitive_culling] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_blend_func_extended] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_implicit_conversions] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_fragment_shading_rate] = EBhDisable;
|
||||
|
||||
// OVR extensions
|
||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||
@ -371,6 +372,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_YUV_target 1\n"
|
||||
"#define GL_EXT_shader_texture_lod 1\n"
|
||||
"#define GL_EXT_shadow_samplers 1\n"
|
||||
"#define GL_EXT_fragment_shading_rate 1\n"
|
||||
|
||||
// AEP
|
||||
"#define GL_ANDROID_extension_pack_es31a 1\n"
|
||||
@ -463,6 +465,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_buffer_reference_uvec2 1\n"
|
||||
"#define GL_EXT_demote_to_helper_invocation 1\n"
|
||||
"#define GL_EXT_debug_printf 1\n"
|
||||
"#define GL_EXT_fragment_shading_rate 1\n"
|
||||
|
||||
// GL_KHR_shader_subgroup
|
||||
"#define GL_KHR_shader_subgroup_basic 1\n"
|
||||
|
@ -199,6 +199,7 @@ 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";
|
||||
const char* const E_GL_EXT_shader_implicit_conversions = "GL_EXT_shader_implicit_conversions";
|
||||
const char* const E_GL_EXT_fragment_shading_rate = "GL_EXT_fragment_shading_rate";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
|
@ -446,6 +446,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
"spv.samplerlessTextureFunctions.frag",
|
||||
"spv.smBuiltins.vert",
|
||||
"spv.smBuiltins.frag",
|
||||
"spv.builtin.PrimitiveShadingRateEXT.vert",
|
||||
"spv.builtin.ShadingRateEXT.frag",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
@ -5,14 +5,14 @@
|
||||
"site" : "github",
|
||||
"subrepo" : "KhronosGroup/SPIRV-Tools",
|
||||
"subdir" : "External/spirv-tools",
|
||||
"commit" : "0a1fb588cd365f7737cb121fdd64553923e0cef6"
|
||||
"commit" : "a1d38174b1f7d2651c718ae661886d606cb50a32"
|
||||
},
|
||||
{
|
||||
"name" : "spirv-tools/external/spirv-headers",
|
||||
"site" : "github",
|
||||
"subrepo" : "KhronosGroup/SPIRV-Headers",
|
||||
"subdir" : "External/spirv-tools/external/spirv-headers",
|
||||
"commit" : "060627f0b0d2fa8581b5acb939f46e3b9e500593"
|
||||
"commit" : "05836bdba63e7debce9fa9feaed42f20cd43af9d"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user