|
@@ -2,7 +2,7 @@
|
|
|
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
|
|
|
// Copyright (C) 2012-2016 LunarG, Inc.
|
|
|
// Copyright (C) 2015-2020 Google, Inc.
|
|
|
-// Copyright (C) 2017 ARM Limited.
|
|
|
+// Copyright (C) 2017, 2022-2024 Arm Limited.
|
|
|
// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
//
|
|
|
// All rights reserved.
|
|
@@ -51,7 +51,9 @@
|
|
|
// including identifying what extensions are needed if a version does not allow a symbol
|
|
|
//
|
|
|
|
|
|
+#include <array>
|
|
|
#include "Initialize.h"
|
|
|
+#include "span.h"
|
|
|
|
|
|
namespace glslang {
|
|
|
|
|
@@ -139,20 +141,17 @@ struct Versioning {
|
|
|
EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECompatibilityProfile);
|
|
|
|
|
|
// Declare pointers to put into the table for versioning.
|
|
|
- const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
|
|
|
- { EDesktopProfile, 0, 130, 0, nullptr },
|
|
|
- { EBadProfile } };
|
|
|
- const Versioning* Es300Desktop130 = &Es300Desktop130Version[0];
|
|
|
+ const std::array Es300Desktop130Version = { Versioning{ EEsProfile, 0, 300, 0, nullptr },
|
|
|
+ Versioning{ EDesktopProfile, 0, 130, 0, nullptr },
|
|
|
+ };
|
|
|
|
|
|
- const Versioning Es310Desktop400Version[] = { { EEsProfile, 0, 310, 0, nullptr },
|
|
|
- { EDesktopProfile, 0, 400, 0, nullptr },
|
|
|
- { EBadProfile } };
|
|
|
- const Versioning* Es310Desktop400 = &Es310Desktop400Version[0];
|
|
|
+ const std::array Es310Desktop400Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr },
|
|
|
+ Versioning{ EDesktopProfile, 0, 400, 0, nullptr },
|
|
|
+ };
|
|
|
|
|
|
- const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr },
|
|
|
- { EDesktopProfile, 0, 450, 0, nullptr },
|
|
|
- { EBadProfile } };
|
|
|
- const Versioning* Es310Desktop450 = &Es310Desktop450Version[0];
|
|
|
+ const std::array Es310Desktop450Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr },
|
|
|
+ Versioning{ EDesktopProfile, 0, 450, 0, nullptr },
|
|
|
+ };
|
|
|
|
|
|
// The main descriptor of what a set of function prototypes can look like, and
|
|
|
// a pointer to extra versioning information, when needed.
|
|
@@ -162,7 +161,7 @@ struct BuiltInFunction {
|
|
|
int numArguments; // number of arguments (overloads with varying arguments need different entries)
|
|
|
ArgType types; // ArgType mask
|
|
|
ArgClass classes; // the ways this particular function entry manifests
|
|
|
- const Versioning* versioning; // nullptr means always a valid version
|
|
|
+ const span<const Versioning> versioning; // An empty span means always a valid version
|
|
|
};
|
|
|
|
|
|
// The tables can have the same built-in function name more than one time,
|
|
@@ -174,151 +173,146 @@ struct BuiltInFunction {
|
|
|
//
|
|
|
// Table is terminated by an OpNull TOperator.
|
|
|
|
|
|
-const BuiltInFunction BaseFunctions[] = {
|
|
|
+const std::array BaseFunctions = {
|
|
|
// TOperator, name, arg-count, ArgType, ArgClass, versioning
|
|
|
// --------- ---- --------- ------- -------- ----------
|
|
|
- { EOpRadians, "radians", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpDegrees, "degrees", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpSin, "sin", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpCos, "cos", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpTan, "tan", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpAsin, "asin", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpAcos, "acos", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpAtan, "atan", 2, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpAtan, "atan", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpPow, "pow", 2, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpExp, "exp", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpLog, "log", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpExp2, "exp2", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpLog2, "log2", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpSqrt, "sqrt", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpAbs, "abs", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpSign, "sign", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpFloor, "floor", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpCeil, "ceil", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpFract, "fract", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpMod, "mod", 2, TypeF, ClassLS, nullptr },
|
|
|
- { EOpMin, "min", 2, TypeF, ClassLS, nullptr },
|
|
|
- { EOpMax, "max", 2, TypeF, ClassLS, nullptr },
|
|
|
- { EOpClamp, "clamp", 3, TypeF, ClassLS2, nullptr },
|
|
|
- { EOpMix, "mix", 3, TypeF, ClassLS, nullptr },
|
|
|
- { EOpStep, "step", 2, TypeF, ClassFS, nullptr },
|
|
|
- { EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, nullptr },
|
|
|
- { EOpNormalize, "normalize", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpReflect, "reflect", 2, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpRefract, "refract", 3, TypeF, ClassXLS, nullptr },
|
|
|
- { EOpLength, "length", 1, TypeF, ClassRS, nullptr },
|
|
|
- { EOpDistance, "distance", 2, TypeF, ClassRS, nullptr },
|
|
|
- { EOpDot, "dot", 2, TypeF, ClassRS, nullptr },
|
|
|
- { EOpCross, "cross", 2, TypeF, ClassV3, nullptr },
|
|
|
- { EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, nullptr },
|
|
|
- { EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, nullptr },
|
|
|
- { EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, nullptr },
|
|
|
- { EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, nullptr },
|
|
|
- { EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, nullptr },
|
|
|
- { EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, nullptr },
|
|
|
- { EOpAny, "any", 1, TypeB, ClassRSNS, nullptr },
|
|
|
- { EOpAll, "all", 1, TypeB, ClassRSNS, nullptr },
|
|
|
- { EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, nullptr },
|
|
|
- { EOpSinh, "sinh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpCosh, "cosh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpTanh, "tanh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpAsinh, "asinh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpAcosh, "acosh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpAtanh, "atanh", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpAbs, "abs", 1, TypeI, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpSign, "sign", 1, TypeI, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpTrunc, "trunc", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpRound, "round", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, Es300Desktop130 },
|
|
|
- { EOpModf, "modf", 2, TypeF, ClassLO, Es300Desktop130 },
|
|
|
- { EOpMin, "min", 2, TypeIU, ClassLS, Es300Desktop130 },
|
|
|
- { EOpMax, "max", 2, TypeIU, ClassLS, Es300Desktop130 },
|
|
|
- { EOpClamp, "clamp", 3, TypeIU, ClassLS2, Es300Desktop130 },
|
|
|
- { EOpMix, "mix", 3, TypeF, ClassLB, Es300Desktop130 },
|
|
|
- { EOpIsInf, "isinf", 1, TypeF, ClassB, Es300Desktop130 },
|
|
|
- { EOpIsNan, "isnan", 1, TypeF, ClassB, Es300Desktop130 },
|
|
|
- { EOpLessThan, "lessThan", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpVectorEqual, "equal", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, Es300Desktop130 },
|
|
|
- { EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop400 },
|
|
|
- { EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 },
|
|
|
- { EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
|
|
|
-
|
|
|
- { EOpNull }
|
|
|
+ BuiltInFunction{ EOpRadians, "radians", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpDegrees, "degrees", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpSin, "sin", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpCos, "cos", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpTan, "tan", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpAsin, "asin", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpAcos, "acos", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpAtan, "atan", 2, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpAtan, "atan", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpPow, "pow", 2, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpExp, "exp", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpLog, "log", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpExp2, "exp2", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpLog2, "log2", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpSqrt, "sqrt", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpAbs, "abs", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpSign, "sign", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpFloor, "floor", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpCeil, "ceil", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpFract, "fract", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpMod, "mod", 2, TypeF, ClassLS, {} },
|
|
|
+ BuiltInFunction{ EOpMin, "min", 2, TypeF, ClassLS, {} },
|
|
|
+ BuiltInFunction{ EOpMax, "max", 2, TypeF, ClassLS, {} },
|
|
|
+ BuiltInFunction{ EOpClamp, "clamp", 3, TypeF, ClassLS2, {} },
|
|
|
+ BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLS, {} },
|
|
|
+ BuiltInFunction{ EOpStep, "step", 2, TypeF, ClassFS, {} },
|
|
|
+ BuiltInFunction{ EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, {} },
|
|
|
+ BuiltInFunction{ EOpNormalize, "normalize", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpReflect, "reflect", 2, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpRefract, "refract", 3, TypeF, ClassXLS, {} },
|
|
|
+ BuiltInFunction{ EOpLength, "length", 1, TypeF, ClassRS, {} },
|
|
|
+ BuiltInFunction{ EOpDistance, "distance", 2, TypeF, ClassRS, {} },
|
|
|
+ BuiltInFunction{ EOpDot, "dot", 2, TypeF, ClassRS, {} },
|
|
|
+ BuiltInFunction{ EOpCross, "cross", 2, TypeF, ClassV3, {} },
|
|
|
+ BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, {} },
|
|
|
+ BuiltInFunction{ EOpAny, "any", 1, TypeB, ClassRSNS, {} },
|
|
|
+ BuiltInFunction{ EOpAll, "all", 1, TypeB, ClassRSNS, {} },
|
|
|
+ BuiltInFunction{ EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, {} },
|
|
|
+ BuiltInFunction{ EOpSinh, "sinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpCosh, "cosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpTanh, "tanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpAsinh, "asinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpAcosh, "acosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpAtanh, "atanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpAbs, "abs", 1, TypeI, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpSign, "sign", 1, TypeI, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpTrunc, "trunc", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpRound, "round", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpModf, "modf", 2, TypeF, ClassLO, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpMin, "min", 2, TypeIU, ClassLS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpMax, "max", 2, TypeIU, ClassLS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpClamp, "clamp", 3, TypeIU, ClassLS2, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLB, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpIsInf, "isinf", 1, TypeF, ClassB, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpIsNan, "isnan", 1, TypeF, ClassB, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, {Es310Desktop400Version} },
|
|
|
+ BuiltInFunction{ EOpMix, "mix", 3, TypeB, ClassRegular, {Es310Desktop450Version} },
|
|
|
+ BuiltInFunction{ EOpMix, "mix", 3, TypeIU, ClassLB, {Es310Desktop450Version} },
|
|
|
};
|
|
|
|
|
|
-const BuiltInFunction DerivativeFunctions[] = {
|
|
|
- { EOpDPdx, "dFdx", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpDPdy, "dFdy", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpFwidth, "fwidth", 1, TypeF, ClassRegular, nullptr },
|
|
|
- { EOpNull }
|
|
|
+const std::array DerivativeFunctions = {
|
|
|
+ BuiltInFunction{ EOpDPdx, "dFdx", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpDPdy, "dFdy", 1, TypeF, ClassRegular, {} },
|
|
|
+ BuiltInFunction{ EOpFwidth, "fwidth", 1, TypeF, ClassRegular, {} },
|
|
|
};
|
|
|
|
|
|
// For functions declared some other way, but still use the table to relate to operator.
|
|
|
struct CustomFunction {
|
|
|
TOperator op; // operator to map the name to
|
|
|
const char* name; // function name
|
|
|
- const Versioning* versioning; // nullptr means always a valid version
|
|
|
+ const span<const Versioning> versioning; // An empty span means always a valid version
|
|
|
};
|
|
|
|
|
|
const CustomFunction CustomFunctions[] = {
|
|
|
- { EOpBarrier, "barrier", nullptr },
|
|
|
- { EOpMemoryBarrierShared, "memoryBarrierShared", nullptr },
|
|
|
- { EOpGroupMemoryBarrier, "groupMemoryBarrier", nullptr },
|
|
|
- { EOpMemoryBarrier, "memoryBarrier", nullptr },
|
|
|
- { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", nullptr },
|
|
|
-
|
|
|
- { EOpPackSnorm2x16, "packSnorm2x16", nullptr },
|
|
|
- { EOpUnpackSnorm2x16, "unpackSnorm2x16", nullptr },
|
|
|
- { EOpPackUnorm2x16, "packUnorm2x16", nullptr },
|
|
|
- { EOpUnpackUnorm2x16, "unpackUnorm2x16", nullptr },
|
|
|
- { EOpPackHalf2x16, "packHalf2x16", nullptr },
|
|
|
- { EOpUnpackHalf2x16, "unpackHalf2x16", nullptr },
|
|
|
-
|
|
|
- { EOpMul, "matrixCompMult", nullptr },
|
|
|
- { EOpOuterProduct, "outerProduct", nullptr },
|
|
|
- { EOpTranspose, "transpose", nullptr },
|
|
|
- { EOpDeterminant, "determinant", nullptr },
|
|
|
- { EOpMatrixInverse, "inverse", nullptr },
|
|
|
- { EOpFloatBitsToInt, "floatBitsToInt", nullptr },
|
|
|
- { EOpFloatBitsToUint, "floatBitsToUint", nullptr },
|
|
|
- { EOpIntBitsToFloat, "intBitsToFloat", nullptr },
|
|
|
- { EOpUintBitsToFloat, "uintBitsToFloat", nullptr },
|
|
|
-
|
|
|
- { EOpTextureQuerySize, "textureSize", nullptr },
|
|
|
- { EOpTextureQueryLod, "textureQueryLod", nullptr },
|
|
|
- { EOpTextureQueryLod, "textureQueryLOD", nullptr }, // extension GL_ARB_texture_query_lod
|
|
|
- { EOpTextureQueryLevels, "textureQueryLevels", nullptr },
|
|
|
- { EOpTextureQuerySamples, "textureSamples", nullptr },
|
|
|
- { EOpTexture, "texture", nullptr },
|
|
|
- { EOpTextureProj, "textureProj", nullptr },
|
|
|
- { EOpTextureLod, "textureLod", nullptr },
|
|
|
- { EOpTextureOffset, "textureOffset", nullptr },
|
|
|
- { EOpTextureFetch, "texelFetch", nullptr },
|
|
|
- { EOpTextureFetchOffset, "texelFetchOffset", nullptr },
|
|
|
- { EOpTextureProjOffset, "textureProjOffset", nullptr },
|
|
|
- { EOpTextureLodOffset, "textureLodOffset", nullptr },
|
|
|
- { EOpTextureProjLod, "textureProjLod", nullptr },
|
|
|
- { EOpTextureProjLodOffset, "textureProjLodOffset", nullptr },
|
|
|
- { EOpTextureGrad, "textureGrad", nullptr },
|
|
|
- { EOpTextureGradOffset, "textureGradOffset", nullptr },
|
|
|
- { EOpTextureProjGrad, "textureProjGrad", nullptr },
|
|
|
- { EOpTextureProjGradOffset, "textureProjGradOffset", nullptr },
|
|
|
-
|
|
|
- { EOpNull }
|
|
|
+ { EOpBarrier, "barrier", {} },
|
|
|
+ { EOpMemoryBarrierShared, "memoryBarrierShared", {} },
|
|
|
+ { EOpGroupMemoryBarrier, "groupMemoryBarrier", {} },
|
|
|
+ { EOpMemoryBarrier, "memoryBarrier", {} },
|
|
|
+ { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", {} },
|
|
|
+
|
|
|
+ { EOpPackSnorm2x16, "packSnorm2x16", {} },
|
|
|
+ { EOpUnpackSnorm2x16, "unpackSnorm2x16", {} },
|
|
|
+ { EOpPackUnorm2x16, "packUnorm2x16", {} },
|
|
|
+ { EOpUnpackUnorm2x16, "unpackUnorm2x16", {} },
|
|
|
+ { EOpPackHalf2x16, "packHalf2x16", {} },
|
|
|
+ { EOpUnpackHalf2x16, "unpackHalf2x16", {} },
|
|
|
+
|
|
|
+ { EOpMul, "matrixCompMult", {} },
|
|
|
+ { EOpOuterProduct, "outerProduct", {} },
|
|
|
+ { EOpTranspose, "transpose", {} },
|
|
|
+ { EOpDeterminant, "determinant", {} },
|
|
|
+ { EOpMatrixInverse, "inverse", {} },
|
|
|
+ { EOpFloatBitsToInt, "floatBitsToInt", {} },
|
|
|
+ { EOpFloatBitsToUint, "floatBitsToUint", {} },
|
|
|
+ { EOpIntBitsToFloat, "intBitsToFloat", {} },
|
|
|
+ { EOpUintBitsToFloat, "uintBitsToFloat", {} },
|
|
|
+
|
|
|
+ { EOpTextureQuerySize, "textureSize", {} },
|
|
|
+ { EOpTextureQueryLod, "textureQueryLod", {} },
|
|
|
+ { EOpTextureQueryLod, "textureQueryLOD", {} }, // extension GL_ARB_texture_query_lod
|
|
|
+ { EOpTextureQueryLevels, "textureQueryLevels", {} },
|
|
|
+ { EOpTextureQuerySamples, "textureSamples", {} },
|
|
|
+ { EOpTexture, "texture", {} },
|
|
|
+ { EOpTextureProj, "textureProj", {} },
|
|
|
+ { EOpTextureLod, "textureLod", {} },
|
|
|
+ { EOpTextureOffset, "textureOffset", {} },
|
|
|
+ { EOpTextureFetch, "texelFetch", {} },
|
|
|
+ { EOpTextureFetchOffset, "texelFetchOffset", {} },
|
|
|
+ { EOpTextureProjOffset, "textureProjOffset", {} },
|
|
|
+ { EOpTextureLodOffset, "textureLodOffset", {} },
|
|
|
+ { EOpTextureProjLod, "textureProjLod", {} },
|
|
|
+ { EOpTextureProjLodOffset, "textureProjLodOffset", {} },
|
|
|
+ { EOpTextureGrad, "textureGrad", {} },
|
|
|
+ { EOpTextureGradOffset, "textureGradOffset", {} },
|
|
|
+ { EOpTextureProjGrad, "textureProjGrad", {} },
|
|
|
+ { EOpTextureProjGradOffset, "textureProjGradOffset", {} },
|
|
|
};
|
|
|
|
|
|
// For the given table of functions, add all the indicated prototypes for each
|
|
@@ -403,13 +397,13 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
|
|
|
bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */)
|
|
|
{
|
|
|
// nullptr means always valid
|
|
|
- if (function.versioning == nullptr)
|
|
|
+ if (function.versioning.empty())
|
|
|
return true;
|
|
|
|
|
|
// check for what is said about our current profile
|
|
|
- for (const Versioning* v = function.versioning; v->profiles != EBadProfile; ++v) {
|
|
|
- if ((v->profiles & profile) != 0) {
|
|
|
- if (v->minCoreVersion <= version || (v->numExtensions > 0 && v->minExtendedVersion <= version))
|
|
|
+ for (const auto& v : function.versioning) {
|
|
|
+ if ((v.profiles & profile) != 0) {
|
|
|
+ if (v.minCoreVersion <= version || (v.numExtensions > 0 && v.minExtendedVersion <= version))
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -422,12 +416,11 @@ bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile
|
|
|
// called once per stage). This is a performance issue only, not a correctness
|
|
|
// concern. It is done for quality arising from simplicity, as there are subtleties
|
|
|
// to get correct if instead trying to do it surgically.
|
|
|
-template<class FunctionT>
|
|
|
-void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable)
|
|
|
+template<class FunctionContainer>
|
|
|
+void RelateTabledBuiltins(const FunctionContainer& functions, TSymbolTable& symbolTable)
|
|
|
{
|
|
|
- while (functions->op != EOpNull) {
|
|
|
- symbolTable.relateToOperator(functions->name, functions->op);
|
|
|
- ++functions;
|
|
|
+ for (const auto& fn : functions) {
|
|
|
+ symbolTable.relateToOperator(fn.name, fn.op);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -436,11 +429,10 @@ void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable)
|
|
|
// Add declarations for all tables of built-in functions.
|
|
|
void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion)
|
|
|
{
|
|
|
- const auto forEachFunction = [&](TString& decls, const BuiltInFunction* function) {
|
|
|
- while (function->op != EOpNull) {
|
|
|
- if (ValidVersion(*function, version, profile, spvVersion))
|
|
|
- AddTabledBuiltin(decls, *function);
|
|
|
- ++function;
|
|
|
+ const auto forEachFunction = [&](TString& decls, const span<const BuiltInFunction>& functions) {
|
|
|
+ for (const auto& fn : functions) {
|
|
|
+ if (ValidVersion(fn, version, profile, spvVersion))
|
|
|
+ AddTabledBuiltin(decls, fn);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1473,6 +1465,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
"\n");
|
|
|
}
|
|
|
|
|
|
+ // NV_shader_atomic_fp16_vector
|
|
|
+ if (profile != EEsProfile && version >= 430) {
|
|
|
+ commonBuiltins.append(
|
|
|
+ "f16vec2 atomicAdd(coherent volatile inout f16vec2, f16vec2);"
|
|
|
+ "f16vec4 atomicAdd(coherent volatile inout f16vec4, f16vec4);"
|
|
|
+ "f16vec2 atomicMin(coherent volatile inout f16vec2, f16vec2);"
|
|
|
+ "f16vec4 atomicMin(coherent volatile inout f16vec4, f16vec4);"
|
|
|
+ "f16vec2 atomicMax(coherent volatile inout f16vec2, f16vec2);"
|
|
|
+ "f16vec4 atomicMax(coherent volatile inout f16vec4, f16vec4);"
|
|
|
+ "f16vec2 atomicExchange(coherent volatile inout f16vec2, f16vec2);"
|
|
|
+ "f16vec4 atomicExchange(coherent volatile inout f16vec4, f16vec4);"
|
|
|
+ "\n");
|
|
|
+ }
|
|
|
+
|
|
|
if ((profile == EEsProfile && version >= 300) ||
|
|
|
(profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding
|
|
|
commonBuiltins.append(
|
|
@@ -2107,6 +2113,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
"%s subgroupShuffleXor(%s, uint);\n",
|
|
|
"%s subgroupShuffleUp(%s, uint delta);\n",
|
|
|
"%s subgroupShuffleDown(%s, uint delta);\n",
|
|
|
+ "%s subgroupRotate(%s, uint);\n",
|
|
|
+ "%s subgroupClusteredRotate(%s, uint, uint);\n",
|
|
|
"%s subgroupAdd(%s);\n",
|
|
|
"%s subgroupMul(%s);\n",
|
|
|
"%s subgroupMin(%s);\n",
|
|
@@ -2235,6 +2243,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ // GL_EXT_shader_quad_control
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
|
+ commonBuiltins.append(
|
|
|
+ "bool subgroupQuadAll(bool);\n"
|
|
|
+ "bool subgroupQuadAny(bool);\n"
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
if (profile != EEsProfile && version >= 460) {
|
|
|
commonBuiltins.append(
|
|
|
"bool anyInvocation(bool);"
|
|
@@ -4115,6 +4132,37 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
"u16vec4 unpack16(uint64_t);"
|
|
|
"i32vec2 unpack32(int64_t);"
|
|
|
"u32vec2 unpack32(uint64_t);"
|
|
|
+
|
|
|
+ // GL_EXT_expect_assume
|
|
|
+ "int8_t expectEXT(int8_t, int8_t);"
|
|
|
+ "i8vec2 expectEXT(i8vec2, i8vec2);"
|
|
|
+ "i8vec3 expectEXT(i8vec3, i8vec3);"
|
|
|
+ "i8vec4 expectEXT(i8vec4, i8vec4);"
|
|
|
+
|
|
|
+ "uint8_t expectEXT(uint8_t, uint8_t);"
|
|
|
+ "u8vec2 expectEXT(u8vec2, u8vec2);"
|
|
|
+ "u8vec3 expectEXT(u8vec3, u8vec3);"
|
|
|
+ "u8vec4 expectEXT(u8vec4, u8vec4);"
|
|
|
+
|
|
|
+ "int16_t expectEXT(int16_t, int16_t);"
|
|
|
+ "i16vec2 expectEXT(i16vec2, i16vec2);"
|
|
|
+ "i16vec3 expectEXT(i16vec3, i16vec3);"
|
|
|
+ "i16vec4 expectEXT(i16vec4, i16vec4);"
|
|
|
+
|
|
|
+ "uint16_t expectEXT(uint16_t, uint16_t);"
|
|
|
+ "u16vec2 expectEXT(u16vec2, u16vec2);"
|
|
|
+ "u16vec3 expectEXT(u16vec3, u16vec3);"
|
|
|
+ "u16vec4 expectEXT(u16vec4, u16vec4);"
|
|
|
+
|
|
|
+ "int64_t expectEXT(int64_t, int64_t);"
|
|
|
+ "i64vec2 expectEXT(i64vec2, i64vec2);"
|
|
|
+ "i64vec3 expectEXT(i64vec3, i64vec3);"
|
|
|
+ "i64vec4 expectEXT(i64vec4, i64vec4);"
|
|
|
+
|
|
|
+ "uint64_t expectEXT(uint64_t, uint64_t);"
|
|
|
+ "u64vec2 expectEXT(u64vec2, u64vec2);"
|
|
|
+ "u64vec3 expectEXT(u64vec3, u64vec3);"
|
|
|
+ "u64vec4 expectEXT(u64vec4, u64vec4);"
|
|
|
"\n");
|
|
|
}
|
|
|
|
|
@@ -4153,6 +4201,29 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // GL_EXT_expect_assume
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
+ ((profile != EEsProfile && version >= 140))) {
|
|
|
+ commonBuiltins.append(
|
|
|
+ "void assumeEXT(bool);"
|
|
|
+
|
|
|
+ "bool expectEXT(bool, bool);"
|
|
|
+ "bvec2 expectEXT(bvec2, bvec2);"
|
|
|
+ "bvec3 expectEXT(bvec3, bvec3);"
|
|
|
+ "bvec4 expectEXT(bvec4, bvec4);"
|
|
|
+
|
|
|
+ "int expectEXT(int, int);"
|
|
|
+ "ivec2 expectEXT(ivec2, ivec2);"
|
|
|
+ "ivec3 expectEXT(ivec3, ivec3);"
|
|
|
+ "ivec4 expectEXT(ivec4, ivec4);"
|
|
|
+
|
|
|
+ "uint expectEXT(uint, uint);"
|
|
|
+ "uvec2 expectEXT(uvec2, uvec2);"
|
|
|
+ "uvec3 expectEXT(uvec3, uvec3);"
|
|
|
+ "uvec4 expectEXT(uvec4, uvec4);"
|
|
|
+ "\n");
|
|
|
+ }
|
|
|
+
|
|
|
// QCOM_image_processing
|
|
|
if ((profile == EEsProfile && version >= 310) ||
|
|
|
(profile != EEsProfile && version >= 140)) {
|
|
@@ -4162,6 +4233,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|
|
"vec4 textureBoxFilterQCOM(sampler2D, vec2, vec2);"
|
|
|
"vec4 textureBlockMatchSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
"vec4 textureBlockMatchSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
+
|
|
|
+ "vec4 textureBlockMatchWindowSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
+ "vec4 textureBlockMatchWindowSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
+ "vec4 textureBlockMatchGatherSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
+ "vec4 textureBlockMatchGatherSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);"
|
|
|
"\n");
|
|
|
}
|
|
|
|
|
@@ -6289,7 +6365,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|
|
{
|
|
|
if ((ms || image) && shadow)
|
|
|
continue;
|
|
|
- if (ms && profile != EEsProfile && version < 150)
|
|
|
+ if (ms && profile != EEsProfile && version < 140)
|
|
|
continue;
|
|
|
if (ms && image && profile == EEsProfile)
|
|
|
continue;
|
|
@@ -6621,6 +6697,34 @@ void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int
|
|
|
commonBuiltins.append(imageParams);
|
|
|
commonBuiltins.append(", float);\n");
|
|
|
}
|
|
|
+
|
|
|
+ // GL_NV_shader_atomic_fp16_vector
|
|
|
+ if (profile != EEsProfile && version >= 430) {
|
|
|
+ const int numFp16Builtins = 4;
|
|
|
+ const char* atomicFp16Func[numFp16Builtins] = {
|
|
|
+ " imageAtomicAdd(volatile coherent ",
|
|
|
+ " imageAtomicMin(volatile coherent ",
|
|
|
+ " imageAtomicMax(volatile coherent ",
|
|
|
+ " imageAtomicExchange(volatile coherent "
|
|
|
+ };
|
|
|
+ const int numFp16DataTypes = 2;
|
|
|
+ const char* atomicFp16DataTypes[numFp16DataTypes] = {
|
|
|
+ "f16vec2",
|
|
|
+ "f16vec4"
|
|
|
+ };
|
|
|
+ // Loop twice to add prototypes with/without scope/semantics
|
|
|
+ for (int j = 0; j < numFp16DataTypes; ++j) {
|
|
|
+ for (int i = 0; i < numFp16Builtins; ++i) {
|
|
|
+ commonBuiltins.append(atomicFp16DataTypes[j]);
|
|
|
+ commonBuiltins.append(atomicFp16Func[i]);
|
|
|
+ commonBuiltins.append(imageParams);
|
|
|
+ commonBuiltins.append(", ");
|
|
|
+ commonBuiltins.append(atomicFp16DataTypes[j]);
|
|
|
+ commonBuiltins.append(");\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (profile != EEsProfile && version >= 450) {
|
|
|
commonBuiltins.append("float imageAtomicAdd(volatile coherent ");
|
|
|
commonBuiltins.append(imageParams);
|
|
@@ -8027,7 +8131,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array);
|
|
|
symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array);
|
|
|
}
|
|
|
- // Fall through
|
|
|
+ [[fallthrough]];
|
|
|
|
|
|
case EShLangTessControl:
|
|
|
if (profile == EEsProfile && version >= 310) {
|
|
@@ -8042,7 +8146,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable);
|
|
|
}
|
|
|
}
|
|
|
- // Fall through
|
|
|
+ [[fallthrough]];
|
|
|
|
|
|
case EShLangTessEvaluation:
|
|
|
case EShLangGeometry:
|
|
@@ -8628,6 +8732,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
|
|
|
}
|
|
|
|
|
|
+ // GL_EXT_expect_assume
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
|
+ symbolTable.setFunctionExtensions("assumeEXT", 1, &E_GL_EXT_expect_assume);
|
|
|
+ symbolTable.setFunctionExtensions("expectEXT", 1, &E_GL_EXT_expect_assume);
|
|
|
+ }
|
|
|
+
|
|
|
// GL_KHR_shader_subgroup
|
|
|
if ((profile == EEsProfile && version >= 310) ||
|
|
|
(profile != EEsProfile && version >= 140)) {
|
|
@@ -8669,6 +8780,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle);
|
|
|
symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative);
|
|
|
symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative);
|
|
|
+ symbolTable.setFunctionExtensions("subgroupRotate", 1, &E_GL_KHR_shader_subgroup_rotate);
|
|
|
+ symbolTable.setFunctionExtensions("subgroupClusteredRotate", 1, &E_GL_KHR_shader_subgroup_rotate);
|
|
|
symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic);
|
|
|
symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic);
|
|
|
symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic);
|
|
@@ -8787,6 +8900,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
|
|
}
|
|
|
|
|
|
+ // GL_EXT_shader_quad_control
|
|
|
+ if ((profile != EEsProfile && version >= 140) ||
|
|
|
+ (profile == EEsProfile && version >= 310)) {
|
|
|
+ symbolTable.setFunctionExtensions("subgroupQuadAll", 1, &E_GL_KHR_shader_subgroup_vote);
|
|
|
+ symbolTable.setFunctionExtensions("subgroupQuadAny", 1, &E_GL_KHR_shader_subgroup_vote);
|
|
|
+ }
|
|
|
+
|
|
|
// GL_EXT_shader_tile_image
|
|
|
symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
|
|
symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
|
@@ -8794,10 +8914,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
|
|
|
if ((profile == EEsProfile && version >= 310) ||
|
|
|
(profile != EEsProfile && version >= 140)) {
|
|
|
+
|
|
|
symbolTable.setFunctionExtensions("textureWeightedQCOM", 1, &E_GL_QCOM_image_processing);
|
|
|
symbolTable.setFunctionExtensions("textureBoxFilterQCOM", 1, &E_GL_QCOM_image_processing);
|
|
|
symbolTable.setFunctionExtensions("textureBlockMatchSADQCOM", 1, &E_GL_QCOM_image_processing);
|
|
|
symbolTable.setFunctionExtensions("textureBlockMatchSSDQCOM", 1, &E_GL_QCOM_image_processing);
|
|
|
+
|
|
|
+ symbolTable.setFunctionExtensions("textureBlockMatchWindowSSDQCOM", 1, &E_GL_QCOM_image_processing2);
|
|
|
+ symbolTable.setFunctionExtensions("textureBlockMatchWindowSADQCOM", 1, &E_GL_QCOM_image_processing2);
|
|
|
+ symbolTable.setFunctionExtensions("textureBlockMatchGatherSSDQCOM", 1, &E_GL_QCOM_image_processing2);
|
|
|
+ symbolTable.setFunctionExtensions("textureBlockMatchGatherSADQCOM", 1, &E_GL_QCOM_image_processing2);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -9720,6 +9846,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.relateToOperator("averageRounded", EOpAverageRounded);
|
|
|
symbolTable.relateToOperator("multiply32x16", EOpMul32x16);
|
|
|
symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf);
|
|
|
+ symbolTable.relateToOperator("assumeEXT", EOpAssumeEXT);
|
|
|
+ symbolTable.relateToOperator("expectEXT", EOpExpectEXT);
|
|
|
|
|
|
|
|
|
if (PureOperatorBuiltins) {
|
|
@@ -9923,6 +10051,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor);
|
|
|
symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp);
|
|
|
symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown);
|
|
|
+ symbolTable.relateToOperator("subgroupRotate", EOpSubgroupRotate);
|
|
|
+ symbolTable.relateToOperator("subgroupClusteredRotate", EOpSubgroupClusteredRotate);
|
|
|
symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd);
|
|
|
symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul);
|
|
|
symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin);
|
|
@@ -9985,12 +10115,24 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj);
|
|
|
}
|
|
|
|
|
|
+ // GL_EXT_shader_quad_control
|
|
|
+ if ((profile == EEsProfile && version >= 310) ||
|
|
|
+ (profile != EEsProfile && version >= 140)) {
|
|
|
+ symbolTable.relateToOperator("subgroupQuadAll", EOpSubgroupQuadAll);
|
|
|
+ symbolTable.relateToOperator("subgroupQuadAny", EOpSubgroupQuadAny);
|
|
|
+ }
|
|
|
+
|
|
|
if ((profile == EEsProfile && version >= 310) ||
|
|
|
(profile != EEsProfile && version >= 140)) {
|
|
|
symbolTable.relateToOperator("textureWeightedQCOM", EOpImageSampleWeightedQCOM);
|
|
|
symbolTable.relateToOperator("textureBoxFilterQCOM", EOpImageBoxFilterQCOM);
|
|
|
symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM);
|
|
|
symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM);
|
|
|
+
|
|
|
+ symbolTable.relateToOperator("textureBlockMatchWindowSSDQCOM", EOpImageBlockMatchWindowSSDQCOM);
|
|
|
+ symbolTable.relateToOperator("textureBlockMatchWindowSADQCOM", EOpImageBlockMatchWindowSADQCOM);
|
|
|
+ symbolTable.relateToOperator("textureBlockMatchGatherSSDQCOM", EOpImageBlockMatchGatherSSDQCOM);
|
|
|
+ symbolTable.relateToOperator("textureBlockMatchGatherSADQCOM", EOpImageBlockMatchGatherSADQCOM);
|
|
|
}
|
|
|
|
|
|
if (profile != EEsProfile && spvVersion.spv == 0) {
|
|
@@ -10105,7 +10247,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|
|
if (profile != EEsProfile && version >= 460) {
|
|
|
symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV);
|
|
|
symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV);
|
|
|
- } // fallthrough
|
|
|
+ }
|
|
|
+ [[fallthrough]];
|
|
|
case EShLangClosestHit:
|
|
|
case EShLangMiss:
|
|
|
if (profile != EEsProfile && version >= 460) {
|