Fix off-by-1 bug in gl_MaxCombinedTextureImageUnits check
The problem was only with arrays of samplers. Fixed #2552
This commit is contained in:
parent
3839066ee4
commit
051fbbb69c
3 changed files with 6 additions and 7 deletions
|
|
@ -5913,16 +5913,12 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
|||
if (type.getBasicType() == EbtSampler) {
|
||||
int lastBinding = qualifier.layoutBinding;
|
||||
if (type.isArray()) {
|
||||
if (spvVersion.vulkan > 0)
|
||||
lastBinding += 1;
|
||||
else {
|
||||
if (spvVersion.vulkan == 0) {
|
||||
if (type.isSizedArray())
|
||||
lastBinding += type.getCumulativeArraySize();
|
||||
lastBinding += (type.getCumulativeArraySize() - 1);
|
||||
else {
|
||||
lastBinding += 1;
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.vulkan == 0)
|
||||
warn(loc, "assuming binding count of one for compile-time checking of binding numbers for unsized array", "[]", "");
|
||||
warn(loc, "assuming binding count of one for compile-time checking of binding numbers for unsized array", "[]", "");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue