|
@@ -1609,6 +1609,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
"vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3
|
|
"vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3
|
|
"\n");
|
|
"\n");
|
|
}
|
|
}
|
|
|
|
+ commonBuiltins.append(
|
|
|
|
+ "highp ivec2 textureSize(__samplerExternal2DY2YEXT, int lod);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 texture(__samplerExternal2DY2YEXT, vec2);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 texture(__samplerExternal2DY2YEXT, vec2, float bias);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 textureProj(__samplerExternal2DY2YEXT, vec3);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 textureProj(__samplerExternal2DY2YEXT, vec3, float bias);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 textureProj(__samplerExternal2DY2YEXT, vec4);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 textureProj(__samplerExternal2DY2YEXT, vec4, float bias);" // GL_EXT_YUV_target
|
|
|
|
+ "vec4 texelFetch(__samplerExternal2DY2YEXT sampler, ivec2, int lod);" // GL_EXT_YUV_target
|
|
|
|
+ "\n");
|
|
commonBuiltins.append(
|
|
commonBuiltins.append(
|
|
"vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod
|
|
"vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod
|
|
"vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod
|
|
"vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod
|
|
@@ -1869,7 +1879,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
commonBuiltins.append(
|
|
commonBuiltins.append(
|
|
"void subgroupBarrier();"
|
|
"void subgroupBarrier();"
|
|
"void subgroupMemoryBarrier();"
|
|
"void subgroupMemoryBarrier();"
|
|
@@ -4930,6 +4941,34 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
commonBuiltins.append("void controlBarrier(int, int, int, int);\n"
|
|
commonBuiltins.append("void controlBarrier(int, int, int, int);\n"
|
|
"void memoryBarrier(int, int, int);\n");
|
|
"void memoryBarrier(int, int, int);\n");
|
|
|
|
|
|
|
|
+ if (profile != EEsProfile && version >= 450) {
|
|
|
|
+ // coopMatStoreNV perhaps ought to have "out" on the buf parameter, but
|
|
|
|
+ // adding it introduces undesirable tempArgs on the stack. What we want
|
|
|
|
+ // is more like "buf" thought of as a pointer value being an in parameter.
|
|
|
|
+ stageBuiltins[EShLangCompute].append(
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent float16_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent float[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uint8_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uint16_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uint[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uint64_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uvec2[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatLoadNV(out fcoopmatNV m, volatile coherent uvec4[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent float16_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent float[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent float64_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uint8_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uint16_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uint[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uint64_t[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uvec2[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+ "void coopMatStoreNV(fcoopmatNV m, volatile coherent uvec4[] buf, uint element, uint stride, bool colMajor);\n"
|
|
|
|
+
|
|
|
|
+ "fcoopmatNV coopMatMulAddNV(fcoopmatNV A, fcoopmatNV B, fcoopmatNV C);\n"
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
//============================================================================
|
|
//============================================================================
|
|
//
|
|
//
|
|
// Prototypes for built-in functions seen by fragment shaders only.
|
|
// Prototypes for built-in functions seen by fragment shaders only.
|
|
@@ -5362,6 +5401,9 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
"in highp uvec3 gl_GlobalInvocationID;"
|
|
"in highp uvec3 gl_GlobalInvocationID;"
|
|
"in highp uint gl_LocalInvocationIndex;"
|
|
"in highp uint gl_LocalInvocationIndex;"
|
|
|
|
|
|
|
|
+ "in uint gl_MeshViewCountNV;"
|
|
|
|
+ "in uint gl_MeshViewIndicesNV[4];"
|
|
|
|
+
|
|
"\n");
|
|
"\n");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5768,7 +5810,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
"patch out highp float gl_TessLevelOuter[4];"
|
|
"patch out highp float gl_TessLevelOuter[4];"
|
|
"patch out highp float gl_TessLevelInner[2];"
|
|
"patch out highp float gl_TessLevelInner[2];"
|
|
"patch out highp vec4 gl_BoundingBoxOES[2];"
|
|
"patch out highp vec4 gl_BoundingBoxOES[2];"
|
|
|
|
+ "patch out highp vec4 gl_BoundingBoxEXT[2];"
|
|
"\n");
|
|
"\n");
|
|
|
|
+ if (profile == EEsProfile && version >= 320) {
|
|
|
|
+ stageBuiltins[EShLangTessControl].append(
|
|
|
|
+ "patch out highp vec4 gl_BoundingBox[2];"
|
|
|
|
+ "\n"
|
|
|
|
+ );
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if ((profile != EEsProfile && version >= 140) ||
|
|
if ((profile != EEsProfile && version >= 140) ||
|
|
@@ -6093,7 +6142,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
const char* ballotDecls =
|
|
const char* ballotDecls =
|
|
"in mediump uint gl_SubgroupSize;"
|
|
"in mediump uint gl_SubgroupSize;"
|
|
"in mediump uint gl_SubgroupInvocationID;"
|
|
"in mediump uint gl_SubgroupInvocationID;"
|
|
@@ -6207,7 +6257,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
const char *callableDecls =
|
|
const char *callableDecls =
|
|
"in uvec3 gl_LaunchIDNV;"
|
|
"in uvec3 gl_LaunchIDNV;"
|
|
"in uvec3 gl_LaunchSizeNV;"
|
|
"in uvec3 gl_LaunchSizeNV;"
|
|
- "in uint gl_IncomingRayFlagsNV;"
|
|
|
|
"\n";
|
|
"\n";
|
|
|
|
|
|
stageBuiltins[EShLangRayGenNV].append(rayGenDecls);
|
|
stageBuiltins[EShLangRayGenNV].append(rayGenDecls);
|
|
@@ -7752,11 +7801,12 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|
static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
{
|
|
{
|
|
TSymbol* symbol = symbolTable.find(name);
|
|
TSymbol* symbol = symbolTable.find(name);
|
|
- if (symbol) {
|
|
|
|
- TQualifier& symQualifier = symbol->getWritableType().getQualifier();
|
|
|
|
- symQualifier.storage = qualifier;
|
|
|
|
- symQualifier.builtIn = builtIn;
|
|
|
|
- }
|
|
|
|
|
|
+ if (symbol == nullptr)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ TQualifier& symQualifier = symbol->getWritableType().getQualifier();
|
|
|
|
+ symQualifier.storage = qualifier;
|
|
|
|
+ symQualifier.builtIn = builtIn;
|
|
}
|
|
}
|
|
|
|
|
|
//
|
|
//
|
|
@@ -7772,7 +7822,7 @@ static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBui
|
|
static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
{
|
|
{
|
|
TSymbol* symbol = symbolTable.find(name);
|
|
TSymbol* symbol = symbolTable.find(name);
|
|
- if (! symbol)
|
|
|
|
|
|
+ if (symbol == nullptr)
|
|
return;
|
|
return;
|
|
|
|
|
|
TQualifier& symQualifier = symbol->getWritableType().getQualifier();
|
|
TQualifier& symQualifier = symbol->getWritableType().getQualifier();
|
|
@@ -7789,7 +7839,7 @@ static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolT
|
|
static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable)
|
|
{
|
|
{
|
|
TSymbol* symbol = symbolTable.find(blockName);
|
|
TSymbol* symbol = symbolTable.find(blockName);
|
|
- if (! symbol)
|
|
|
|
|
|
+ if (symbol == nullptr)
|
|
return;
|
|
return;
|
|
|
|
|
|
TTypeList& structure = *symbol->getWritableType().getWritableStruct();
|
|
TTypeList& structure = *symbol->getWritableType().getWritableStruct();
|
|
@@ -7987,10 +8037,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
|
|
|
case EShLangTessControl:
|
|
case EShLangTessControl:
|
|
if (profile == EEsProfile && version >= 310) {
|
|
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);
|
|
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
|
|
// Fall through
|
|
@@ -8045,9 +8101,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
BuiltInVariable("gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable);
|
|
|
|
|
|
if (language != EShLangVertex) {
|
|
if (language != EShLangVertex) {
|
|
|
|
+ symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes);
|
|
|
|
+
|
|
BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable);
|
|
}
|
|
}
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_ViewportMask", 1, &E_GL_NV_viewport_array2);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes);
|
|
|
|
+
|
|
BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable);
|
|
BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable);
|
|
BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
|
|
BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
|
|
BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable);
|
|
BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable);
|
|
@@ -8091,15 +8156,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
|
|
|
// gl_PointSize, when it needs to be tied to an extension, is always a member of a block.
|
|
// gl_PointSize, when it needs to be tied to an extension, is always a member of a block.
|
|
// (Sometimes with an instance name, sometimes anonymous).
|
|
// (Sometimes with an instance name, sometimes anonymous).
|
|
- // However, the current automatic extension scheme does not work per block member,
|
|
|
|
- // so for now check when parsing.
|
|
|
|
- //
|
|
|
|
- // if (profile == EEsProfile) {
|
|
|
|
- // if (language == EShLangGeometry)
|
|
|
|
- // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size);
|
|
|
|
- // else if (language == EShLangTessEvaluation || language == EShLangTessControl)
|
|
|
|
- // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size);
|
|
|
|
- //}
|
|
|
|
|
|
+ if (profile == EEsProfile) {
|
|
|
|
+ if (language == EShLangGeometry) {
|
|
|
|
+ symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size);
|
|
|
|
+ } else if (language == EShLangTessEvaluation || language == EShLangTessControl) {
|
|
|
|
+ // gl_in tessellation settings of gl_PointSize are in the context-dependent paths
|
|
|
|
+ symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_out", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
if ((profile != EEsProfile && version >= 140) ||
|
|
if ((profile != EEsProfile && version >= 140) ||
|
|
(profile == EEsProfile && version >= 310)) {
|
|
(profile == EEsProfile && version >= 310)) {
|
|
@@ -8110,7 +8176,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
@@ -8450,7 +8517,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
@@ -8634,7 +8702,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot);
|
|
@@ -8661,7 +8730,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
|
|
|
|
@@ -8670,6 +8740,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
|
|
|
symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ symbolTable.setFunctionExtensions("coopMatLoadNV", 1, &E_GL_NV_cooperative_matrix);
|
|
|
|
+ symbolTable.setFunctionExtensions("coopMatStoreNV", 1, &E_GL_NV_cooperative_matrix);
|
|
|
|
+ symbolTable.setFunctionExtensions("coopMatMulAddNV", 1, &E_GL_NV_cooperative_matrix);
|
|
|
|
+
|
|
break;
|
|
break;
|
|
#ifdef NV_EXTENSIONS
|
|
#ifdef NV_EXTENSIONS
|
|
case EShLangRayGenNV:
|
|
case EShLangRayGenNV:
|
|
@@ -8719,25 +8794,44 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
break;
|
|
break;
|
|
case EShLangMeshNV:
|
|
case EShLangMeshNV:
|
|
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
|
|
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
|
|
- // Per-vertex builtins
|
|
|
|
|
|
+ // per-vertex builtins
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_Position", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PointSize", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistance", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistance", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable);
|
|
- // Per-view builtins
|
|
|
|
|
|
+
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PositionPerViewNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable);
|
|
|
|
|
|
- // Per-primitive builtins
|
|
|
|
|
|
+ // per-primitive builtins
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_PrimitiveID", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_Layer", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportIndex", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMask", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable);
|
|
- // Per-view builtins
|
|
|
|
|
|
+
|
|
|
|
+ // per-view per-primitive builtins
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable);
|
|
BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable);
|
|
|
|
|
|
|
|
+ // other builtins
|
|
symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
@@ -8758,11 +8852,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
|
|
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
|
|
|
|
|
|
|
|
+ // builtin constants
|
|
symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
|
|
|
|
+ // builtin functions
|
|
symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
|
|
@@ -8804,7 +8900,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
@@ -8837,6 +8934,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
|
|
BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable);
|
|
BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable);
|
|
BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable);
|
|
BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable);
|
|
@@ -8844,8 +8943,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
|
|
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
|
|
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
|
|
|
|
+ BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable);
|
|
|
|
+ BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable);
|
|
|
|
|
|
symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
+ symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader);
|
|
|
|
|
|
symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
|
|
symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
|
|
@@ -8888,7 +8990,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic);
|
|
@@ -9314,7 +9417,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
}
|
|
}
|
|
|
|
|
|
// GL_KHR_shader_subgroup
|
|
// GL_KHR_shader_subgroup
|
|
- if (spvVersion.vulkan > 0) {
|
|
|
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier);
|
|
symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier);
|
|
symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier);
|
|
symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier);
|
|
symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer);
|
|
symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer);
|
|
@@ -9457,6 +9561,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse);
|
|
symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
+ symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoad);
|
|
|
|
+ symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStore);
|
|
|
|
+ symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAdd);
|
|
break;
|
|
break;
|
|
|
|
|
|
#ifdef NV_EXTENSIONS
|
|
#ifdef NV_EXTENSIONS
|
|
@@ -9556,6 +9663,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable);
|
|
BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable);
|
|
|
|
+
|
|
|
|
+ // extension requirements
|
|
|
|
+ if (profile == EEsProfile) {
|
|
|
|
+ symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size);
|
|
|
|
+ }
|
|
|
|
+
|
|
break;
|
|
break;
|
|
|
|
|
|
default:
|
|
default:
|