Merge branch 'master' into textureQueryLOD
This commit is contained in:
commit
a40e4ac3f7
166 changed files with 8875 additions and 4653 deletions
|
|
@ -3,7 +3,7 @@
|
|||
// Copyright (C) 2012-2016 LunarG, Inc.
|
||||
// Copyright (C) 2015-2020 Google, Inc.
|
||||
// Copyright (C) 2017 ARM Limited.
|
||||
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
|
|
@ -1865,6 +1865,22 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
|
||||
"\n");
|
||||
}
|
||||
if (profile != EEsProfile && version == 450) {
|
||||
commonBuiltins.append(
|
||||
"uint atomicCounterAddARB(atomic_uint, uint);"
|
||||
"uint atomicCounterSubtractARB(atomic_uint, uint);"
|
||||
"uint atomicCounterMinARB(atomic_uint, uint);"
|
||||
"uint atomicCounterMaxARB(atomic_uint, uint);"
|
||||
"uint atomicCounterAndARB(atomic_uint, uint);"
|
||||
"uint atomicCounterOrARB(atomic_uint, uint);"
|
||||
"uint atomicCounterXorARB(atomic_uint, uint);"
|
||||
"uint atomicCounterExchangeARB(atomic_uint, uint);"
|
||||
"uint atomicCounterCompSwapARB(atomic_uint, uint, uint);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
commonBuiltins.append(
|
||||
"uint atomicCounterAdd(atomic_uint, uint);"
|
||||
|
|
@ -4144,106 +4160,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"u16vec4 unpack16(uint64_t);"
|
||||
"i32vec2 unpack32(int64_t);"
|
||||
"u32vec2 unpack32(uint64_t);"
|
||||
|
||||
"float64_t radians(float64_t);"
|
||||
"f64vec2 radians(f64vec2);"
|
||||
"f64vec3 radians(f64vec3);"
|
||||
"f64vec4 radians(f64vec4);"
|
||||
|
||||
"float64_t degrees(float64_t);"
|
||||
"f64vec2 degrees(f64vec2);"
|
||||
"f64vec3 degrees(f64vec3);"
|
||||
"f64vec4 degrees(f64vec4);"
|
||||
|
||||
"float64_t sin(float64_t);"
|
||||
"f64vec2 sin(f64vec2);"
|
||||
"f64vec3 sin(f64vec3);"
|
||||
"f64vec4 sin(f64vec4);"
|
||||
|
||||
"float64_t cos(float64_t);"
|
||||
"f64vec2 cos(f64vec2);"
|
||||
"f64vec3 cos(f64vec3);"
|
||||
"f64vec4 cos(f64vec4);"
|
||||
|
||||
"float64_t tan(float64_t);"
|
||||
"f64vec2 tan(f64vec2);"
|
||||
"f64vec3 tan(f64vec3);"
|
||||
"f64vec4 tan(f64vec4);"
|
||||
|
||||
"float64_t asin(float64_t);"
|
||||
"f64vec2 asin(f64vec2);"
|
||||
"f64vec3 asin(f64vec3);"
|
||||
"f64vec4 asin(f64vec4);"
|
||||
|
||||
"float64_t acos(float64_t);"
|
||||
"f64vec2 acos(f64vec2);"
|
||||
"f64vec3 acos(f64vec3);"
|
||||
"f64vec4 acos(f64vec4);"
|
||||
|
||||
"float64_t atan(float64_t, float64_t);"
|
||||
"f64vec2 atan(f64vec2, f64vec2);"
|
||||
"f64vec3 atan(f64vec3, f64vec3);"
|
||||
"f64vec4 atan(f64vec4, f64vec4);"
|
||||
|
||||
"float64_t atan(float64_t);"
|
||||
"f64vec2 atan(f64vec2);"
|
||||
"f64vec3 atan(f64vec3);"
|
||||
"f64vec4 atan(f64vec4);"
|
||||
|
||||
"float64_t sinh(float64_t);"
|
||||
"f64vec2 sinh(f64vec2);"
|
||||
"f64vec3 sinh(f64vec3);"
|
||||
"f64vec4 sinh(f64vec4);"
|
||||
|
||||
"float64_t cosh(float64_t);"
|
||||
"f64vec2 cosh(f64vec2);"
|
||||
"f64vec3 cosh(f64vec3);"
|
||||
"f64vec4 cosh(f64vec4);"
|
||||
|
||||
"float64_t tanh(float64_t);"
|
||||
"f64vec2 tanh(f64vec2);"
|
||||
"f64vec3 tanh(f64vec3);"
|
||||
"f64vec4 tanh(f64vec4);"
|
||||
|
||||
"float64_t asinh(float64_t);"
|
||||
"f64vec2 asinh(f64vec2);"
|
||||
"f64vec3 asinh(f64vec3);"
|
||||
"f64vec4 asinh(f64vec4);"
|
||||
|
||||
"float64_t acosh(float64_t);"
|
||||
"f64vec2 acosh(f64vec2);"
|
||||
"f64vec3 acosh(f64vec3);"
|
||||
"f64vec4 acosh(f64vec4);"
|
||||
|
||||
"float64_t atanh(float64_t);"
|
||||
"f64vec2 atanh(f64vec2);"
|
||||
"f64vec3 atanh(f64vec3);"
|
||||
"f64vec4 atanh(f64vec4);"
|
||||
|
||||
"float64_t pow(float64_t, float64_t);"
|
||||
"f64vec2 pow(f64vec2, f64vec2);"
|
||||
"f64vec3 pow(f64vec3, f64vec3);"
|
||||
"f64vec4 pow(f64vec4, f64vec4);"
|
||||
|
||||
"float64_t exp(float64_t);"
|
||||
"f64vec2 exp(f64vec2);"
|
||||
"f64vec3 exp(f64vec3);"
|
||||
"f64vec4 exp(f64vec4);"
|
||||
|
||||
"float64_t log(float64_t);"
|
||||
"f64vec2 log(f64vec2);"
|
||||
"f64vec3 log(f64vec3);"
|
||||
"f64vec4 log(f64vec4);"
|
||||
|
||||
"float64_t exp2(float64_t);"
|
||||
"f64vec2 exp2(f64vec2);"
|
||||
"f64vec3 exp2(f64vec3);"
|
||||
"f64vec4 exp2(f64vec4);"
|
||||
|
||||
"float64_t log2(float64_t);"
|
||||
"f64vec2 log2(f64vec2);"
|
||||
"f64vec3 log2(f64vec3);"
|
||||
"f64vec4 log2(f64vec4);"
|
||||
"\n");
|
||||
}
|
||||
|
||||
|
|
@ -4638,7 +4554,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
// GL_ARB_shader_clock & GL_EXT_shader_realtime_clock
|
||||
// GL_ARB_shader_clock& GL_EXT_shader_realtime_clock
|
||||
if (profile != EEsProfile && version >= 450) {
|
||||
commonBuiltins.append(
|
||||
"uvec2 clock2x32ARB();"
|
||||
|
|
@ -4662,7 +4578,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
// Builtins for GL_NV_ray_tracing/GL_EXT_ray_tracing/GL_EXT_ray_query
|
||||
// Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);"
|
||||
"void rayQueryTerminateEXT(rayQueryEXT);"
|
||||
|
|
@ -4691,6 +4607,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
|
||||
stageBuiltins[EShLangRayGen].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
|
|
@ -4705,12 +4622,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
stageBuiltins[EShLangClosestHit].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangMiss].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
|
|
@ -5156,9 +5075,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
);
|
||||
}
|
||||
|
||||
if (version >= 450)
|
||||
if (version >= 430)
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
|
||||
);
|
||||
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
|
||||
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
|
||||
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
|
||||
|
|
@ -5294,9 +5217,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"in int gl_InvocationID;"
|
||||
);
|
||||
|
||||
if (version >= 450)
|
||||
if (version >= 430)
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
|
||||
);
|
||||
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangGeometry].append(
|
||||
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
|
||||
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
|
||||
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
|
||||
|
|
@ -5372,7 +5299,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
if (version >= 450)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"float gl_CullDistance[];"
|
||||
);
|
||||
if (version >= 430)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"int gl_ViewportMask[];" // GL_NV_viewport_array2
|
||||
);
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
|
||||
"int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
|
||||
"vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
|
||||
|
|
@ -5475,9 +5408,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"out int gl_Layer;"
|
||||
"\n");
|
||||
|
||||
if (version >= 450)
|
||||
if (version >= 430)
|
||||
stageBuiltins[EShLangTessEvaluation].append(
|
||||
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
|
||||
);
|
||||
|
||||
if (version >= 450)
|
||||
stageBuiltins[EShLangTessEvaluation].append(
|
||||
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
|
||||
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
|
||||
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
|
||||
|
|
@ -5919,6 +5856,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"in mat3x4 gl_WorldToObject3x4EXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
const char *hitDecls =
|
||||
"in uvec3 gl_LaunchIDNV;"
|
||||
|
|
@ -5954,6 +5892,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"in mat3x4 gl_WorldToObject3x4EXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
const char *missDecls =
|
||||
"in uvec3 gl_LaunchIDNV;"
|
||||
|
|
@ -5972,6 +5911,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"in float gl_RayTmaxEXT;"
|
||||
"in uint gl_IncomingRayFlagsNV;"
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"\n";
|
||||
|
||||
const char *callableDecls =
|
||||
|
|
@ -7686,6 +7626,11 @@ static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolT
|
|||
symQualifier.builtIn = builtIn;
|
||||
}
|
||||
|
||||
static void RetargetVariable(const char* from, const char* to, TSymbolTable& symbolTable)
|
||||
{
|
||||
symbolTable.retargetSymbol(from, to);
|
||||
}
|
||||
|
||||
//
|
||||
// For built-in variables inside a named block.
|
||||
// SpecialQualifier() won't ever go inside a block; their member's qualifier come
|
||||
|
|
@ -7753,8 +7698,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) {
|
||||
// treat these built-ins as aliases of VertexIndex and InstanceIndex
|
||||
BuiltInVariable("gl_VertexID", EbvVertexIndex, symbolTable);
|
||||
BuiltInVariable("gl_InstanceID", EbvInstanceIndex, symbolTable);
|
||||
RetargetVariable("gl_InstanceID", "gl_InstanceIndex", symbolTable);
|
||||
RetargetVariable("gl_VertexID", "gl_VertexIndex", symbolTable);
|
||||
}
|
||||
|
||||
if (profile != EEsProfile) {
|
||||
|
|
@ -8268,6 +8213,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setFunctionExtensions("atomicCounter" , 1, &E_GL_ARB_shader_atomic_counters);
|
||||
}
|
||||
|
||||
// E_GL_ARB_shader_atomic_counter_ops
|
||||
if (profile != EEsProfile && version == 450) {
|
||||
symbolTable.setFunctionExtensions("atomicCounterAddARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterSubtractARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterMinARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterMaxARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterAndARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterOrARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterXorARB" , 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterExchangeARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
symbolTable.setFunctionExtensions("atomicCounterCompSwapARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
|
||||
}
|
||||
|
||||
// E_GL_ARB_derivative_control
|
||||
if (profile != EEsProfile && version < 450) {
|
||||
symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_ARB_derivative_control);
|
||||
|
|
@ -8375,7 +8333,7 @@ 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("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock);
|
||||
symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock);
|
||||
|
||||
if (profile == EEsProfile && version < 320) {
|
||||
|
|
@ -8796,11 +8754,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur);
|
||||
|
||||
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
|
||||
|
||||
|
||||
symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur);
|
||||
symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
|
|
@ -8844,6 +8804,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable);
|
||||
BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable);
|
||||
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
|
||||
BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable);
|
||||
|
||||
// GL_ARB_shader_ballot
|
||||
symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot);
|
||||
|
|
@ -9268,6 +9229,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("clockRealtimeEXT", EOpReadClockDeviceKHR);
|
||||
symbolTable.relateToOperator("clockRealtime2x32EXT", EOpReadClockDeviceKHR);
|
||||
|
||||
if (profile != EEsProfile && version == 450) {
|
||||
symbolTable.relateToOperator("atomicCounterAddARB", EOpAtomicCounterAdd);
|
||||
symbolTable.relateToOperator("atomicCounterSubtractARB", EOpAtomicCounterSubtract);
|
||||
symbolTable.relateToOperator("atomicCounterMinARB", EOpAtomicCounterMin);
|
||||
symbolTable.relateToOperator("atomicCounterMaxARB", EOpAtomicCounterMax);
|
||||
symbolTable.relateToOperator("atomicCounterAndARB", EOpAtomicCounterAnd);
|
||||
symbolTable.relateToOperator("atomicCounterOrARB", EOpAtomicCounterOr);
|
||||
symbolTable.relateToOperator("atomicCounterXorARB", EOpAtomicCounterXor);
|
||||
symbolTable.relateToOperator("atomicCounterExchangeARB", EOpAtomicCounterExchange);
|
||||
symbolTable.relateToOperator("atomicCounterCompSwapARB", EOpAtomicCounterCompSwap);
|
||||
}
|
||||
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicCounterAdd);
|
||||
symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicCounterSubtract);
|
||||
|
|
@ -9675,6 +9648,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
case EShLangMiss:
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
symbolTable.relateToOperator("traceNV", EOpTraceNV);
|
||||
symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV);
|
||||
symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR);
|
||||
symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV);
|
||||
symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue