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:
dan sinclair 2023-07-28 13:49:10 -04:00 committed by GitHub
parent c8c669fc2a
commit d291b15911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 49 additions and 1540 deletions

View file

@ -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);