Merge pull request #2664 from mbechard/master

only declare compatibility gl_ variables in compatibility mode
This commit is contained in:
Greg Fischer 2021-06-17 14:49:02 -06:00 committed by GitHub
commit e74b35f3f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 62 additions and 67 deletions

View file

@ -483,7 +483,8 @@ void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */,
inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
{
return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && ARBCompatibility) || profile == ECompatibilityProfile);
return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && version == 140 && ARBCompatibility) ||
profile == ECompatibilityProfile);
}
// Construct TBuiltInParseables base class. This can be used for language-common constructs.
@ -7314,7 +7315,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents);
s.append(builtInConstant);
if (version < 150 || ARBCompatibility) {
// Moved from just being deprecated into compatibility profile only as of 4.20
if (version < 420 || profile == ECompatibilityProfile) {
snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats);
s.append(builtInConstant);
}