Web: Reclaim more space and make all work w/wo GLSLANG_WEB.
This commit is contained in:
parent
e5eee8fb03
commit
f8d1d7442b
13 changed files with 8983 additions and 2103 deletions
|
|
@ -85,18 +85,18 @@ const int TypeStringScalarMask = ~TypeStringColumnMask; // take type to
|
|||
|
||||
enum ArgType {
|
||||
// numbers hardcoded to correspond to 'TypeString'; order and value matter
|
||||
TypeB = 1 << 0, // Boolean
|
||||
TypeF = 1 << 1, // float 32
|
||||
TypeI = 1 << 2, // int 32
|
||||
TypeU = 1 << 3, // uint 32
|
||||
TypeF16 = 1 << 4, // float 16
|
||||
TypeF64 = 1 << 5, // float 64
|
||||
TypeI8 = 1 << 6, // int 8
|
||||
TypeI16 = 1 << 7, // int 16
|
||||
TypeI64 = 1 << 8, // int 64
|
||||
TypeU8 = 1 << 9, // uint 8
|
||||
TypeU16 = 1 << 10, // uint 16
|
||||
TypeU64 = 1 << 11, // uint 64
|
||||
TypeB = 1 << 0, // Boolean
|
||||
TypeF = 1 << 1, // float 32
|
||||
TypeI = 1 << 2, // int 32
|
||||
TypeU = 1 << 3, // uint 32
|
||||
TypeF16 = 1 << 4, // float 16
|
||||
TypeF64 = 1 << 5, // float 64
|
||||
TypeI8 = 1 << 6, // int 8
|
||||
TypeI16 = 1 << 7, // int 16
|
||||
TypeI64 = 1 << 8, // int 64
|
||||
TypeU8 = 1 << 9, // uint 8
|
||||
TypeU16 = 1 << 10, // uint 16
|
||||
TypeU64 = 1 << 11, // uint 64
|
||||
};
|
||||
// Mixtures of the above, to help the function tables
|
||||
const ArgType TypeFI = static_cast<ArgType>(TypeF | TypeI);
|
||||
|
|
@ -106,22 +106,22 @@ const ArgType TypeIU = static_cast<ArgType>(TypeI | TypeU);
|
|||
// The relationships between arguments and return type, whether anything is
|
||||
// output, or other unusual situations.
|
||||
enum ArgClass {
|
||||
ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic
|
||||
ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle
|
||||
ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassLO = 1 << 5, // the last argument is an output
|
||||
ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args
|
||||
ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args
|
||||
ClassV1 = 1 << 8, // scalar only
|
||||
ClassFIO = 1 << 9, // first argument is inout
|
||||
ClassRS = 1 << 10, // the return is held scalar as the arguments cycle
|
||||
ClassNS = 1 << 11, // no scalar prototype
|
||||
ClassCV = 1 << 12, // first argument is 'coherent volatile'
|
||||
ClassFO = 1 << 13, // first argument is output
|
||||
ClassV3 = 1 << 14, // vec3 only
|
||||
ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic
|
||||
ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle
|
||||
ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
|
||||
ClassLO = 1 << 5, // the last argument is an output
|
||||
ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args
|
||||
ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args
|
||||
ClassV1 = 1 << 8, // scalar only
|
||||
ClassFIO = 1 << 9, // first argument is inout
|
||||
ClassRS = 1 << 10, // the return is held scalar as the arguments cycle
|
||||
ClassNS = 1 << 11, // no scalar prototype
|
||||
ClassCV = 1 << 12, // first argument is 'coherent volatile'
|
||||
ClassFO = 1 << 13, // first argument is output
|
||||
ClassV3 = 1 << 14, // vec3 only
|
||||
};
|
||||
// Mixtures of the above, to help the function tables
|
||||
const ArgClass ClassV1FIOCV = (ArgClass)(ClassV1 | ClassFIO | ClassCV);
|
||||
|
|
@ -147,17 +147,18 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
|
|||
// Declare pointers to put into the table for versioning.
|
||||
#ifdef GLSLANG_WEB
|
||||
const Versioning* Es300Desktop130 = nullptr;
|
||||
|
||||
const Versioning Es310Desktop430Version[] = { { EEsProfile, 0, 310, 0, nullptr },
|
||||
{ EDesktopProfile, 0, 430, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
const Versioning* Es310Desktop430 = &Es310Desktop430Version[0];
|
||||
const Versioning* Es310Desktop430 = nullptr;
|
||||
#else
|
||||
const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
|
||||
{ EDesktopProfile, 0, 130, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
const Versioning* Es300Desktop130 = &Es300Desktop130Version[0];
|
||||
|
||||
const Versioning Es310Desktop430Version[] = { { EEsProfile, 0, 310, 0, nullptr },
|
||||
{ EDesktopProfile, 0, 430, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
const Versioning* Es310Desktop430 = &Es310Desktop430Version[0];
|
||||
|
||||
const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr },
|
||||
{ EDesktopProfile, 0, 450, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
|
|
@ -268,6 +269,7 @@ const BuiltInFunction BaseFunctions[] = {
|
|||
{ EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 },
|
||||
{ EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
|
||||
#endif
|
||||
|
||||
{ EOpNull }
|
||||
};
|
||||
|
||||
|
|
@ -278,6 +280,59 @@ const BuiltInFunction DerivativeFunctions[] = {
|
|||
{ EOpNull }
|
||||
};
|
||||
|
||||
// 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 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 },
|
||||
{ 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 }
|
||||
};
|
||||
|
||||
// For the given table of functions, add all the indicated prototypes for each
|
||||
// one, to be returned in the passed in decls.
|
||||
void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
|
||||
|
|
@ -384,9 +439,10 @@ bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile
|
|||
// Relate a single table of built-ins to their AST operator.
|
||||
// This can get called redundantly (especially for the common built-ins, when
|
||||
// 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 subtlies
|
||||
// concern. It is done for quality arising from simplicity, as there are subtleties
|
||||
// to get correct if instead trying to do it surgically.
|
||||
void RelateTabledBuiltins(const BuiltInFunction* functions, TSymbolTable& symbolTable)
|
||||
template<class FunctionT>
|
||||
void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable)
|
||||
{
|
||||
while (functions->op != EOpNull) {
|
||||
symbolTable.relateToOperator(functions->name, functions->op);
|
||||
|
|
@ -410,10 +466,6 @@ void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersio
|
|||
forEachFunction(commonBuiltins, BaseFunctions);
|
||||
forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions);
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
return;
|
||||
#endif
|
||||
|
||||
if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450))
|
||||
forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions);
|
||||
}
|
||||
|
|
@ -423,6 +475,7 @@ void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */,
|
|||
{
|
||||
RelateTabledBuiltins(BaseFunctions, symbolTable);
|
||||
RelateTabledBuiltins(DerivativeFunctions, symbolTable);
|
||||
RelateTabledBuiltins(CustomFunctions, symbolTable);
|
||||
}
|
||||
|
||||
inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
|
||||
|
|
@ -467,7 +520,7 @@ TBuiltIns::TBuiltIns()
|
|||
dimMap[Esd1D] = 1;
|
||||
dimMap[EsdRect] = 2;
|
||||
dimMap[EsdBuffer] = 1;
|
||||
dimMap[EsdSubpass] = 2; // potientially unused for now
|
||||
dimMap[EsdSubpass] = 2; // potentially unused for now
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -486,6 +539,10 @@ TBuiltIns::~TBuiltIns()
|
|||
//
|
||||
void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
version = 310;
|
||||
profile = EEsProfile;
|
||||
#endif
|
||||
addTabledBuiltins(version, profile, spvVersion);
|
||||
|
||||
//============================================================================
|
||||
|
|
@ -1308,14 +1365,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
commonBuiltins.append(
|
||||
"mediump vec2 unpackHalf2x16(highp uint);"
|
||||
"\n");
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
else if (profile != EEsProfile && version >= 420) {
|
||||
} else if (profile != EEsProfile && version >= 420) {
|
||||
commonBuiltins.append(
|
||||
" vec2 unpackHalf2x16(highp uint);"
|
||||
"\n");
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 400)) {
|
||||
commonBuiltins.append(
|
||||
|
|
@ -3804,37 +3860,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
// Prototypes for all control functions.
|
||||
//
|
||||
//============================================================================
|
||||
#ifdef GLSLANG_WEB
|
||||
bool esBarrier = true;
|
||||
#else
|
||||
bool esBarrier = (profile == EEsProfile && version >= 310);
|
||||
#endif
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier)
|
||||
stageBuiltins[EShLangCompute].append(
|
||||
"void barrier();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 130) || esBarrier)
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrier();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier) {
|
||||
stageBuiltins[EShLangCompute].append(
|
||||
"void memoryBarrierShared();"
|
||||
"void groupMemoryBarrier();"
|
||||
"void memoryBarrierBuffer();"
|
||||
);
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier) {
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrierAtomicCounter();"
|
||||
"void memoryBarrierImage();"
|
||||
);
|
||||
}
|
||||
if ((profile != EEsProfile && version >= 150) || esBarrier)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"void barrier();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier)
|
||||
stageBuiltins[EShLangCompute].append(
|
||||
"void barrier();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
|
||||
stageBuiltins[EShLangMeshNV].append(
|
||||
"void barrier();"
|
||||
|
|
@ -3843,6 +3877,26 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"void barrier();"
|
||||
);
|
||||
}
|
||||
if ((profile != EEsProfile && version >= 130) || esBarrier)
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrier();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier) {
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrierBuffer();"
|
||||
);
|
||||
stageBuiltins[EShLangCompute].append(
|
||||
"void memoryBarrierShared();"
|
||||
"void groupMemoryBarrier();"
|
||||
);
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier) {
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrierAtomicCounter();"
|
||||
"void memoryBarrierImage();"
|
||||
);
|
||||
}
|
||||
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
|
||||
stageBuiltins[EShLangMeshNV].append(
|
||||
"void memoryBarrierShared();"
|
||||
|
|
@ -5329,7 +5383,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not
|
||||
#endif
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((ms || image) && shadow)
|
||||
continue;
|
||||
if (ms && profile != EEsProfile && version < 150)
|
||||
|
|
@ -5338,7 +5391,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
continue;
|
||||
if (ms && profile == EEsProfile && version < 310)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
|
||||
#ifdef GLSLANG_WEB
|
||||
|
|
@ -5443,14 +5495,12 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//
|
||||
// sparseTexelsResidentARB()
|
||||
//
|
||||
if (profile != EEsProfile && version >= 450) {
|
||||
commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -5737,6 +5787,11 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, in
|
|||
//
|
||||
void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
profile = EEsProfile;
|
||||
version = 310;
|
||||
#endif
|
||||
|
||||
//
|
||||
// texturing
|
||||
//
|
||||
|
|
@ -6017,6 +6072,11 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
|
|||
//
|
||||
void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
profile = EEsProfile;
|
||||
version = 310;
|
||||
#endif
|
||||
|
||||
switch (sampler.dim) {
|
||||
case Esd2D:
|
||||
case EsdRect:
|
||||
|
|
@ -6255,6 +6315,11 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
|
|||
//
|
||||
void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
version = 310;
|
||||
profile = EEsProfile;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Initialize the context-dependent (resource-dependent) built-in strings for parsing.
|
||||
//
|
||||
|
|
@ -6799,6 +6864,11 @@ static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVar
|
|||
//
|
||||
void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
version = 310;
|
||||
profile = EEsProfile;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Tag built-in variables and functions with additional qualifier and extension information
|
||||
// that cannot be declared with the text strings.
|
||||
|
|
@ -7572,8 +7642,16 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable);
|
||||
BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable);
|
||||
BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable);
|
||||
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
|
||||
BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile != EEsProfile && version >= 140) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
|
||||
symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
|
||||
}
|
||||
|
||||
if (profile != EEsProfile && version < 430) {
|
||||
symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_ARB_compute_shader);
|
||||
symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_ARB_compute_shader);
|
||||
|
|
@ -7653,17 +7731,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((profile != EEsProfile && version >= 140) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
|
||||
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
|
||||
symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
|
||||
BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// GL_KHR_shader_subgroup
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 140)) {
|
||||
|
|
@ -8056,21 +8124,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
|
||||
|
||||
symbolTable.relateToOperator("matrixCompMult", EOpMul);
|
||||
// 120 and 150 are correct for both ES and desktop
|
||||
if (version >= 120) {
|
||||
symbolTable.relateToOperator("outerProduct", EOpOuterProduct);
|
||||
symbolTable.relateToOperator("transpose", EOpTranspose);
|
||||
if (version >= 150) {
|
||||
symbolTable.relateToOperator("determinant", EOpDeterminant);
|
||||
symbolTable.relateToOperator("inverse", EOpMatrixInverse);
|
||||
}
|
||||
}
|
||||
|
||||
symbolTable.relateToOperator("floatBitsToInt", EOpFloatBitsToInt);
|
||||
symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint);
|
||||
symbolTable.relateToOperator("intBitsToFloat", EOpIntBitsToFloat);
|
||||
symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat);
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64);
|
||||
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
|
||||
|
|
@ -8085,14 +8138,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16);
|
||||
symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16);
|
||||
#endif
|
||||
|
||||
symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16);
|
||||
symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
|
||||
symbolTable.relateToOperator("packUnorm2x16", EOpPackUnorm2x16);
|
||||
symbolTable.relateToOperator("unpackUnorm2x16", EOpUnpackUnorm2x16);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("packSnorm4x8", EOpPackSnorm4x8);
|
||||
symbolTable.relateToOperator("unpackSnorm4x8", EOpUnpackSnorm4x8);
|
||||
symbolTable.relateToOperator("packUnorm4x8", EOpPackUnorm4x8);
|
||||
|
|
@ -8100,21 +8146,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
symbolTable.relateToOperator("packDouble2x32", EOpPackDouble2x32);
|
||||
symbolTable.relateToOperator("unpackDouble2x32", EOpUnpackDouble2x32);
|
||||
#endif
|
||||
|
||||
symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16);
|
||||
symbolTable.relateToOperator("unpackHalf2x16", EOpUnpackHalf2x16);
|
||||
|
||||
symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32);
|
||||
symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32);
|
||||
symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32);
|
||||
symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32);
|
||||
|
||||
symbolTable.relateToOperator("barrier", EOpBarrier);
|
||||
symbolTable.relateToOperator("memoryBarrier", EOpMemoryBarrier);
|
||||
symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16);
|
||||
symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16);
|
||||
symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16);
|
||||
|
|
@ -8179,10 +8216,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("findMSB", EOpFindMSB);
|
||||
|
||||
symbolTable.relateToOperator("helperInvocationEXT", EOpIsHelperInvocation);
|
||||
#endif
|
||||
|
||||
if (PureOperatorBuiltins) {
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("imageSize", EOpImageQuerySize);
|
||||
symbolTable.relateToOperator("imageSamples", EOpImageQuerySamples);
|
||||
symbolTable.relateToOperator("imageLoad", EOpImageLoad);
|
||||
|
|
@ -8200,28 +8235,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad);
|
||||
symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS);
|
||||
#endif
|
||||
|
||||
symbolTable.relateToOperator("textureSize", EOpTextureQuerySize);
|
||||
symbolTable.relateToOperator("textureQueryLod", EOpTextureQueryLod);
|
||||
symbolTable.relateToOperator("textureQueryLevels", EOpTextureQueryLevels);
|
||||
symbolTable.relateToOperator("textureSamples", EOpTextureQuerySamples);
|
||||
symbolTable.relateToOperator("texture", EOpTexture);
|
||||
symbolTable.relateToOperator("textureProj", EOpTextureProj);
|
||||
symbolTable.relateToOperator("textureLod", EOpTextureLod);
|
||||
symbolTable.relateToOperator("textureOffset", EOpTextureOffset);
|
||||
symbolTable.relateToOperator("texelFetch", EOpTextureFetch);
|
||||
symbolTable.relateToOperator("texelFetchOffset", EOpTextureFetchOffset);
|
||||
symbolTable.relateToOperator("textureProjOffset", EOpTextureProjOffset);
|
||||
symbolTable.relateToOperator("textureLodOffset", EOpTextureLodOffset);
|
||||
symbolTable.relateToOperator("textureProjLod", EOpTextureProjLod);
|
||||
symbolTable.relateToOperator("textureProjLodOffset", EOpTextureProjLodOffset);
|
||||
symbolTable.relateToOperator("textureGrad", EOpTextureGrad);
|
||||
symbolTable.relateToOperator("textureGradOffset", EOpTextureGradOffset);
|
||||
symbolTable.relateToOperator("textureProjGrad", EOpTextureProjGrad);
|
||||
symbolTable.relateToOperator("textureProjGradOffset", EOpTextureProjGradOffset);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("textureGather", EOpTextureGather);
|
||||
symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset);
|
||||
symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets);
|
||||
|
|
@ -8463,11 +8477,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("shadow2DEXT", EOpTexture);
|
||||
symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
switch(language) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EShLangVertex:
|
||||
break;
|
||||
|
||||
|
|
@ -8502,12 +8514,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock);
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EShLangCompute:
|
||||
symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
|
||||
symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier);
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
|
||||
if ((profile != EEsProfile && version >= 450) ||
|
||||
(profile == EEsProfile && version >= 320)) {
|
||||
|
|
@ -8524,10 +8532,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoad);
|
||||
symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStore);
|
||||
symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAdd);
|
||||
#endif
|
||||
break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EShLangRayGenNV:
|
||||
case EShLangClosestHitNV:
|
||||
case EShLangMissNV:
|
||||
|
|
@ -8566,8 +8572,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
default:
|
||||
assert(false && "Language not supported");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue