Fix #1065: don't validate Vulkan binding numbers.
authorJohn Kessenich <cepheus@frii.com>
Thu, 2 Nov 2017 04:33:45 +0000 (22:33 -0600)
committerJohn Kessenich <cepheus@frii.com>
Thu, 2 Nov 2017 04:37:24 +0000 (22:37 -0600)
To handle sparse assignments, don't check maxCombinedTextureImageUnits.

Test/vulkan.vert
glslang/MachineIndependent/ParseHelper.cpp

index a6dc8ad..e670e95 100644 (file)
@@ -58,3 +58,6 @@ out ban1 {                              // ERROR, only outer dimension
 out ban2 {\r
     float f;\r
 } bai2[arraySize][2];\r
+\r
+layout(binding = 3000) uniform sampler2D s3000;\r
+layout(binding = 3001) uniform b3001 { int a; };\r
index a648b9b..bc1fa02 100644 (file)
@@ -4614,7 +4614,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
                 } else
                     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)" : "");
         }
         if (type.getBasicType() == EbtAtomicUint) {