Fix #1065: don't validate Vulkan binding numbers.

To handle sparse assignments, don't check maxCombinedTextureImageUnits.
This commit is contained in:
John Kessenich 2017-11-01 22:33:45 -06:00
parent 715c353a15
commit ac51602455
2 changed files with 4 additions and 1 deletions

View File

@ -58,3 +58,6 @@ out ban1 { // ERROR, only outer dimension
out ban2 { out ban2 {
float f; float f;
} bai2[arraySize][2]; } bai2[arraySize][2];
layout(binding = 3000) uniform sampler2D s3000;
layout(binding = 3001) uniform b3001 { int a; };

View File

@ -4614,7 +4614,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
} else } else
lastBinding += type.getCumulativeArraySize(); lastBinding += type.getCumulativeArraySize();
} }
if (lastBinding >= resources.maxCombinedTextureImageUnits) if (spvVersion.vulkan == 0 && lastBinding >= resources.maxCombinedTextureImageUnits)
error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : ""); error(loc, "sampler binding not less than gl_MaxCombinedTextureImageUnits", "binding", type.isArray() ? "(using array)" : "");
} }
if (type.getBasicType() == EbtAtomicUint) { if (type.getBasicType() == EbtAtomicUint) {