Front-end: allow max size built-in arrays like gl_ClipDistance
Fixed off-by-one error with gl_MaxClipDistances and similar limits.
This commit is contained in:
@@ -3824,7 +3824,7 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi
|
||||
limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistance array size");
|
||||
}
|
||||
|
||||
// See if the provided value is less than the symbol indicated by limit,
|
||||
// See if the provided value is less than or equal to the symbol indicated by limit,
|
||||
// which should be a constant in the symbol table.
|
||||
void TParseContext::limitCheck(const TSourceLoc& loc, int value, const char* limit, const char* feature)
|
||||
{
|
||||
@@ -3832,8 +3832,8 @@ void TParseContext::limitCheck(const TSourceLoc& loc, int value, const char* lim
|
||||
assert(symbol->getAsVariable());
|
||||
const TConstUnionArray& constArray = symbol->getAsVariable()->getConstArray();
|
||||
assert(! constArray.empty());
|
||||
if (value >= constArray[0].getIConst())
|
||||
error(loc, "must be less than", feature, "%s (%d)", limit, constArray[0].getIConst());
|
||||
if (value > constArray[0].getIConst())
|
||||
error(loc, "must be less than or equal to", feature, "%s (%d)", limit, constArray[0].getIConst());
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user