Front-end: Fix issue #409, check for implicitly-sized binding arrays.
This commit is contained in:
parent
e15509e450
commit
414f735443
5 changed files with 15 additions and 5 deletions
|
|
@ -4544,8 +4544,13 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
|||
error(loc, "requires block, or sampler/image, or atomic-counter type", "binding", "");
|
||||
if (type.getBasicType() == EbtSampler) {
|
||||
int lastBinding = qualifier.layoutBinding;
|
||||
if (type.isArray())
|
||||
lastBinding += type.getCumulativeArraySize();
|
||||
if (type.isArray()) {
|
||||
if (type.isImplicitlySizedArray()) {
|
||||
lastBinding += 1;
|
||||
warn(loc, "assuming array size of one for compile-time checking of binding numbers for implicitly-sized array", "[]", "");
|
||||
} else
|
||||
lastBinding += type.getCumulativeArraySize();
|
||||
}
|
||||
if (lastBinding >= resources.maxCombinedTextureImageUnits)
|
||||
error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : "");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue