Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL
This CL removes the GLSLANG_WEB and GLSLANG_WEB_DEVEL cmake build options and their usage in the codebase. Issue #2958
This commit is contained in:
parent
c8c669fc2a
commit
d291b15911
48 changed files with 49 additions and 1540 deletions
|
|
@ -177,7 +177,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||
break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
if (rightUnionArray[i] == (signed char)0)
|
||||
newConstArray[i].setI8Const((signed char)0x7F);
|
||||
|
|
@ -227,7 +226,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||
break;
|
||||
default:
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -266,7 +264,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||
newConstArray[i].setIConst(0);
|
||||
break;
|
||||
} else goto modulo_default;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt64:
|
||||
if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) {
|
||||
newConstArray[i].setI64Const(0);
|
||||
|
|
@ -277,7 +274,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||
newConstArray[i].setIConst(0);
|
||||
break;
|
||||
} else goto modulo_default;
|
||||
#endif
|
||||
default:
|
||||
modulo_default:
|
||||
newConstArray[i] = leftUnionArray[i] % rightUnionArray[i];
|
||||
|
|
@ -507,14 +503,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||
: -unionArray[i].getIConst());
|
||||
break;
|
||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
|
||||
case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const()))); break;
|
||||
case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
|
||||
case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const()))); break;
|
||||
case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
|
||||
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -684,7 +678,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||
case EOpConvDoubleToInt:
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConvInt8ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break;
|
||||
case EOpConvUint8ToBool:
|
||||
|
|
@ -919,7 +912,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||
case EOpConvUint64ToPtr:
|
||||
case EOpConstructReference:
|
||||
newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
|
||||
#endif
|
||||
|
||||
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
||||
|
||||
|
|
@ -1066,7 +1058,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||
break;
|
||||
|
|
@ -1085,7 +1076,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
case EbtUint64:
|
||||
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
|
|
@ -1102,7 +1092,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||
break;
|
||||
|
|
@ -1121,7 +1110,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
case EbtUint64:
|
||||
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
|
|
@ -1137,7 +1125,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
||||
childConstUnions[2][arg2comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
|
||||
childConstUnions[2][arg2comp].getI8Const()));
|
||||
|
|
@ -1166,7 +1153,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
|
||||
childConstUnions[2][arg2comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -144,10 +144,6 @@ struct Versioning {
|
|||
EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECompatibilityProfile);
|
||||
|
||||
// Declare pointers to put into the table for versioning.
|
||||
#ifdef GLSLANG_WEB
|
||||
const Versioning* Es300Desktop130 = nullptr;
|
||||
const Versioning* Es310Desktop420 = nullptr;
|
||||
#else
|
||||
const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
|
||||
{ EDesktopProfile, 0, 130, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
|
|
@ -162,7 +158,6 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
|
|||
{ EDesktopProfile, 0, 450, 0, nullptr },
|
||||
{ EBadProfile } };
|
||||
const Versioning* Es310Desktop450 = &Es310Desktop450Version[0];
|
||||
#endif
|
||||
|
||||
// The main descriptor of what a set of function prototypes can look like, and
|
||||
// a pointer to extra versioning information, when needed.
|
||||
|
|
@ -264,10 +259,8 @@ const BuiltInFunction BaseFunctions[] = {
|
|||
{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 },
|
||||
{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 },
|
||||
{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop420 },
|
||||
#ifndef GLSLANG_WEB
|
||||
{ EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 },
|
||||
{ EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
|
||||
#endif
|
||||
|
||||
{ EOpNull }
|
||||
};
|
||||
|
|
@ -386,10 +379,8 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
|
|||
if (arg == function.numArguments - 1 && (function.classes & ClassLO))
|
||||
decls.append("out ");
|
||||
if (arg == 0) {
|
||||
#ifndef GLSLANG_WEB
|
||||
if (function.classes & ClassCV)
|
||||
decls.append("coherent volatile ");
|
||||
#endif
|
||||
if (function.classes & ClassFIO)
|
||||
decls.append("inout ");
|
||||
if (function.classes & ClassFO)
|
||||
|
|
@ -416,11 +407,6 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
|
|||
// See if the tabled versioning information allows the current version.
|
||||
bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */)
|
||||
{
|
||||
#if defined(GLSLANG_WEB)
|
||||
// all entries in table are valid
|
||||
return true;
|
||||
#endif
|
||||
|
||||
// nullptr means always valid
|
||||
if (function.versioning == nullptr)
|
||||
return true;
|
||||
|
|
@ -501,7 +487,6 @@ TBuiltIns::TBuiltIns()
|
|||
prefixes[EbtFloat] = "";
|
||||
prefixes[EbtInt] = "i";
|
||||
prefixes[EbtUint] = "u";
|
||||
#if !defined(GLSLANG_WEB)
|
||||
prefixes[EbtFloat16] = "f16";
|
||||
prefixes[EbtInt8] = "i8";
|
||||
prefixes[EbtUint8] = "u8";
|
||||
|
|
@ -509,7 +494,6 @@ TBuiltIns::TBuiltIns()
|
|||
prefixes[EbtUint16] = "u16";
|
||||
prefixes[EbtInt64] = "i64";
|
||||
prefixes[EbtUint64] = "u64";
|
||||
#endif
|
||||
|
||||
postfixes[2] = "2";
|
||||
postfixes[3] = "3";
|
||||
|
|
@ -519,13 +503,11 @@ TBuiltIns::TBuiltIns()
|
|||
dimMap[Esd2D] = 2;
|
||||
dimMap[Esd3D] = 3;
|
||||
dimMap[EsdCube] = 3;
|
||||
#ifndef GLSLANG_WEB
|
||||
dimMap[Esd1D] = 1;
|
||||
dimMap[EsdRect] = 2;
|
||||
dimMap[EsdBuffer] = 1;
|
||||
dimMap[EsdSubpass] = 2; // potentially unused for now
|
||||
dimMap[EsdAttachmentEXT] = 2; // potentially unused for now
|
||||
#endif
|
||||
}
|
||||
|
||||
TBuiltIns::~TBuiltIns()
|
||||
|
|
@ -543,10 +525,6 @@ TBuiltIns::~TBuiltIns()
|
|||
//
|
||||
void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
version = 310;
|
||||
profile = EEsProfile;
|
||||
#endif
|
||||
addTabledBuiltins(version, profile, spvVersion);
|
||||
|
||||
//============================================================================
|
||||
|
|
@ -555,7 +533,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//
|
||||
// Derivatives Functions.
|
||||
//
|
||||
|
|
@ -1500,7 +1477,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"void atomicStore(coherent volatile out double, double, int, int, int);"
|
||||
"\n");
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
if ((profile == EEsProfile && version >= 300) ||
|
||||
(profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding
|
||||
|
|
@ -1528,7 +1504,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile != EEsProfile && version >= 400) ||
|
||||
(profile == EEsProfile && version >= 310)) { // GL_OES_gpu_shader5
|
||||
|
||||
|
|
@ -1606,7 +1581,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
|
||||
"\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((profile == EEsProfile && version >= 300) ||
|
||||
(profile != EEsProfile && version >= 150)) {
|
||||
|
|
@ -1635,7 +1609,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 150)) {
|
||||
commonBuiltins.append(
|
||||
|
|
@ -1655,7 +1628,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"vec4 unpackUnorm4x8(highp uint);"
|
||||
"\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Matrix Functions.
|
||||
|
|
@ -1714,7 +1686,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//
|
||||
// Original-style texture functions existing in all stages.
|
||||
// (Per-stage functions below.)
|
||||
|
|
@ -4257,7 +4228,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"void EndPrimitive();"
|
||||
"\n");
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
|
|
@ -4294,7 +4264,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"void groupMemoryBarrier();"
|
||||
);
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier) {
|
||||
if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) {
|
||||
commonBuiltins.append("void memoryBarrierAtomicCounter();");
|
||||
|
|
@ -4842,7 +4811,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"void SetMeshOutputsEXT(uint, uint);"
|
||||
"\n");
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
|
|
@ -4864,13 +4832,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"highp float diff;" // f - n
|
||||
);
|
||||
} else {
|
||||
#ifndef GLSLANG_WEB
|
||||
commonBuiltins.append(
|
||||
"float near;" // n
|
||||
"float far;" // f
|
||||
"float diff;" // f - n
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
commonBuiltins.append(
|
||||
|
|
@ -4879,7 +4845,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) {
|
||||
//
|
||||
// Matrix state. p. 31, 32, 37, 39, 40.
|
||||
|
|
@ -4997,7 +4962,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
|
||||
"\n");
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
|
|
@ -5027,7 +4991,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"\n");
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//============================================================================
|
||||
//
|
||||
// Define the interface to the mesh/task shader.
|
||||
|
|
@ -5310,19 +5273,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"in highp int gl_InstanceID;" // needs qualifier fixed later
|
||||
);
|
||||
if (spvVersion.vulkan > 0)
|
||||
#endif
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"in highp int gl_VertexIndex;"
|
||||
"in highp int gl_InstanceIndex;"
|
||||
);
|
||||
#ifndef GLSLANG_WEB
|
||||
if (version < 310)
|
||||
#endif
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"highp vec4 gl_Position;" // needs qualifier fixed later
|
||||
"highp float gl_PointSize;" // needs qualifier fixed later
|
||||
);
|
||||
#ifndef GLSLANG_WEB
|
||||
else
|
||||
stageBuiltins[EShLangVertex].append(
|
||||
"out gl_PerVertex {"
|
||||
|
|
@ -5800,7 +5759,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"mediump vec2 gl_PointCoord;" // needs qualifier fixed later
|
||||
);
|
||||
}
|
||||
#endif
|
||||
if (version >= 300) {
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"highp vec4 gl_FragCoord;" // needs qualifier fixed later
|
||||
|
|
@ -5809,7 +5767,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"highp float gl_FragDepth;" // needs qualifier fixed later
|
||||
);
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if (version >= 310) {
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"bool gl_HelperInvocation;" // needs qualifier fixed later
|
||||
|
|
@ -5854,15 +5811,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
"flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
stageBuiltins[EShLangFragment].append("\n");
|
||||
|
||||
if (version >= 130)
|
||||
add2ndGenerationSamplingImaging(version, profile, spvVersion);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
if ((profile != EEsProfile && version >= 140) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
|
|
@ -6254,7 +6208,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
// printf("%s\n", commonBuiltins.c_str());
|
||||
// printf("%s\n", stageBuiltins[EShLangFragment].c_str());
|
||||
|
|
@ -6273,26 +6226,14 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
|
||||
// enumerate all the types
|
||||
const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint,
|
||||
#if !defined(GLSLANG_WEB)
|
||||
EbtFloat16
|
||||
#endif
|
||||
EbtFloat16
|
||||
};
|
||||
#ifdef GLSLANG_WEB
|
||||
bool skipBuffer = true;
|
||||
bool skipCubeArrayed = true;
|
||||
const int image = 0;
|
||||
#else
|
||||
bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140);
|
||||
bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130);
|
||||
for (int image = 0; image <= 1; ++image) // loop over "bool" image vs sampler
|
||||
#endif
|
||||
{
|
||||
for (int shadow = 0; shadow <= 1; ++shadow) { // loop over "bool" shadow or not
|
||||
#ifdef GLSLANG_WEB
|
||||
const int ms = 0;
|
||||
#else
|
||||
for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not
|
||||
#endif
|
||||
{
|
||||
if ((ms || image) && shadow)
|
||||
continue;
|
||||
|
|
@ -6304,9 +6245,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
continue;
|
||||
|
||||
for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
|
||||
#ifdef GLSLANG_WEB
|
||||
for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube
|
||||
#else
|
||||
for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass
|
||||
if (dim == EsdAttachmentEXT)
|
||||
continue;
|
||||
|
|
@ -6330,7 +6268,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
continue;
|
||||
if (ms && arrayed && profile == EEsProfile && version < 310)
|
||||
continue;
|
||||
#endif
|
||||
if (dim == Esd3D && shadow)
|
||||
continue;
|
||||
if (dim == EsdCube && arrayed && skipCubeArrayed)
|
||||
|
|
@ -6340,25 +6277,21 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
|
||||
// Loop over the bTypes
|
||||
for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) {
|
||||
#ifndef GLSLANG_WEB
|
||||
if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile || version < 450))
|
||||
continue;
|
||||
if (dim == EsdRect && version < 140 && bType > 0)
|
||||
continue;
|
||||
#endif
|
||||
if (shadow && (bTypes[bType] == EbtInt || bTypes[bType] == EbtUint))
|
||||
continue;
|
||||
//
|
||||
// Now, make all the function prototypes for the type we just built...
|
||||
//
|
||||
TSampler sampler;
|
||||
#ifndef GLSLANG_WEB
|
||||
if (dim == EsdSubpass) {
|
||||
sampler.setSubpass(bTypes[bType], ms ? true : false);
|
||||
} else if (dim == EsdAttachmentEXT) {
|
||||
sampler.setAttachmentEXT(bTypes[bType]);
|
||||
} else
|
||||
#endif
|
||||
if (image) {
|
||||
sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false,
|
||||
shadow ? true : false,
|
||||
|
|
@ -6371,12 +6304,10 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
|
||||
TString typeName = sampler.getString();
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (dim == EsdSubpass) {
|
||||
addSubpassSampling(sampler, typeName, version, profile);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
addQueryFunctions(sampler, typeName, version, profile);
|
||||
|
||||
|
|
@ -6384,7 +6315,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
addImageFunctions(sampler, typeName, version, profile);
|
||||
else {
|
||||
addSamplingFunctions(sampler, typeName, version, profile);
|
||||
#ifndef GLSLANG_WEB
|
||||
addGatherFunctions(sampler, typeName, version, profile);
|
||||
if (spvVersion.vulkan > 0 && sampler.isCombined() && !sampler.shadow) {
|
||||
// Base Vulkan allows texelFetch() for
|
||||
|
|
@ -6400,7 +6330,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||
addSamplingFunctions(sampler, textureTypeName, version, profile);
|
||||
addQueryFunctions(sampler, textureTypeName, version, profile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6431,16 +6360,6 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int
|
|||
|
||||
int sizeDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0) - (sampler.dim == EsdCube ? 1 : 0);
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
commonBuiltins.append("highp ");
|
||||
commonBuiltins.append("ivec");
|
||||
commonBuiltins.append(postfixes[sizeDims]);
|
||||
commonBuiltins.append(" textureSize(");
|
||||
commonBuiltins.append(typeName);
|
||||
commonBuiltins.append(",int);\n");
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 420)))
|
||||
return;
|
||||
|
||||
|
|
@ -6760,11 +6679,6 @@ 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
|
||||
//
|
||||
|
|
@ -6839,11 +6753,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
|
|||
continue;
|
||||
|
||||
// loop over 16-bit floating-point texel addressing
|
||||
#if defined(GLSLANG_WEB)
|
||||
const int f16TexAddr = 0;
|
||||
#else
|
||||
for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr)
|
||||
#endif
|
||||
{
|
||||
if (f16TexAddr && sampler.type != EbtFloat16)
|
||||
continue;
|
||||
|
|
@ -6852,11 +6762,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
|
|||
totalDims--;
|
||||
}
|
||||
// loop over "bool" lod clamp
|
||||
#if defined(GLSLANG_WEB)
|
||||
const int lodClamp = 0;
|
||||
#else
|
||||
for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp)
|
||||
#endif
|
||||
{
|
||||
if (lodClamp && (profile == EEsProfile || version < 450))
|
||||
continue;
|
||||
|
|
@ -6864,11 +6770,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
|
|||
continue;
|
||||
|
||||
// loop over "bool" sparse or not
|
||||
#if defined(GLSLANG_WEB)
|
||||
const int sparse = 0;
|
||||
#else
|
||||
for (int sparse = 0; sparse <= 1; ++sparse)
|
||||
#endif
|
||||
{
|
||||
if (sparse && (profile == EEsProfile || version < 450))
|
||||
continue;
|
||||
|
|
@ -7045,11 +6947,6 @@ 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:
|
||||
|
|
@ -7288,11 +7185,6 @@ 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.
|
||||
//
|
||||
|
|
@ -7350,7 +7242,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
s.append(builtInConstant);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (version >= 310) {
|
||||
// geometry
|
||||
|
||||
|
|
@ -7673,7 +7564,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents);
|
||||
s.append(builtInConstant);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// compute
|
||||
|
|
@ -7695,7 +7585,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
s.append("\n");
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// images (some in compute below)
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 130)) {
|
||||
|
|
@ -7797,7 +7686,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
|
||||
s.append("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
s.append("\n");
|
||||
}
|
||||
|
|
@ -7900,11 +7788,6 @@ 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.
|
||||
|
|
@ -7924,7 +7807,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.vulkan == 0) {
|
||||
SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable);
|
||||
SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable);
|
||||
|
|
@ -8098,7 +7980,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
case EShLangTessEvaluation:
|
||||
case EShLangGeometry:
|
||||
#endif // !GLSLANG_WEB
|
||||
SpecialQualifier("gl_Position", EvqPosition, EbvPosition, symbolTable);
|
||||
SpecialQualifier("gl_PointSize", EvqPointSize, EbvPointSize, symbolTable);
|
||||
|
||||
|
|
@ -8108,7 +7989,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
BuiltInVariable("gl_out", "gl_Position", EbvPosition, symbolTable);
|
||||
BuiltInVariable("gl_out", "gl_PointSize", EbvPointSize, symbolTable);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable);
|
||||
|
||||
BuiltInVariable("gl_in", "gl_ClipDistance", EbvClipDistance, symbolTable);
|
||||
|
|
@ -8288,8 +8168,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
case EShLangFragment:
|
||||
|
|
@ -8306,7 +8184,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
}
|
||||
}
|
||||
SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable);
|
||||
#ifndef GLSLANG_WEB
|
||||
SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable);
|
||||
SpecialQualifier("gl_FragStencilRefARB", EvqFragStencil, EbvFragStencilRef, symbolTable);
|
||||
SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable);
|
||||
|
|
@ -8848,7 +8725,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
case EShLangCompute:
|
||||
|
|
@ -8861,7 +8737,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
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);
|
||||
|
|
@ -9010,10 +8885,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
case EShLangRayGen:
|
||||
case EShLangIntersect:
|
||||
case EShLangAnyHit:
|
||||
|
|
@ -9582,7 +9455,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
assert(false && "Language not supported");
|
||||
|
|
@ -9598,7 +9470,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
|
||||
relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64);
|
||||
symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
|
||||
symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble);
|
||||
|
|
@ -10195,7 +10066,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
default:
|
||||
assert(false && "Language not supported");
|
||||
}
|
||||
#endif // !GLSLANG_WEB
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -10209,7 +10079,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
//
|
||||
void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (profile != EEsProfile && version >= 430 && version < 440) {
|
||||
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts);
|
||||
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &E_GL_ARB_enhanced_layouts);
|
||||
|
|
@ -10281,7 +10150,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -388,7 +388,6 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
|
|||
case EOpConstructFloat: newType = EbtFloat; break;
|
||||
case EOpConstructInt: newType = EbtInt; break;
|
||||
case EOpConstructUint: newType = EbtUint; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConstructInt8: newType = EbtInt8; break;
|
||||
case EOpConstructUint8: newType = EbtUint8; break;
|
||||
case EOpConstructInt16: newType = EbtInt16; break;
|
||||
|
|
@ -397,7 +396,6 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
|
|||
case EOpConstructUint64: newType = EbtUint64; break;
|
||||
case EOpConstructDouble: newType = EbtDouble; break;
|
||||
case EOpConstructFloat16: newType = EbtFloat16; break;
|
||||
#endif
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
|
|
@ -569,7 +567,6 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
|
|||
bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const
|
||||
{
|
||||
switch (dst) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble:
|
||||
switch (src) {
|
||||
case EbtUint: newOp = EOpConvUintToDouble; break;
|
||||
|
|
@ -587,13 +584,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtFloat:
|
||||
switch (src) {
|
||||
case EbtInt: newOp = EOpConvIntToFloat; break;
|
||||
case EbtUint: newOp = EOpConvUintToFloat; break;
|
||||
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
||||
case EbtInt8: newOp = EOpConvInt8ToFloat; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToFloat; break;
|
||||
|
|
@ -602,12 +597,10 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
case EbtFloat16: newOp = EOpConvFloat16ToFloat; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16:
|
||||
switch (src) {
|
||||
case EbtInt8: newOp = EOpConvInt8ToFloat16; break;
|
||||
|
|
@ -625,13 +618,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtBool:
|
||||
switch (src) {
|
||||
case EbtInt: newOp = EOpConvIntToBool; break;
|
||||
case EbtUint: newOp = EOpConvUintToBool; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
||||
case EbtInt8: newOp = EOpConvInt8ToBool; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToBool; break;
|
||||
|
|
@ -640,12 +631,10 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
case EbtFloat16: newOp = EOpConvFloat16ToBool; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
switch (src) {
|
||||
case EbtUint8: newOp = EOpConvUint8ToInt8; break;
|
||||
|
|
@ -715,14 +704,12 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EbtInt:
|
||||
switch (src) {
|
||||
case EbtUint: newOp = EOpConvUintToInt; break;
|
||||
case EbtBool: newOp = EOpConvBoolToInt; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newOp = EOpConvInt8ToInt; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToInt; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToInt; break;
|
||||
|
|
@ -731,7 +718,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
case EbtFloat16: newOp = EOpConvFloat16ToInt; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -741,7 +727,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
case EbtInt: newOp = EOpConvIntToUint; break;
|
||||
case EbtBool: newOp = EOpConvBoolToUint; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToUint; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newOp = EOpConvInt8ToUint; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToUint; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToUint; break;
|
||||
|
|
@ -750,7 +735,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
case EbtFloat16: newOp = EOpConvFloat16ToUint; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||
#endif
|
||||
// For bindless texture type conversion, add a dummy convert op, just
|
||||
// to generate a new TIntermTyped
|
||||
// uvec2(any sampler type)
|
||||
|
|
@ -760,7 +744,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt64:
|
||||
switch (src) {
|
||||
case EbtInt8: newOp = EOpConvInt8ToInt64; break;
|
||||
|
|
@ -795,7 +778,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -811,7 +793,6 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
// Add a new newNode for the conversion.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 ||
|
||||
convertTo == EbtInt16 || convertTo == EbtUint16 ||
|
||||
convertTo == EbtInt || convertTo == EbtUint ||
|
||||
|
|
@ -848,7 +829,6 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
return nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TIntermUnary* newNode = nullptr;
|
||||
TOperator newOp = EOpNull;
|
||||
|
|
@ -860,13 +840,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
|||
newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
|
||||
|
||||
if (node->getAsConstantUnion()) {
|
||||
#ifndef GLSLANG_WEB
|
||||
// 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
|
||||
// to those types
|
||||
if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
|
||||
(getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
|
||||
(getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
|
||||
#endif
|
||||
{
|
||||
TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
|
||||
if (folded)
|
||||
|
|
@ -1066,7 +1044,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||
case EOpConstructFloat:
|
||||
case EOpConstructInt:
|
||||
case EOpConstructUint:
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConstructDouble:
|
||||
case EOpConstructFloat16:
|
||||
case EOpConstructInt8:
|
||||
|
|
@ -1077,8 +1054,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||
case EOpConstructUint64:
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Implicit conversions
|
||||
//
|
||||
|
|
@ -1166,7 +1141,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||
}
|
||||
|
||||
bool canPromoteConstant = true;
|
||||
#ifndef GLSLANG_WEB
|
||||
// GL_EXT_shader_16bit_storage can't do OpConstantComposite with
|
||||
// 16-bit types, so disable promotion for those types.
|
||||
// Many issues with this, from JohnK:
|
||||
|
|
@ -1194,7 +1168,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
|||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (canPromoteConstant && node->getAsConstantUnion())
|
||||
return promoteConstantUnion(type.getBasicType(), node->getAsConstantUnion());
|
||||
|
|
@ -1491,10 +1464,6 @@ bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const
|
|||
|
||||
bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
switch (from) {
|
||||
case EbtInt:
|
||||
switch(to) {
|
||||
|
|
@ -1575,10 +1544,6 @@ bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
|||
|
||||
bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (to == EbtFloat && from == EbtFloat16) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
@ -1599,7 +1564,6 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
|
|||
break;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
case EbtInt16:
|
||||
|
|
@ -1619,7 +1583,6 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
|
|||
return true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -1821,10 +1784,6 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
|||
|
||||
static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
switch(sintType) {
|
||||
case EbtInt8:
|
||||
switch(uintType) {
|
||||
|
|
@ -1885,11 +1844,6 @@ static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBas
|
|||
|
||||
static TBasicType getCorrespondingUnsignedType(TBasicType type)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(type == EbtInt);
|
||||
return EbtUint;
|
||||
#endif
|
||||
|
||||
switch(type) {
|
||||
case EbtInt8:
|
||||
return EbtUint8;
|
||||
|
|
@ -2182,7 +2136,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
|
|
@ -2321,7 +2274,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
|||
case EbtAccStruct:
|
||||
op = EOpConstructAccStruct;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -2802,7 +2754,6 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
|
|||
if (aggRoot && aggRoot->getOp() == EOpNull)
|
||||
aggRoot->setOperator(EOpSequence);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Propagate 'noContraction' label in backward from 'precise' variables.
|
||||
glslang::PropagateNoContraction(*this);
|
||||
|
||||
|
|
@ -2816,7 +2767,6 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
|
|||
assert(0);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3910,16 +3860,6 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||
#define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast<CType>(rightUnionArray[i].Get()))
|
||||
#define PROMOTE_TO_BOOL(Get) leftUnionArray[i].setBConst(rightUnionArray[i].Get() != 0)
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
#define TO_ALL(Get) \
|
||||
switch (promoteTo) { \
|
||||
case EbtFloat: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtInt: PROMOTE(setIConst, int, Get); break; \
|
||||
case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \
|
||||
case EbtBool: PROMOTE_TO_BOOL(Get); break; \
|
||||
default: return node; \
|
||||
}
|
||||
#else
|
||||
#define TO_ALL(Get) \
|
||||
switch (promoteTo) { \
|
||||
case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
|
||||
|
|
@ -3936,14 +3876,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||
case EbtBool: PROMOTE_TO_BOOL(Get); break; \
|
||||
default: return node; \
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (node->getType().getBasicType()) {
|
||||
case EbtFloat: TO_ALL(getDConst); break;
|
||||
case EbtInt: TO_ALL(getIConst); break;
|
||||
case EbtUint: TO_ALL(getUConst); break;
|
||||
case EbtBool: TO_ALL(getBConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16: TO_ALL(getDConst); break;
|
||||
case EbtDouble: TO_ALL(getDConst); break;
|
||||
case EbtInt8: TO_ALL(getI8Const); break;
|
||||
|
|
@ -3952,7 +3890,6 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
|||
case EbtUint8: TO_ALL(getU8Const); break;
|
||||
case EbtUint16: TO_ALL(getU16Const); break;
|
||||
case EbtUint64: TO_ALL(getU64Const); break;
|
||||
#endif
|
||||
default: return node;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,8 +67,6 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||
|
||||
void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...)
|
||||
{
|
||||
|
|
@ -118,8 +116,6 @@ void C_DECL TParseContextBase::ppWarn(const TSourceLoc& loc, const char* szReaso
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Both test and if necessary, spit out an error, to see if the node is really
|
||||
// an l-value that can be operated on this way.
|
||||
|
|
@ -140,7 +136,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||
case EvqConst: message = "can't modify a const"; break;
|
||||
case EvqConstReadOnly: message = "can't modify a const"; break;
|
||||
case EvqUniform: message = "can't modify a uniform"; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EvqBuffer:
|
||||
if (node->getQualifier().isReadOnly())
|
||||
message = "can't modify a readonly buffer";
|
||||
|
|
@ -151,7 +146,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||
if (language != EShLangIntersect)
|
||||
message = "cannot modify hitAttributeNV in this stage";
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
//
|
||||
|
|
@ -165,7 +159,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||
case EbtVoid:
|
||||
message = "can't modify void";
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtAtomicUint:
|
||||
message = "can't modify an atomic_uint";
|
||||
break;
|
||||
|
|
@ -178,7 +171,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||
case EbtHitObjectNV:
|
||||
message = "can't modify hitObjectNV";
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -104,7 +104,6 @@ public:
|
|||
}
|
||||
virtual ~TParseContextBase() { }
|
||||
|
||||
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...);
|
||||
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
|
|
@ -113,7 +112,6 @@ public:
|
|||
const char* szExtraInfoFormat, ...);
|
||||
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...);
|
||||
#endif
|
||||
|
||||
virtual void setLimits(const TBuiltInResource&) = 0;
|
||||
|
||||
|
|
@ -331,10 +329,8 @@ public:
|
|||
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
void makeEditable(TSymbol*&) override;
|
||||
void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
#endif
|
||||
bool isIoResizeArray(const TType&) const;
|
||||
void fixIoArraySize(const TSourceLoc&, TType&);
|
||||
void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base);
|
||||
|
|
@ -467,7 +463,6 @@ public:
|
|||
const TTypeList* recordStructCopy(TStructRecord&, const TType*, const TType*);
|
||||
TLayoutFormat mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
TAttributeType attributeFromName(const TString& name) const;
|
||||
TAttributes* makeAttributes(const TString& identifier) const;
|
||||
TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
|
||||
|
|
@ -494,8 +489,6 @@ public:
|
|||
TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, int value);
|
||||
TSpirvInstruction* mergeSpirvInstruction(const TSourceLoc& loc, TSpirvInstruction* spirvInst1,
|
||||
TSpirvInstruction* spirvInst2);
|
||||
#endif
|
||||
|
||||
void checkAndResizeMeshViewDim(const TSourceLoc&, TType&, bool isBlockMember);
|
||||
|
||||
protected:
|
||||
|
|
@ -508,9 +501,7 @@ protected:
|
|||
bool isRuntimeLength(const TIntermTyped&) const;
|
||||
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
|
||||
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
|
||||
#ifndef GLSLANG_WEB
|
||||
void finish() override;
|
||||
#endif
|
||||
|
||||
virtual const char* getGlobalUniformBlockName() const override;
|
||||
virtual void finalizeGlobalUniformBlockLayout(TVariable&) override;
|
||||
|
|
@ -547,7 +538,6 @@ protected:
|
|||
TQualifier globalOutputDefaults;
|
||||
TQualifier globalSharedDefaults;
|
||||
TString currentCaller; // name of last function body entered (not valid when at global scope)
|
||||
#ifndef GLSLANG_WEB
|
||||
int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
|
||||
bool anyIndexLimits;
|
||||
TIdSetType inductiveLoopIds;
|
||||
|
|
@ -588,7 +578,6 @@ protected:
|
|||
// array-sizing declarations
|
||||
//
|
||||
TVector<TSymbol*> ioArraySymbolResizeList;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -324,9 +324,7 @@ struct str_hash
|
|||
// A single global usable by all threads, by all versions, by all languages.
|
||||
// After a single process-level initialization, this is read only and thread safe
|
||||
std::unordered_map<const char*, int, str_hash, str_eq>* KeywordMap = nullptr;
|
||||
#ifndef GLSLANG_WEB
|
||||
std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +407,6 @@ void TScanContext::fillInKeywordMap()
|
|||
(*KeywordMap)["uvec3"] = UVEC3;
|
||||
(*KeywordMap)["uvec4"] = UVEC4;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
(*KeywordMap)["nonuniformEXT"] = NONUNIFORM;
|
||||
(*KeywordMap)["demote"] = DEMOTE;
|
||||
(*KeywordMap)["attribute"] = ATTRIBUTE;
|
||||
|
|
@ -599,7 +596,6 @@ void TScanContext::fillInKeywordMap()
|
|||
(*KeywordMap)["spirv_storage_class"] = SPIRV_STORAGE_CLASS;
|
||||
(*KeywordMap)["spirv_by_reference"] = SPIRV_BY_REFERENCE;
|
||||
(*KeywordMap)["spirv_literal"] = SPIRV_LITERAL;
|
||||
#endif
|
||||
|
||||
(*KeywordMap)["sampler2D"] = SAMPLER2D;
|
||||
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
|
||||
|
|
@ -633,7 +629,6 @@ void TScanContext::fillInKeywordMap()
|
|||
(*KeywordMap)["sampler"] = SAMPLER;
|
||||
(*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
(*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY;
|
||||
(*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY;
|
||||
(*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY;
|
||||
|
|
@ -814,17 +809,14 @@ void TScanContext::fillInKeywordMap()
|
|||
ReservedSet->insert("cast");
|
||||
ReservedSet->insert("namespace");
|
||||
ReservedSet->insert("using");
|
||||
#endif
|
||||
}
|
||||
|
||||
void TScanContext::deleteKeywordMap()
|
||||
{
|
||||
delete KeywordMap;
|
||||
KeywordMap = nullptr;
|
||||
#ifndef GLSLANG_WEB
|
||||
delete ReservedSet;
|
||||
ReservedSet = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Called by yylex to get the next token.
|
||||
|
|
@ -905,14 +897,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
|||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||
#ifndef GLSLANG_WEB
|
||||
case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT;
|
||||
case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT;
|
||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||
case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT;
|
||||
#endif
|
||||
case PpAtomIdentifier:
|
||||
{
|
||||
int token = tokenizeIdentifier();
|
||||
|
|
@ -934,10 +924,8 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
|||
|
||||
int TScanContext::tokenizeIdentifier()
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (ReservedSet->find(tokenText) != ReservedSet->end())
|
||||
return reservedWord();
|
||||
#endif
|
||||
|
||||
auto it = KeywordMap->find(tokenText);
|
||||
if (it == KeywordMap->end()) {
|
||||
|
|
@ -1060,7 +1048,6 @@ int TScanContext::tokenizeIdentifier()
|
|||
return identifierOrReserved(reserved);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case NOPERSPECTIVE:
|
||||
if (parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
|
||||
return keyword;
|
||||
|
|
@ -1147,7 +1134,7 @@ int TScanContext::tokenizeIdentifier()
|
|||
|
||||
case SUBROUTINE:
|
||||
return es30ReservedFromGLSL(400);
|
||||
#endif
|
||||
|
||||
case SHARED:
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 140))
|
||||
|
|
@ -1182,7 +1169,6 @@ int TScanContext::tokenizeIdentifier()
|
|||
case MAT4X4:
|
||||
return matNxM();
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case DMAT2:
|
||||
case DMAT3:
|
||||
case DMAT4:
|
||||
|
|
@ -1487,7 +1473,6 @@ int TScanContext::tokenizeIdentifier()
|
|||
return keyword;
|
||||
else
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case UINT:
|
||||
case UVEC2:
|
||||
|
|
@ -1542,7 +1527,6 @@ int TScanContext::tokenizeIdentifier()
|
|||
else
|
||||
return identifierOrType();
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case ISAMPLER1D:
|
||||
case ISAMPLER1DARRAY:
|
||||
case SAMPLER1DARRAYSHADOW:
|
||||
|
|
@ -1824,7 +1808,6 @@ int TScanContext::tokenizeIdentifier()
|
|||
&& parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
default:
|
||||
parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc);
|
||||
|
|
|
|||
|
|
@ -295,11 +295,6 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
|
|||
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
|
||||
TSymbolTable** symbolTables)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
profile = EEsProfile;
|
||||
version = 310;
|
||||
#endif
|
||||
|
||||
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
|
||||
InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
|
||||
infoSink, *symbolTables[language]);
|
||||
|
|
@ -316,11 +311,6 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
|
|||
//
|
||||
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
profile = EEsProfile;
|
||||
version = 310;
|
||||
#endif
|
||||
|
||||
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
|
||||
|
||||
if (builtInParseables == nullptr)
|
||||
|
|
@ -343,7 +333,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source,
|
||||
infoSink, commonTable, symbolTables);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// check for tessellation
|
||||
if ((profile != EEsProfile && version >= 150) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
|
|
@ -392,7 +381,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||
(profile == EEsProfile && version >= 320))
|
||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source,
|
||||
infoSink, commonTable, symbolTables);
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -494,13 +482,11 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
|
|||
// Function to Print all builtins
|
||||
void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
|
||||
{
|
||||
#if !defined(GLSLANG_WEB)
|
||||
infoSink.debug << "BuiltinSymbolTable {\n";
|
||||
|
||||
symbolTable.dump(infoSink, true);
|
||||
|
||||
infoSink.debug << "}\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
// Return true if the shader was correctly specified for version/profile/stage.
|
||||
|
|
@ -598,7 +584,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||
break;
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
// Correct for stage type...
|
||||
switch (stage) {
|
||||
case EShLangGeometry:
|
||||
|
|
@ -686,7 +671,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return correct;
|
||||
}
|
||||
|
|
@ -876,7 +860,6 @@ bool ProcessDeferred(
|
|||
: userInput.scanVersion(version, profile, versionNotFirstToken);
|
||||
bool versionNotFound = version == 0;
|
||||
if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
|
||||
#if !defined(GLSLANG_WEB)
|
||||
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
|
||||
(version != defaultVersion || profile != defaultProfile)) {
|
||||
compiler->infoSink.info << "Warning, (version, profile) forced to be ("
|
||||
|
|
@ -884,7 +867,7 @@ bool ProcessDeferred(
|
|||
<< "), while in source code it is ("
|
||||
<< version << ", " << ProfileName(profile) << ")\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
if (versionNotFound) {
|
||||
versionNotFirstToken = false;
|
||||
versionNotFirst = false;
|
||||
|
|
@ -899,13 +882,7 @@ bool ProcessDeferred(
|
|||
|
||||
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
|
||||
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
|
||||
#ifdef GLSLANG_WEB
|
||||
profile = EEsProfile;
|
||||
version = 310;
|
||||
#endif
|
||||
|
||||
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
|
||||
#if !defined(GLSLANG_WEB)
|
||||
bool warnVersionNotFirst = false;
|
||||
if (! versionWillBeError && versionNotFirstToken) {
|
||||
if (messages & EShMsgRelaxedErrors)
|
||||
|
|
@ -913,7 +890,6 @@ bool ProcessDeferred(
|
|||
else
|
||||
versionWillBeError = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
intermediate.setSource(source);
|
||||
intermediate.setVersion(version);
|
||||
|
|
@ -978,13 +954,11 @@ bool ProcessDeferred(
|
|||
parseContext->setLimits(*resources);
|
||||
if (! goodVersion)
|
||||
parseContext->addError();
|
||||
#if !defined(GLSLANG_WEB)
|
||||
if (warnVersionNotFirst) {
|
||||
TSourceLoc loc;
|
||||
loc.init();
|
||||
parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", "");
|
||||
}
|
||||
#endif
|
||||
|
||||
parseContext->initializeExtensionBehavior();
|
||||
|
||||
|
|
@ -1016,8 +990,6 @@ bool ProcessDeferred(
|
|||
return success;
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
// Responsible for keeping track of the most recent source string and line in
|
||||
// the preprocessor and outputting newlines appropriately if the source string
|
||||
// or line changes.
|
||||
|
|
@ -1214,8 +1186,6 @@ struct DoPreprocessing {
|
|||
std::string* outputString;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// DoFullParse is a valid ProcessingConext template argument for fully
|
||||
// parsing the shader. It populates the "intermediate" with the AST.
|
||||
struct DoFullParse{
|
||||
|
|
@ -1246,7 +1216,6 @@ struct DoFullParse{
|
|||
}
|
||||
};
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
// Take a single compilation unit, and run the preprocessor on it.
|
||||
// Return: True if there were no issues found in preprocessing,
|
||||
// False if during preprocessing any unknown version, pragmas or
|
||||
|
|
@ -1281,7 +1250,6 @@ bool PreprocessDeferred(
|
|||
forwardCompatible, messages, intermediate, parser,
|
||||
false, includer, "", environment);
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// do a partial compile on the given strings for a single compilation unit
|
||||
|
|
@ -1831,8 +1799,6 @@ void TShader::setDxPositionW(bool invert) { intermediate->setDxPos
|
|||
void TShader::setEnhancedMsgs() { intermediate->setEnhancedMsgs(); }
|
||||
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
// Set binding base for given resource type
|
||||
void TShader::setShiftBinding(TResourceType res, unsigned int base) {
|
||||
intermediate->setShiftBinding(res, base);
|
||||
|
|
@ -1874,7 +1840,6 @@ void TShader::setUniformLocationBase(int base)
|
|||
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
||||
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
|
||||
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
|
||||
#endif
|
||||
|
||||
void TShader::addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing) { intermediate->addBlockStorageOverride(nameStr, backing); }
|
||||
|
||||
|
|
@ -1913,7 +1878,6 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
|
|||
&environment);
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
// Fill in a string with the result of preprocessing ShaderStrings
|
||||
// Returns true if all extensions, pragmas and version strings were valid.
|
||||
//
|
||||
|
|
@ -1939,7 +1903,6 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
|
|||
forwardCompatible, message, includer, *intermediate, output_string,
|
||||
&environment);
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* TShader::getInfoLog()
|
||||
{
|
||||
|
|
@ -1951,11 +1914,7 @@ const char* TShader::getInfoDebugLog()
|
|||
return infoSink->debug.c_str();
|
||||
}
|
||||
|
||||
TProgram::TProgram() :
|
||||
#if !defined(GLSLANG_WEB)
|
||||
reflection(nullptr),
|
||||
#endif
|
||||
linked(false)
|
||||
TProgram::TProgram() : reflection(nullptr), linked(false)
|
||||
{
|
||||
pool = new TPoolAllocator;
|
||||
infoSink = new TInfoSink;
|
||||
|
|
@ -1968,9 +1927,7 @@ TProgram::TProgram() :
|
|||
TProgram::~TProgram()
|
||||
{
|
||||
delete infoSink;
|
||||
#if !defined(GLSLANG_WEB)
|
||||
delete reflection;
|
||||
#endif
|
||||
|
||||
for (int s = 0; s < EShLangCount; ++s)
|
||||
if (newedIntermediate[s])
|
||||
|
|
@ -2018,7 +1975,6 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
|||
if (stages[stage].size() == 0)
|
||||
return true;
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
int numEsShaders = 0, numNonEsShaders = 0;
|
||||
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
|
||||
if ((*it)->intermediate->getProfile() == EEsProfile) {
|
||||
|
|
@ -2069,9 +2025,6 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
|||
for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
|
||||
intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
|
||||
}
|
||||
#else
|
||||
intermediate[stage] = stages[stage].front()->intermediate;
|
||||
#endif
|
||||
intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
|
||||
|
||||
if (messages & EShMsgAST)
|
||||
|
|
@ -2153,8 +2106,6 @@ const char* TProgram::getInfoDebugLog()
|
|||
return infoSink->debug.c_str();
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
//
|
||||
// Reflection implementation.
|
||||
//
|
||||
|
|
@ -2235,6 +2186,4 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
|
|||
return ioMapper->doMap(pResolver, *infoSink);
|
||||
}
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
//
|
||||
// GL_EXT_spirv_intrinsics
|
||||
//
|
||||
|
|
@ -360,5 +358,3 @@ TSpirvInstruction* TParseContext::mergeSpirvInstruction(const TSourceLoc& loc, T
|
|||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ void TType::buildMangledName(TString& mangledName) const
|
|||
case EbtInt: mangledName += 'i'; break;
|
||||
case EbtUint: mangledName += 'u'; break;
|
||||
case EbtBool: mangledName += 'b'; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: mangledName += 'd'; break;
|
||||
case EbtFloat16: mangledName += "f16"; break;
|
||||
case EbtInt8: mangledName += "i8"; break;
|
||||
|
|
@ -79,12 +78,9 @@ void TType::buildMangledName(TString& mangledName) const
|
|||
case EbtRayQuery: mangledName += "rq"; break;
|
||||
case EbtSpirvType: mangledName += "spv-t"; break;
|
||||
case EbtHitObjectNV: mangledName += "ho"; break;
|
||||
#endif
|
||||
case EbtSampler:
|
||||
switch (sampler.type) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16: mangledName += "f16"; break;
|
||||
#endif
|
||||
case EbtInt: mangledName += "i"; break;
|
||||
case EbtUint: mangledName += "u"; break;
|
||||
case EbtInt64: mangledName += "i64"; break;
|
||||
|
|
@ -111,12 +107,10 @@ void TType::buildMangledName(TString& mangledName) const
|
|||
case Esd2D: mangledName += "2"; break;
|
||||
case Esd3D: mangledName += "3"; break;
|
||||
case EsdCube: mangledName += "C"; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case Esd1D: mangledName += "1"; break;
|
||||
case EsdRect: mangledName += "R2"; break;
|
||||
case EsdBuffer: mangledName += "B"; break;
|
||||
case EsdSubpass: mangledName += "P"; break;
|
||||
#endif
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
|
|
@ -184,8 +178,6 @@ void TType::buildMangledName(TString& mangledName) const
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
//
|
||||
// Dump functions.
|
||||
//
|
||||
|
|
@ -264,8 +256,6 @@ void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Functions have buried pointers to delete.
|
||||
//
|
||||
|
|
@ -398,9 +388,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
|
|||
implicitThis = copyOf.implicitThis;
|
||||
illegalImplicitThis = copyOf.illegalImplicitThis;
|
||||
defaultParamCount = copyOf.defaultParamCount;
|
||||
#ifndef GLSLANG_WEB
|
||||
spirvInst = copyOf.spirvInst;
|
||||
#endif
|
||||
}
|
||||
|
||||
TFunction* TFunction::clone() const
|
||||
|
|
|
|||
|
|
@ -117,10 +117,8 @@ public:
|
|||
virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
|
||||
virtual const char** getExtensions() const { return extensions->data(); }
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
|
||||
void dumpExtensions(TInfoSink& infoSink) const;
|
||||
#endif
|
||||
|
||||
virtual bool isReadOnly() const { return ! writable; }
|
||||
virtual void makeReadOnly() { writable = false; }
|
||||
|
|
@ -196,9 +194,7 @@ public:
|
|||
}
|
||||
virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TVariable(const TVariable&);
|
||||
|
|
@ -321,18 +317,14 @@ public:
|
|||
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
||||
const TQualifier& getQualifier() const { return returnType.getQualifier(); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void setSpirvInstruction(const TSpirvInstruction& inst)
|
||||
{
|
||||
relateToOperator(EOpSpirvInst);
|
||||
spirvInst = inst;
|
||||
}
|
||||
virtual const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
|
||||
#endif
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TFunction(const TFunction&);
|
||||
|
|
@ -354,9 +346,7 @@ protected:
|
|||
// but is not allowed to use them, or see hidden symbols instead.
|
||||
int defaultParamCount;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers
|
||||
#endif
|
||||
};
|
||||
|
||||
//
|
||||
|
|
@ -396,9 +386,7 @@ public:
|
|||
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
|
||||
|
||||
virtual int getAnonId() const { return anonId; }
|
||||
#if !defined(GLSLANG_WEB)
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TAnonMember(const TAnonMember&);
|
||||
|
|
@ -583,9 +571,7 @@ public:
|
|||
|
||||
void relateToOperator(const char* name, TOperator op);
|
||||
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
||||
#if !defined(GLSLANG_WEB)
|
||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
TSymbolTableLevel* clone() const;
|
||||
void readOnly();
|
||||
|
||||
|
|
@ -913,9 +899,7 @@ public:
|
|||
}
|
||||
|
||||
long long getMaxSymbolId() { return uniqueId; }
|
||||
#if !defined(GLSLANG_WEB)
|
||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
void copyTable(const TSymbolTable& copyOf);
|
||||
|
||||
void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }
|
||||
|
|
|
|||
|
|
@ -151,8 +151,6 @@
|
|||
|
||||
namespace glslang {
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
//
|
||||
// Initialize all extensions, almost always to 'disable', as once their features
|
||||
// are incorporated into a core version, their features are supported through allowing that
|
||||
|
|
@ -385,8 +383,6 @@ void TParseVersions::initializeExtensionBehavior()
|
|||
spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture);
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
// Get code that is not part of a shared symbol table, is specific to this shader,
|
||||
// or needed by the preprocessor (which does not use a shared symbol table).
|
||||
void TParseVersions::getPreamble(std::string& preamble)
|
||||
|
|
@ -395,9 +391,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
preamble =
|
||||
"#define GL_ES 1\n"
|
||||
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
|
||||
#ifdef GLSLANG_WEB
|
||||
;
|
||||
#else
|
||||
"#define GL_OES_texture_3D 1\n"
|
||||
"#define GL_OES_standard_derivatives 1\n"
|
||||
"#define GL_EXT_frag_depth 1\n"
|
||||
|
|
@ -596,11 +589,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
if (version >= 130) {
|
||||
preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n";
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((!isEsProfile() && version >= 140) ||
|
||||
(isEsProfile() && version >= 310)) {
|
||||
preamble +=
|
||||
|
|
@ -628,7 +618,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
preamble +=
|
||||
"#define GL_EXT_terminate_invocation 1\n"
|
||||
;
|
||||
#endif
|
||||
|
||||
// #define VULKAN XXXX
|
||||
const int numberBufSize = 12;
|
||||
|
|
@ -640,7 +629,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
preamble += "\n";
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// #define GL_SPIRV XXXX
|
||||
if (spvVersion.openGl > 0) {
|
||||
preamble += "#define GL_SPIRV ";
|
||||
|
|
@ -648,9 +636,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
preamble += numberBuf;
|
||||
preamble += "\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// GL_EXT_spirv_intrinsics
|
||||
if (!isEsProfile()) {
|
||||
switch (language) {
|
||||
|
|
@ -671,7 +657,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||
default: break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -683,7 +668,6 @@ const char* StageName(EShLanguage stage)
|
|||
case EShLangVertex: return "vertex";
|
||||
case EShLangFragment: return "fragment";
|
||||
case EShLangCompute: return "compute";
|
||||
#ifndef GLSLANG_WEB
|
||||
case EShLangTessControl: return "tessellation control";
|
||||
case EShLangTessEvaluation: return "tessellation evaluation";
|
||||
case EShLangGeometry: return "geometry";
|
||||
|
|
@ -695,7 +679,6 @@ const char* StageName(EShLanguage stage)
|
|||
case EShLangCallable: return "callable";
|
||||
case EShLangMesh: return "mesh";
|
||||
case EShLangTask: return "task";
|
||||
#endif
|
||||
default: return "unknown stage";
|
||||
}
|
||||
}
|
||||
|
|
@ -720,7 +703,6 @@ void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, cons
|
|||
requireStage(loc, static_cast<EShLanguageMask>(1 << stage), featureDesc);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//
|
||||
// When to use requireProfile():
|
||||
//
|
||||
|
|
@ -758,7 +740,6 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int
|
|||
{
|
||||
if (profile & profileMask) {
|
||||
bool okay = minVersion > 0 && version >= minVersion;
|
||||
#ifndef GLSLANG_WEB
|
||||
for (int i = 0; i < numExtensions; ++i) {
|
||||
switch (getExtensionBehavior(extensions[i])) {
|
||||
case EBhWarn:
|
||||
|
|
@ -771,7 +752,6 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int
|
|||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (! okay)
|
||||
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||
}
|
||||
|
|
@ -1362,7 +1342,7 @@ void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool bu
|
|||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
}
|
||||
}
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
// Call for any operation removed because SPIR-V is in use.
|
||||
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
|
|
@ -1380,26 +1360,20 @@ void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op)
|
|||
// Call for any operation that requires Vulkan.
|
||||
void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.vulkan == 0)
|
||||
error(loc, "only allowed when using GLSL for Vulkan", op, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Call for any operation that requires SPIR-V.
|
||||
void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.spv == 0)
|
||||
error(loc, "only allowed when generating SPIR-V", op, "");
|
||||
#endif
|
||||
}
|
||||
void TParseVersions::requireSpv(const TSourceLoc& loc, const char *op, unsigned int version)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.spv < version)
|
||||
error(loc, "not supported for current targeted SPIR-V version", op, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#include "attribute.h"
|
||||
#include "../Include/intermediate.h"
|
||||
#include "ParseHelper.h"
|
||||
|
|
@ -367,5 +365,3 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri
|
|||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -42,26 +42,9 @@
|
|||
// The .y bison file is not a source file, it is a derivative of the .m4 file.
|
||||
// The m4 file needs to be processed by m4 to generate the .y bison file.
|
||||
//
|
||||
// Code sandwiched between a pair:
|
||||
//
|
||||
// GLSLANG_WEB_EXCLUDE_ON
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// GLSLANG_WEB_EXCLUDE_OFF
|
||||
//
|
||||
// Will be excluded from the grammar when m4 is executed as:
|
||||
//
|
||||
// m4 -P -DGLSLANG_WEB
|
||||
//
|
||||
// It will be included when m4 is executed as:
|
||||
//
|
||||
// m4 -P
|
||||
//
|
||||
|
||||
m4_define(`GLSLANG_WEB_EXCLUDE_ON', `m4_ifdef(`GLSLANG_WEB', `m4_divert(`-1')')')
|
||||
m4_define(`GLSLANG_WEB_EXCLUDE_OFF', `m4_ifdef(`GLSLANG_WEB', `m4_divert')')
|
||||
|
||||
/**
|
||||
* This is bison grammar and productions for parsing all versions of the
|
||||
* GLSL shading languages.
|
||||
|
|
@ -177,8 +160,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
|
||||
%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
|
||||
%token <lex> ATTRIBUTE VARYING
|
||||
%token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
|
||||
%token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
|
||||
|
|
@ -282,8 +263,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
%token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
|
||||
%token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
%token <lex> LEFT_OP RIGHT_OP
|
||||
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
|
||||
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
||||
|
|
@ -309,7 +288,6 @@ GLSLANG_WEB_EXCLUDE_OFF
|
|||
%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
|
||||
%token <lex> FLAT SMOOTH LAYOUT
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
|
||||
%token <lex> INT64CONSTANT UINT64CONSTANT
|
||||
%token <lex> SUBROUTINE DEMOTE
|
||||
|
|
@ -320,7 +298,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
%token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
|
||||
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
|
||||
%token <lex> PRECISE
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
%type <interm> assignment_operator unary_operator
|
||||
%type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
|
||||
|
|
@ -367,7 +344,6 @@ GLSLANG_WEB_EXCLUDE_OFF
|
|||
|
||||
%type <interm.identifierList> identifier_list
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
%type <interm.type> precise_qualifier non_uniform_qualifier
|
||||
%type <interm.typeList> type_name_list
|
||||
%type <interm.attributes> attribute attribute_list single_attribute
|
||||
|
|
@ -386,7 +362,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
%type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
|
||||
%type <interm.spirvInst> spirv_instruction_qualifier
|
||||
%type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
%start translation_unit
|
||||
%%
|
||||
|
|
@ -419,7 +394,6 @@ primary_expression
|
|||
| BOOLCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| STRING_LITERAL {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
|
||||
}
|
||||
|
|
@ -457,7 +431,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
parseContext.float16Check($1.loc, "half float literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
postfix_expression
|
||||
|
|
@ -583,13 +556,11 @@ function_identifier
|
|||
$$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
|
||||
}
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| non_uniform_qualifier {
|
||||
// Constructor
|
||||
$$.intermNode = 0;
|
||||
$$.function = parseContext.handleConstructorCall($1.loc, $1);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
unary_expression
|
||||
|
|
@ -899,7 +870,6 @@ declaration
|
|||
$$ = 0;
|
||||
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| spirv_instruction_qualifier function_prototype SEMICOLON {
|
||||
parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
|
||||
$2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
|
||||
|
|
@ -912,7 +882,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
|
||||
$$ = 0;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| init_declarator_list SEMICOLON {
|
||||
if ($1.intermNode && $1.intermNode->getAsAggregate())
|
||||
$1.intermNode->getAsAggregate()->setOperator(EOpSequence);
|
||||
|
|
@ -1182,9 +1151,7 @@ single_declaration
|
|||
: fully_specified_type {
|
||||
$$.type = $1;
|
||||
$$.intermNode = 0;
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
parseContext.declareTypeDefaults($$.loc, $$.type);
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
}
|
||||
| fully_specified_type IDENTIFIER {
|
||||
$$.type = $1;
|
||||
|
|
@ -1270,7 +1237,6 @@ interpolation_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.flat = true;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| NOPERSPECTIVE {
|
||||
parseContext.globalCheck($1.loc, "noperspective");
|
||||
parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
|
||||
|
|
@ -1335,7 +1301,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.perTaskNV = true;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
layout_qualifier
|
||||
|
|
@ -1370,7 +1335,6 @@ layout_qualifier_id
|
|||
}
|
||||
;
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
precise_qualifier
|
||||
: PRECISE {
|
||||
parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
|
||||
|
|
@ -1379,7 +1343,6 @@ precise_qualifier
|
|||
$$.qualifier.noContraction = true;
|
||||
}
|
||||
;
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
type_qualifier
|
||||
: single_type_qualifier {
|
||||
|
|
@ -1414,7 +1377,6 @@ single_type_qualifier
|
|||
// allow inheritance of storage qualifier from block declaration
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| precise_qualifier {
|
||||
// allow inheritance of storage qualifier from block declaration
|
||||
$$ = $1;
|
||||
|
|
@ -1441,7 +1403,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.setSpirvLiteral();
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
storage_qualifier
|
||||
|
|
@ -1496,7 +1457,6 @@ storage_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqBuffer;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| ATTRIBUTE {
|
||||
parseContext.requireStage($1.loc, EShLangVertex, "attribute");
|
||||
parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
|
||||
|
|
@ -1689,10 +1649,8 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqtaskPayloadSharedEXT;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
non_uniform_qualifier
|
||||
: NONUNIFORM {
|
||||
$$.init($1.loc);
|
||||
|
|
@ -1710,7 +1668,6 @@ type_name_list
|
|||
// 2) save all of the identifiers for future comparison with the declared function
|
||||
}
|
||||
;
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
type_specifier
|
||||
: type_specifier_nonarray type_parameter_specifier_opt {
|
||||
|
|
@ -1940,7 +1897,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtFloat;
|
||||
$$.setMatrix(4, 4);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| DOUBLE {
|
||||
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
|
||||
if (! parseContext.symbolTable.atBuiltInLevel())
|
||||
|
|
@ -2559,7 +2515,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtFloat, Esd1D);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| SAMPLER2D {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2595,7 +2550,6 @@ GLSLANG_WEB_EXCLUDE_OFF
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtFloat, Esd2D, true, true);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| SAMPLER1DSHADOW {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2704,7 +2658,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtInt, Esd1D);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| ISAMPLER2D {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2740,7 +2693,6 @@ GLSLANG_WEB_EXCLUDE_OFF
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtUint, EsdCube);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| ISAMPLER1DARRAY {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2781,7 +2733,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setTexture(EbtUint, EsdCube, true);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| USAMPLER2DARRAY {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2857,7 +2808,6 @@ GLSLANG_WEB_EXCLUDE_OFF
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setPureSampler(true);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| SAMPLER2DRECT {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -3566,7 +3516,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectNV;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| struct_specifier {
|
||||
$$ = $1;
|
||||
$$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
|
||||
|
|
@ -3721,7 +3670,6 @@ initializer
|
|||
: assignment_expression {
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| LEFT_BRACE initializer_list RIGHT_BRACE {
|
||||
const char* initFeature = "{ } style initializers";
|
||||
parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
|
||||
|
|
@ -3740,10 +3688,8 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
|
||||
$$ = parseContext.intermediate.makeAggregate($1.loc);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
initializer_list
|
||||
: initializer {
|
||||
$$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
|
||||
|
|
@ -3752,7 +3698,6 @@ initializer_list
|
|||
$$ = parseContext.intermediate.growAggregate($1, $3);
|
||||
}
|
||||
;
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
declaration_statement
|
||||
: declaration { $$ = $1; }
|
||||
|
|
@ -3773,12 +3718,9 @@ simple_statement
|
|||
| case_label { $$ = $1; }
|
||||
| iteration_statement { $$ = $1; }
|
||||
| jump_statement { $$ = $1; }
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| demote_statement { $$ = $1; }
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
demote_statement
|
||||
: DEMOTE SEMICOLON {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "demote");
|
||||
|
|
@ -3786,7 +3728,6 @@ demote_statement
|
|||
$$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
|
||||
}
|
||||
;
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
compound_statement
|
||||
: LEFT_BRACE RIGHT_BRACE { $$ = 0; }
|
||||
|
|
@ -3870,13 +3811,11 @@ selection_statement
|
|||
: selection_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| attribute selection_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleSelectionAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
selection_statement_nonattributed
|
||||
: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
|
||||
|
|
@ -3918,13 +3857,11 @@ switch_statement
|
|||
: switch_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| attribute switch_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleSwitchAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
switch_statement_nonattributed
|
||||
: SWITCH LEFT_PAREN expression RIGHT_PAREN {
|
||||
|
|
@ -3983,13 +3920,11 @@ iteration_statement
|
|||
: iteration_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| attribute iteration_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleLoopAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
iteration_statement_nonattributed
|
||||
: WHILE LEFT_PAREN {
|
||||
|
|
@ -4103,7 +4038,6 @@ jump_statement
|
|||
parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
|
||||
$$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| TERMINATE_RAY SEMICOLON {
|
||||
parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
|
||||
$$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
|
||||
|
|
@ -4112,7 +4046,6 @@ GLSLANG_WEB_EXCLUDE_ON
|
|||
parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
|
||||
$$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
// Grammar Note: No 'goto'. Gotos are not supported.
|
||||
|
|
@ -4137,13 +4070,11 @@ external_declaration
|
|||
| declaration {
|
||||
$$ = $1;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
| SEMICOLON {
|
||||
parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
|
||||
parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
|
||||
$$ = nullptr;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
;
|
||||
|
||||
function_definition
|
||||
|
|
@ -4187,7 +4118,6 @@ function_definition
|
|||
}
|
||||
;
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
attribute
|
||||
: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
|
||||
$$ = $3;
|
||||
|
|
@ -4208,9 +4138,7 @@ single_attribute
|
|||
| IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
|
||||
$$ = parseContext.makeAttributes(*$1.string, $3);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
spirv_requirements_list
|
||||
: spirv_requirements_parameter {
|
||||
$$ = $1;
|
||||
|
|
@ -4487,6 +4415,5 @@ spirv_instruction_qualifier_id
|
|||
| IDENTIFIER EQUAL INTCONSTANT {
|
||||
$$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
%%
|
||||
|
|
|
|||
|
|
@ -42,26 +42,9 @@
|
|||
// The .y bison file is not a source file, it is a derivative of the .m4 file.
|
||||
// The m4 file needs to be processed by m4 to generate the .y bison file.
|
||||
//
|
||||
// Code sandwiched between a pair:
|
||||
//
|
||||
// GLSLANG_WEB_EXCLUDE_ON
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// GLSLANG_WEB_EXCLUDE_OFF
|
||||
//
|
||||
// Will be excluded from the grammar when m4 is executed as:
|
||||
//
|
||||
// m4 -P -DGLSLANG_WEB
|
||||
//
|
||||
// It will be included when m4 is executed as:
|
||||
//
|
||||
// m4 -P
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is bison grammar and productions for parsing all versions of the
|
||||
* GLSL shading languages.
|
||||
|
|
@ -177,8 +160,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
|
||||
%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
|
||||
|
||||
|
||||
|
||||
%token <lex> ATTRIBUTE VARYING
|
||||
%token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
|
||||
%token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
|
||||
|
|
@ -282,8 +263,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
|
||||
%token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
|
||||
|
||||
|
||||
|
||||
%token <lex> LEFT_OP RIGHT_OP
|
||||
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
|
||||
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
|
||||
|
|
@ -309,7 +288,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
|
||||
%token <lex> FLAT SMOOTH LAYOUT
|
||||
|
||||
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
|
||||
%token <lex> INT64CONSTANT UINT64CONSTANT
|
||||
%token <lex> SUBROUTINE DEMOTE
|
||||
|
|
@ -321,7 +299,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
|
||||
%token <lex> PRECISE
|
||||
|
||||
|
||||
%type <interm> assignment_operator unary_operator
|
||||
%type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
|
||||
%type <interm.intermTypedNode> expression integer_expression assignment_expression
|
||||
|
|
@ -367,7 +344,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
|
||||
%type <interm.identifierList> identifier_list
|
||||
|
||||
|
||||
%type <interm.type> precise_qualifier non_uniform_qualifier
|
||||
%type <interm.typeList> type_name_list
|
||||
%type <interm.attributes> attribute attribute_list single_attribute
|
||||
|
|
@ -387,7 +363,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||
%type <interm.spirvInst> spirv_instruction_qualifier
|
||||
%type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
|
||||
|
||||
|
||||
%start translation_unit
|
||||
%%
|
||||
|
||||
|
|
@ -419,7 +394,6 @@ primary_expression
|
|||
| BOOLCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
|
||||
}
|
||||
|
||||
| STRING_LITERAL {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
|
||||
}
|
||||
|
|
@ -457,7 +431,6 @@ primary_expression
|
|||
parseContext.float16Check($1.loc, "half float literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
postfix_expression
|
||||
|
|
@ -583,13 +556,11 @@ function_identifier
|
|||
$$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
|
||||
}
|
||||
}
|
||||
|
||||
| non_uniform_qualifier {
|
||||
// Constructor
|
||||
$$.intermNode = 0;
|
||||
$$.function = parseContext.handleConstructorCall($1.loc, $1);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
unary_expression
|
||||
|
|
@ -899,7 +870,6 @@ declaration
|
|||
$$ = 0;
|
||||
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
|
||||
}
|
||||
|
||||
| spirv_instruction_qualifier function_prototype SEMICOLON {
|
||||
parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
|
||||
$2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
|
||||
|
|
@ -912,7 +882,6 @@ declaration
|
|||
parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
|
||||
$$ = 0;
|
||||
}
|
||||
|
||||
| init_declarator_list SEMICOLON {
|
||||
if ($1.intermNode && $1.intermNode->getAsAggregate())
|
||||
$1.intermNode->getAsAggregate()->setOperator(EOpSequence);
|
||||
|
|
@ -1182,9 +1151,7 @@ single_declaration
|
|||
: fully_specified_type {
|
||||
$$.type = $1;
|
||||
$$.intermNode = 0;
|
||||
|
||||
parseContext.declareTypeDefaults($$.loc, $$.type);
|
||||
|
||||
}
|
||||
| fully_specified_type IDENTIFIER {
|
||||
$$.type = $1;
|
||||
|
|
@ -1270,7 +1237,6 @@ interpolation_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.flat = true;
|
||||
}
|
||||
|
||||
| NOPERSPECTIVE {
|
||||
parseContext.globalCheck($1.loc, "noperspective");
|
||||
parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
|
||||
|
|
@ -1335,7 +1301,6 @@ interpolation_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.perTaskNV = true;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
layout_qualifier
|
||||
|
|
@ -1370,7 +1335,6 @@ layout_qualifier_id
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
precise_qualifier
|
||||
: PRECISE {
|
||||
parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
|
||||
|
|
@ -1380,7 +1344,6 @@ precise_qualifier
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
type_qualifier
|
||||
: single_type_qualifier {
|
||||
$$ = $1;
|
||||
|
|
@ -1414,7 +1377,6 @@ single_type_qualifier
|
|||
// allow inheritance of storage qualifier from block declaration
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| precise_qualifier {
|
||||
// allow inheritance of storage qualifier from block declaration
|
||||
$$ = $1;
|
||||
|
|
@ -1441,7 +1403,6 @@ single_type_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.setSpirvLiteral();
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
storage_qualifier
|
||||
|
|
@ -1496,7 +1457,6 @@ storage_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqBuffer;
|
||||
}
|
||||
|
||||
| ATTRIBUTE {
|
||||
parseContext.requireStage($1.loc, EShLangVertex, "attribute");
|
||||
parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
|
||||
|
|
@ -1689,10 +1649,8 @@ storage_qualifier
|
|||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqtaskPayloadSharedEXT;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
non_uniform_qualifier
|
||||
: NONUNIFORM {
|
||||
$$.init($1.loc);
|
||||
|
|
@ -1711,7 +1669,6 @@ type_name_list
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
type_specifier
|
||||
: type_specifier_nonarray type_parameter_specifier_opt {
|
||||
$$ = $1;
|
||||
|
|
@ -1940,7 +1897,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtFloat;
|
||||
$$.setMatrix(4, 4);
|
||||
}
|
||||
|
||||
| DOUBLE {
|
||||
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
|
||||
if (! parseContext.symbolTable.atBuiltInLevel())
|
||||
|
|
@ -2559,7 +2515,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtFloat, Esd1D);
|
||||
}
|
||||
|
||||
| SAMPLER2D {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2595,7 +2550,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtFloat, Esd2D, true, true);
|
||||
}
|
||||
|
||||
| SAMPLER1DSHADOW {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2704,7 +2658,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtInt, Esd1D);
|
||||
}
|
||||
|
||||
| ISAMPLER2D {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2740,7 +2693,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.set(EbtUint, EsdCube);
|
||||
}
|
||||
|
||||
| ISAMPLER1DARRAY {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2781,7 +2733,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setTexture(EbtUint, EsdCube, true);
|
||||
}
|
||||
|
||||
| USAMPLER2DARRAY {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -2857,7 +2808,6 @@ type_specifier_nonarray
|
|||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setPureSampler(true);
|
||||
}
|
||||
|
||||
| SAMPLER2DRECT {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
|
|
@ -3566,7 +3516,6 @@ type_specifier_nonarray
|
|||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectNV;
|
||||
}
|
||||
|
||||
| struct_specifier {
|
||||
$$ = $1;
|
||||
$$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
|
||||
|
|
@ -3721,7 +3670,6 @@ initializer
|
|||
: assignment_expression {
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| LEFT_BRACE initializer_list RIGHT_BRACE {
|
||||
const char* initFeature = "{ } style initializers";
|
||||
parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
|
||||
|
|
@ -3740,10 +3688,8 @@ initializer
|
|||
parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
|
||||
$$ = parseContext.intermediate.makeAggregate($1.loc);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
initializer_list
|
||||
: initializer {
|
||||
$$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
|
||||
|
|
@ -3753,7 +3699,6 @@ initializer_list
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
declaration_statement
|
||||
: declaration { $$ = $1; }
|
||||
;
|
||||
|
|
@ -3773,12 +3718,9 @@ simple_statement
|
|||
| case_label { $$ = $1; }
|
||||
| iteration_statement { $$ = $1; }
|
||||
| jump_statement { $$ = $1; }
|
||||
|
||||
| demote_statement { $$ = $1; }
|
||||
|
||||
;
|
||||
|
||||
|
||||
demote_statement
|
||||
: DEMOTE SEMICOLON {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "demote");
|
||||
|
|
@ -3787,7 +3729,6 @@ demote_statement
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
compound_statement
|
||||
: LEFT_BRACE RIGHT_BRACE { $$ = 0; }
|
||||
| LEFT_BRACE {
|
||||
|
|
@ -3870,14 +3811,12 @@ selection_statement
|
|||
: selection_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| attribute selection_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleSelectionAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
|
||||
|
||||
selection_statement_nonattributed
|
||||
: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
|
||||
parseContext.boolCheck($1.loc, $3);
|
||||
|
|
@ -3918,14 +3857,12 @@ switch_statement
|
|||
: switch_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| attribute switch_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleSwitchAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
|
||||
|
||||
switch_statement_nonattributed
|
||||
: SWITCH LEFT_PAREN expression RIGHT_PAREN {
|
||||
// start new switch sequence on the switch stack
|
||||
|
|
@ -3983,14 +3920,12 @@ iteration_statement
|
|||
: iteration_statement_nonattributed {
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| attribute iteration_statement_nonattributed {
|
||||
parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
|
||||
parseContext.handleLoopAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
|
||||
|
||||
iteration_statement_nonattributed
|
||||
: WHILE LEFT_PAREN {
|
||||
if (! parseContext.limits.whileLoops)
|
||||
|
|
@ -4103,7 +4038,6 @@ jump_statement
|
|||
parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
|
||||
$$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
|
||||
}
|
||||
|
||||
| TERMINATE_RAY SEMICOLON {
|
||||
parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
|
||||
$$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
|
||||
|
|
@ -4112,7 +4046,6 @@ jump_statement
|
|||
parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
|
||||
$$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
// Grammar Note: No 'goto'. Gotos are not supported.
|
||||
|
|
@ -4137,13 +4070,11 @@ external_declaration
|
|||
| declaration {
|
||||
$$ = $1;
|
||||
}
|
||||
|
||||
| SEMICOLON {
|
||||
parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
|
||||
parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
|
||||
$$ = nullptr;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
function_definition
|
||||
|
|
@ -4187,7 +4118,6 @@ function_definition
|
|||
}
|
||||
;
|
||||
|
||||
|
||||
attribute
|
||||
: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
|
||||
$$ = $3;
|
||||
|
|
@ -4209,8 +4139,6 @@ single_attribute
|
|||
$$ = parseContext.makeAttributes(*$1.string, $3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
spirv_requirements_list
|
||||
: spirv_requirements_parameter {
|
||||
$$ = $1;
|
||||
|
|
@ -4488,5 +4416,4 @@ spirv_instruction_qualifier_id
|
|||
$$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
|
||||
}
|
||||
|
||||
|
||||
%%
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#include "localintermediate.h"
|
||||
#include "../Include/InfoSink.h"
|
||||
|
||||
|
|
@ -669,9 +667,7 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||
|
||||
case EOpDeclare: out.debug << "Declare"; break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpSpirvInst: out.debug << "spirv_instruction"; break;
|
||||
#endif
|
||||
|
||||
default: out.debug.message(EPrefixError, "Bad unary op");
|
||||
}
|
||||
|
|
@ -1146,9 +1142,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||
case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break;
|
||||
case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpSpirvInst: out.debug << "spirv_instruction"; break;
|
||||
#endif
|
||||
case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break;
|
||||
case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break;
|
||||
|
||||
|
|
@ -1611,5 +1605,3 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
|||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#include "../Include/Common.h"
|
||||
#include "../Include/InfoSink.h"
|
||||
#include "../Include/Types.h"
|
||||
|
|
@ -1714,5 +1712,3 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
|
|||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#ifndef _IOMAPPER_INCLUDED
|
||||
#define _IOMAPPER_INCLUDED
|
||||
|
||||
|
|
@ -359,5 +357,3 @@ private:
|
|||
} // end namespace glslang
|
||||
|
||||
#endif // _IOMAPPER_INCLUDED
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -187,14 +187,12 @@ bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
|||
//
|
||||
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
TIndexTraverser it(inductiveLoopIds);
|
||||
|
||||
index->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -57,13 +57,11 @@ namespace glslang {
|
|||
//
|
||||
void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
infoSink.info.prefix(EPrefixError);
|
||||
if (unitStage < EShLangCount)
|
||||
infoSink.info << "Linking " << StageName(getStage()) << " and " << StageName(unitStage) << " stages: " << message << "\n";
|
||||
else
|
||||
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
||||
#endif
|
||||
|
||||
++numErrors;
|
||||
}
|
||||
|
|
@ -71,13 +69,11 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage
|
|||
// Link-time warning.
|
||||
void TIntermediate::warn(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
infoSink.info.prefix(EPrefixWarning);
|
||||
if (unitStage < EShLangCount)
|
||||
infoSink.info << "Linking " << StageName(language) << " and " << StageName(unitStage) << " stages: " << message << "\n";
|
||||
else
|
||||
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
// TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block
|
||||
|
|
@ -89,11 +85,9 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message, EShLanguage u
|
|||
//
|
||||
void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
|
||||
{
|
||||
#if !defined(GLSLANG_WEB)
|
||||
mergeCallGraphs(infoSink, unit);
|
||||
mergeModes(infoSink, unit);
|
||||
mergeTrees(infoSink, unit);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -161,8 +155,6 @@ void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
|
|||
callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end());
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#define MERGE_MAX(member) member = std::max(member, unit.member)
|
||||
#define MERGE_TRUE(member) if (unit.member) member = unit.member;
|
||||
|
||||
|
|
@ -381,8 +373,6 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
|
|||
ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static const TString& getNameForIdMap(TIntermSymbol* symbol)
|
||||
{
|
||||
TShaderInterface si = symbol->getType().getShaderInterface();
|
||||
|
|
@ -859,7 +849,6 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
|
|||
//
|
||||
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, EShLanguage unitStage)
|
||||
{
|
||||
#if !defined(GLSLANG_WEB)
|
||||
bool crossStage = getStage() != unitStage;
|
||||
bool writeTypeComparison = false;
|
||||
bool errorReported = false;
|
||||
|
|
@ -1187,7 +1176,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void TIntermediate::sharedBlockCheck(TInfoSink& infoSink)
|
||||
|
|
@ -1234,7 +1222,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||
// overlap/alias/missing I/O, etc.
|
||||
inOutLocationCheck(infoSink);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (getNumPushConstants() > 1)
|
||||
error(infoSink, "Only one push_constant block is allowed per stage");
|
||||
|
||||
|
|
@ -1392,7 +1379,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||
} finalLinkTraverser;
|
||||
|
||||
treeRoot->traverse(&finalLinkTraverser);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -1687,7 +1673,6 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
// For raytracing IO (payloads and callabledata) each declaration occupies a single
|
||||
// slot irrespective of type.
|
||||
int collision = -1; // no collision
|
||||
#ifndef GLSLANG_WEB
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {
|
||||
TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
|
||||
collision = checkLocationRT(set, qualifier.layoutLocation);
|
||||
|
|
@ -1723,7 +1708,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
}
|
||||
return collision;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Not a dvec3 in/out split across two locations, generic path.
|
||||
// Need a single IO-range block.
|
||||
|
||||
|
|
@ -1846,10 +1831,8 @@ int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage)
|
|||
if (type.isSizedArray() && !type.getQualifier().isPerView())
|
||||
return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage);
|
||||
else {
|
||||
#ifndef GLSLANG_WEB
|
||||
// unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];"
|
||||
elementType.getQualifier().perViewNV = false;
|
||||
#endif
|
||||
return computeTypeLocationSize(elementType, stage);
|
||||
}
|
||||
}
|
||||
|
|
@ -1925,8 +1908,6 @@ int TIntermediate::computeTypeUniformLocationSize(const TType& type)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
// Accumulate xfb buffer ranges and check for collisions as the accumulation is done.
|
||||
//
|
||||
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
|
||||
|
|
@ -2044,8 +2025,6 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const int baseAlignmentVec4Std140 = 16;
|
||||
|
||||
// Return the size and alignment of a component of the given type.
|
||||
|
|
@ -2053,10 +2032,6 @@ const int baseAlignmentVec4Std140 = 16;
|
|||
// Return value is the alignment..
|
||||
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
size = 4; return 4;
|
||||
#endif
|
||||
|
||||
switch (type.getBasicType()) {
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
|
|
@ -2396,7 +2371,6 @@ int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
|
|||
return size;
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
|
||||
return type.isArray() &&
|
||||
((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) ||
|
||||
|
|
@ -2408,6 +2382,5 @@ bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
|
|||
(language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut &&
|
||||
!type.getQualifier().perTaskNV));
|
||||
}
|
||||
#endif // not GLSLANG_WEB
|
||||
|
||||
} // end namespace glslang
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ struct TOffsetRange {
|
|||
TRange offset;
|
||||
};
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Things that need to be tracked per xfb buffer.
|
||||
struct TXfbBuffer {
|
||||
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
|
||||
|
|
@ -159,7 +158,6 @@ struct TXfbBuffer {
|
|||
bool contains32BitType;
|
||||
bool contains16BitType;
|
||||
};
|
||||
#endif
|
||||
|
||||
// Track a set of strings describing how the module was processed.
|
||||
// This includes command line options, transforms, etc., ideally inclusive enough
|
||||
|
|
@ -311,9 +309,7 @@ public:
|
|||
atomicCounterBlockName(""),
|
||||
globalUniformBlockSet(TQualifier::layoutSetEnd),
|
||||
globalUniformBlockBinding(TQualifier::layoutBindingEnd),
|
||||
atomicCounterBlockSet(TQualifier::layoutSetEnd)
|
||||
#ifndef GLSLANG_WEB
|
||||
,
|
||||
atomicCounterBlockSet(TQualifier::layoutSetEnd),
|
||||
implicitThisName("@this"), implicitCounterName("@count"),
|
||||
source(EShSourceNone),
|
||||
useVulkanMemoryModel(false),
|
||||
|
|
@ -352,7 +348,6 @@ public:
|
|||
spirvRequirement(nullptr),
|
||||
spirvExecutionMode(nullptr),
|
||||
uniformLocationBase(0)
|
||||
#endif
|
||||
{
|
||||
localSize[0] = 1;
|
||||
localSize[1] = 1;
|
||||
|
|
@ -363,10 +358,8 @@ public:
|
|||
localSizeSpecId[0] = TQualifier::layoutNotSet;
|
||||
localSizeSpecId[1] = TQualifier::layoutNotSet;
|
||||
localSizeSpecId[2] = TQualifier::layoutNotSet;
|
||||
#ifndef GLSLANG_WEB
|
||||
xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
|
||||
shiftBinding.fill(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void setVersion(int v)
|
||||
|
|
@ -636,38 +629,6 @@ public:
|
|||
localSizeSpecId[1] != TQualifier::layoutNotSet ||
|
||||
localSizeSpecId[2] != TQualifier::layoutNotSet;
|
||||
}
|
||||
#ifdef GLSLANG_WEB
|
||||
void output(TInfoSink&, bool tree) { }
|
||||
|
||||
bool isEsProfile() const { return false; }
|
||||
bool getXfbMode() const { return false; }
|
||||
bool isMultiStream() const { return false; }
|
||||
TLayoutGeometry getOutputPrimitive() const { return ElgNone; }
|
||||
bool getNonCoherentColorAttachmentReadEXT() const { return false; }
|
||||
bool getNonCoherentDepthAttachmentReadEXT() const { return false; }
|
||||
bool getNonCoherentStencilAttachmentReadEXT() const { return false; }
|
||||
bool getPostDepthCoverage() const { return false; }
|
||||
bool getEarlyFragmentTests() const { return false; }
|
||||
TLayoutDepth getDepth() const { return EldNone; }
|
||||
bool getPixelCenterInteger() const { return false; }
|
||||
void setOriginUpperLeft() { }
|
||||
bool getOriginUpperLeft() const { return true; }
|
||||
TInterlockOrdering getInterlockOrdering() const { return EioNone; }
|
||||
|
||||
bool getAutoMapBindings() const { return false; }
|
||||
bool getAutoMapLocations() const { return false; }
|
||||
int getNumPushConstants() const { return 0; }
|
||||
void addShaderRecordCount() { }
|
||||
void addTaskNVCount() { }
|
||||
void addTaskPayloadEXTCount() { }
|
||||
void setUseVulkanMemoryModel() { }
|
||||
bool usingVulkanMemoryModel() const { return false; }
|
||||
bool usingPhysicalStorageBuffer() const { return false; }
|
||||
bool usingVariablePointers() const { return false; }
|
||||
unsigned getXfbStride(int buffer) const { return 0; }
|
||||
bool hasLayoutDerivativeModeNone() const { return false; }
|
||||
ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
|
||||
#else
|
||||
void output(TInfoSink&, bool tree);
|
||||
|
||||
bool isEsProfile() const { return profile == EEsProfile; }
|
||||
|
|
@ -1006,7 +967,6 @@ public:
|
|||
void insertSpirvExecutionModeId(int executionMode, const TIntermAggregate* args);
|
||||
bool hasSpirvExecutionMode() const { return spirvExecutionMode != nullptr; }
|
||||
const TSpirvExecutionMode& getSpirvExecutionMode() const { return *spirvExecutionMode; }
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
void addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing)
|
||||
{
|
||||
|
|
@ -1113,12 +1073,6 @@ public:
|
|||
void setUniqueId(unsigned long long id) { uniqueId = id; }
|
||||
|
||||
// Certain explicit conversions are allowed conditionally
|
||||
#ifdef GLSLANG_WEB
|
||||
bool getArithemeticInt8Enabled() const { return false; }
|
||||
bool getArithemeticInt16Enabled() const { return false; }
|
||||
bool getArithemeticFloat16Enabled() const { return false; }
|
||||
void updateNumericFeature(TNumericFeatures::feature f, bool on) { }
|
||||
#else
|
||||
bool getArithemeticInt8Enabled() const {
|
||||
return numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) ||
|
||||
numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int8);
|
||||
|
|
@ -1136,7 +1090,6 @@ public:
|
|||
}
|
||||
void updateNumericFeature(TNumericFeatures::feature f, bool on)
|
||||
{ on ? numericFeatures.insert(f) : numericFeatures.erase(f); }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
TIntermSymbol* addSymbol(long long Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
|
||||
|
|
@ -1208,7 +1161,6 @@ protected:
|
|||
unsigned int globalUniformBlockBinding;
|
||||
unsigned int atomicCounterBlockSet;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
public:
|
||||
const char* const implicitThisName;
|
||||
const char* const implicitCounterName;
|
||||
|
|
@ -1279,7 +1231,6 @@ protected:
|
|||
std::unordered_map<std::string, int> uniformLocationOverrides;
|
||||
int uniformLocationBase;
|
||||
TNumericFeatures numericFeatures;
|
||||
#endif
|
||||
std::unordered_map<std::string, TBlockStorageClass> blockBackingOverrides;
|
||||
|
||||
std::unordered_set<int> usedConstantId; // specialization constant ids used
|
||||
|
|
|
|||
|
|
@ -58,10 +58,8 @@ public:
|
|||
const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
|
||||
bool forwardCompatible, EShMessages messages)
|
||||
:
|
||||
#if !defined(GLSLANG_WEB)
|
||||
forwardCompatible(forwardCompatible),
|
||||
profile(profile),
|
||||
#endif
|
||||
infoSink(infoSink), version(version),
|
||||
language(language),
|
||||
spvVersion(spvVersion),
|
||||
|
|
@ -69,54 +67,7 @@ public:
|
|||
virtual ~TParseVersions() { }
|
||||
void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
|
||||
void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);
|
||||
#ifdef GLSLANG_WEB
|
||||
const EProfile profile = EEsProfile;
|
||||
bool isEsProfile() const { return true; }
|
||||
void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
||||
{
|
||||
if (! (EEsProfile & profileMask))
|
||||
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
||||
}
|
||||
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
|
||||
const char* const extensions[], const char* featureDesc)
|
||||
{
|
||||
if ((EEsProfile & profileMask) && (minVersion == 0 || version < minVersion))
|
||||
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||
}
|
||||
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
|
||||
const char* featureDesc)
|
||||
{
|
||||
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
||||
}
|
||||
void initializeExtensionBehavior() { }
|
||||
void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc) { }
|
||||
void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc) { }
|
||||
void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||
const char* featureDesc) { }
|
||||
void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||
const char* featureDesc) { }
|
||||
TExtensionBehavior getExtensionBehavior(const char*) { return EBhMissing; }
|
||||
bool extensionTurnedOn(const char* const extension) { return false; }
|
||||
bool extensionsTurnedOn(int numExtensions, const char* const extensions[]) { return false; }
|
||||
void updateExtensionBehavior(int line, const char* const extension, const char* behavior) { }
|
||||
void updateExtensionBehavior(const char* const extension, TExtensionBehavior) { }
|
||||
void checkExtensionStage(const TSourceLoc&, const char* const extension) { }
|
||||
void extensionRequires(const TSourceLoc&, const char* const extension, const char* behavior) { }
|
||||
void fullIntegerCheck(const TSourceLoc&, const char* op) { }
|
||||
void doubleCheck(const TSourceLoc&, const char* op) { }
|
||||
bool float16Arithmetic() { return false; }
|
||||
void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||
bool int16Arithmetic() { return false; }
|
||||
void requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||
bool int8Arithmetic() { return false; }
|
||||
void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||
void int64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||
void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||
void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||
bool relaxedErrors() const { return false; }
|
||||
bool suppressWarnings() const { return true; }
|
||||
bool isForwardCompatible() const { return false; }
|
||||
#else
|
||||
|
||||
bool forwardCompatible; // true if errors are to be given for use of deprecated features
|
||||
EProfile profile; // the declared profile in the shader (core by default)
|
||||
bool isEsProfile() const { return profile == EEsProfile; }
|
||||
|
|
@ -168,24 +119,13 @@ public:
|
|||
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
|
||||
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
|
||||
bool isForwardCompatible() const { return forwardCompatible; }
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
||||
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
|
||||
virtual void requireVulkan(const TSourceLoc&, const char* op);
|
||||
virtual void requireSpv(const TSourceLoc&, const char* op);
|
||||
virtual void requireSpv(const TSourceLoc&, const char *op, unsigned int version);
|
||||
|
||||
|
||||
#if defined(GLSLANG_WEB) && !defined(GLSLANG_WEB_DEVEL)
|
||||
void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) { addError(); }
|
||||
void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) { }
|
||||
void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) { addError(); }
|
||||
void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) { }
|
||||
#else
|
||||
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) = 0;
|
||||
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
|
|
@ -194,7 +134,6 @@ public:
|
|||
const char* szExtraInfoFormat, ...) = 0;
|
||||
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...) = 0;
|
||||
#endif
|
||||
|
||||
void addError() { ++numErrors; }
|
||||
int getNumErrors() const { return numErrors; }
|
||||
|
|
|
|||
|
|
@ -736,7 +736,6 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||
parseContext.setCurrentLine(lineRes);
|
||||
|
||||
if (token != '\n') {
|
||||
#ifndef GLSLANG_WEB
|
||||
if (token == PpAtomConstString) {
|
||||
parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line");
|
||||
// We need to save a copy of the string instead of pointing
|
||||
|
|
@ -746,9 +745,7 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||
parseContext.setCurrentSourceName(sourceName);
|
||||
hasFile = true;
|
||||
token = scanToken(ppToken);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
token = eval(token, MIN_PRECEDENCE, false, fileRes, fileErr, ppToken);
|
||||
if (! fileErr) {
|
||||
parseContext.setCurrentString(fileRes);
|
||||
|
|
@ -974,7 +971,6 @@ int TPpContext::readCPPline(TPpToken* ppToken)
|
|||
case PpAtomLine:
|
||||
token = CPPline(ppToken);
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case PpAtomInclude:
|
||||
if(!parseContext.isReadingHLSL()) {
|
||||
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
|
||||
|
|
@ -984,7 +980,6 @@ int TPpContext::readCPPline(TPpToken* ppToken)
|
|||
case PpAtomPragma:
|
||||
token = CPPpragma(ppToken);
|
||||
break;
|
||||
#endif
|
||||
case PpAtomUndef:
|
||||
token = CPPundef(ppToken);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||
// Suffix:
|
||||
bool isDouble = false;
|
||||
bool isFloat16 = false;
|
||||
#ifndef GLSLANG_WEB
|
||||
if (ch == 'l' || ch == 'L') {
|
||||
if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
|
||||
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
||||
|
|
@ -300,14 +299,11 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||
isFloat16 = true;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (ch == 'f' || ch == 'F') {
|
||||
#ifndef GLSLANG_WEB
|
||||
if (ifdepth == 0)
|
||||
parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix");
|
||||
if (ifdepth == 0 && !parseContext.relaxedErrors())
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
||||
#endif
|
||||
if (ifdepth == 0 && !hasDecimalOrExponent)
|
||||
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||
saveName(ch);
|
||||
|
|
@ -583,7 +579,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
ppToken->name[len++] = (char)ch;
|
||||
isUnsigned = true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
int nextCh = getch();
|
||||
if (nextCh == 'l' || nextCh == 'L') {
|
||||
if (len < MaxTokenLength)
|
||||
|
|
@ -609,7 +604,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
isInt16 = true;
|
||||
#endif
|
||||
} else
|
||||
ungetch();
|
||||
ppToken->name[len] = '\0';
|
||||
|
|
@ -687,7 +681,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
ppToken->name[len++] = (char)ch;
|
||||
isUnsigned = true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
int nextCh = getch();
|
||||
if (nextCh == 'l' || nextCh == 'L') {
|
||||
if (len < MaxTokenLength)
|
||||
|
|
@ -713,7 +706,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
isInt16 = true;
|
||||
#endif
|
||||
} else {
|
||||
ungetch();
|
||||
}
|
||||
|
|
@ -795,7 +787,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
ppToken->name[len++] = (char)ch;
|
||||
isUnsigned = true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
int nextCh = getch();
|
||||
if (nextCh == 'l' || nextCh == 'L') {
|
||||
if (len < MaxTokenLength)
|
||||
|
|
@ -821,7 +812,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
isInt16 = true;
|
||||
#endif
|
||||
} else
|
||||
ungetch();
|
||||
ppToken->name[len] = '\0';
|
||||
|
|
@ -884,7 +874,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
ppToken->name[len++] = (char)ch;
|
||||
isUnsigned = true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
int nextCh = getch();
|
||||
if (nextCh == 'l' || nextCh == 'L') {
|
||||
if (len < MaxTokenLength)
|
||||
|
|
@ -910,7 +899,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||
if (len < MaxTokenLength)
|
||||
ppToken->name[len++] = (char)ch;
|
||||
isInt16 = true;
|
||||
#endif
|
||||
} else
|
||||
ungetch();
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||
int atom = stream[currentPos++].get(*ppToken);
|
||||
ppToken->loc = parseContext.getCurrentLoc();
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Check for ##, unless the current # is the last character
|
||||
if (atom == '#') {
|
||||
if (peekToken('#')) {
|
||||
|
|
@ -123,7 +122,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||
atom = PpAtomPaste;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return atom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
// propagate the 'noContraction' qualifier.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#include "propagateNoContraction.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
|
@ -866,5 +864,3 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#include "../Include/Common.h"
|
||||
#include "reflection.h"
|
||||
#include "LiveTraverser.h"
|
||||
|
|
@ -1270,5 +1268,3 @@ void TReflection::dump()
|
|||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#if !defined(GLSLANG_WEB)
|
||||
|
||||
#ifndef _REFLECTION_INCLUDED
|
||||
#define _REFLECTION_INCLUDED
|
||||
|
||||
|
|
@ -219,5 +217,3 @@ protected:
|
|||
} // end namespace glslang
|
||||
|
||||
#endif // _REFLECTION_INCLUDED
|
||||
|
||||
#endif // !GLSLANG_WEB
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue