Web: Optional error management and error tightening.

Saves about 6.5K
This commit is contained in:
John Kessenich 2019-08-10 10:41:15 -06:00
parent fb4f2333da
commit d8834df992
10 changed files with 1144 additions and 1109 deletions

View file

@ -563,9 +563,8 @@ const char* StageName(EShLanguage stage)
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc)
{
if (profile & profileMask) {
bool okay = false;
if (minVersion > 0 && version >= minVersion)
okay = true;
bool okay = minVersion > 0 && version >= minVersion;
#ifndef GLSLANG_WEB
for (int i = 0; i < numExtensions; ++i) {
switch (getExtensionBehavior(extensions[i])) {
case EBhWarn:
@ -578,7 +577,7 @@ 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, "");
}