diff --git a/Test/420.vert b/Test/420.vert index 49035ea470fade93a591f1756c44aa5a1e07b7a5..ab28140e584295eaef95c2bf66ce38e244c06d78 100644 --- a/Test/420.vert +++ b/Test/420.vert @@ -156,4 +156,6 @@ void qlod() levels = textureQueryLevels(samp1D); // ERROR, not until 430 levels = textureQueryLevels(samp1Ds); // ERROR, not until 430 -} \ No newline at end of file +} + +layout(binding=0) writeonly uniform image1D badArray[]; diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index 0f5110cbd872f513ae9038026144f4127697734d..a234970c588e164bf4d0e5121299294d9ad1d06e 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -51,6 +51,7 @@ ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:157: 'assign' : cannot convert from 'const float' to 'temp int' ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:158: 'assign' : cannot convert from 'const float' to 'temp int' +WARNING: 0:161: '[]' : assuming array size of one for compile-time checking of binding numbers for implicitly-sized array ERROR: 50 compilation errors. No code generated. @@ -299,6 +300,7 @@ ERROR: node is still EOpNull! 0:? 'offcheckI' (layout(column_major shared ) uniform block{layout(column_major shared offset=16 ) uniform int foo}) 0:? 'samp1D' (uniform sampler1D) 0:? 'samp1Ds' (uniform sampler1DShadow) +0:? 'badArray' (layout(binding=0 ) writeonly uniform implicitly-sized array of image1D) 0:? 'gl_VertexID' (gl_VertexId int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId int InstanceId) @@ -551,6 +553,7 @@ ERROR: node is still EOpNull! 0:? 'offcheckI' (layout(column_major shared ) uniform block{layout(column_major shared offset=16 ) uniform int foo}) 0:? 'samp1D' (uniform sampler1D) 0:? 'samp1Ds' (uniform sampler1DShadow) +0:? 'badArray' (layout(binding=0 ) writeonly uniform 1-element array of image1D) 0:? 'gl_VertexID' (gl_VertexId int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId int InstanceId) diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 55f4527496cd6ed6d5c4811cd38520cca71205af..c3344c1ca64c7cbaa464991ec63b264a9bcfb7da 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "SPIRV99.1351" +#define GLSLANG_REVISION "SPIRV99.1353" #define GLSLANG_DATE "27-Jul-2016" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 274f919c9d9276e17a4067ed9ccc41ba0675ede9..173969a0478035736b2024684b7a3433d10ba879 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -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)" : ""); } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index af21fbbabee685e92e2001dc11dc748e85ef3aac..0bc1d918ffa446abb568a5fd07d1faba5c0fcc41 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -651,7 +651,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ int size; if (qualifier.isUniformOrBuffer()) { - if (type.isArray()) + if (type.isExplicitlySizedArray()) size = type.getCumulativeArraySize(); else size = 1;