[glslang] Refine implicit array size interfaces. (#3074)
* [glslang] Refine implicit array size interfaces. Help to check builtin and other variables if across stages.
This commit is contained in:
parent
c6b3f279a7
commit
f9b760e6c7
14 changed files with 528 additions and 7 deletions
|
|
@ -608,6 +608,15 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
|
|||
#ifndef GLSLANG_WEB
|
||||
if (base->getType().isUnsizedArray()) {
|
||||
base->getWritableType().updateImplicitArraySize(indexValue + 1);
|
||||
base->getWritableType().setImplicitlySized(true);
|
||||
if (base->getQualifier().builtIn == EbvClipDistance &&
|
||||
indexValue >= resources.maxClipDistances) {
|
||||
error(loc, "gl_ClipDistance", "[", "array index out of range '%d'", indexValue);
|
||||
}
|
||||
else if (base->getQualifier().builtIn == EbvCullDistance &&
|
||||
indexValue >= resources.maxCullDistances) {
|
||||
error(loc, "gl_CullDistance", "[", "array index out of range '%d'", indexValue);
|
||||
}
|
||||
// For 2D per-view builtin arrays, update the inner dimension size in parent type
|
||||
if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) {
|
||||
TIntermBinary* binaryNode = base->getAsBinaryNode();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue