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:
parent
a4a4d5e22c
commit
bbbcb5b2eb
6 changed files with 36 additions and 5 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue