The problem was only with arrays of samplers.
Fixed #2552
}\r
\r
layout(binding=0) writeonly uniform image1D badArray[];\r
+layout(binding = 74) uniform sampler2D u_sampler0[6];
0:? 'samp1D' ( uniform sampler1D)
0:? 'samp1Ds' ( uniform sampler1DShadow)
0:? 'badArray' (layout( binding=0) writeonly uniform unsized 1-element array of image1D)
+0:? 'u_sampler0' (layout( binding=74) uniform 6-element array of sampler2D)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
0:? 'samp1D' ( uniform sampler1D)
0:? 'samp1Ds' ( uniform sampler1DShadow)
0:? 'badArray' (layout( binding=0) writeonly uniform 1-element array of image1D)
+0:? 'u_sampler0' (layout( binding=74) uniform 6-element array of sampler2D)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
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
}
}