diff --git a/Test/300.vert b/Test/300.vert index 5abf450846aed75f54c9731948b009384d8ded84..6270c1d51cc95153bbb559a2ee5690c89e920a89 100644 --- a/Test/300.vert +++ b/Test/300.vert @@ -169,6 +169,8 @@ layout(std140) Binst; // ERROR layout(std140) Bblock; // ERROR layout(std140) Bfoo; // ERROR +layout(std430) uniform B430 { int a; } B430i; // ERROR + struct SNA { int a[]; // ERROR }; diff --git a/Test/310.frag b/Test/310.frag index c1ccaaad3bd7ebd30be773aa28fd2ae2c9000c02..4c468ff7672cf1c01b6e853060823356b7adaaee 100644 --- a/Test/310.frag +++ b/Test/310.frag @@ -82,7 +82,7 @@ layout(location = 40) out vec4 bigout1; // ERROR, too big layout(location = 40) out vec4 bigout2; // ERROR, overlap layout(location = -2) out vec4 neg; // ERROR, negative -layout(std430) uniform b430 { +layout(std430) buffer b430 { int i; } b430i; diff --git a/Test/310.vert b/Test/310.vert index 326a4ccf2d1597b0854ed881613cdf0eae09b8ba..8e08fa4fa3fbde59bec7373b3090de2afc4c485a 100644 --- a/Test/310.vert +++ b/Test/310.vert @@ -81,3 +81,6 @@ struct SA { float f[4]; }; out SA outSA; // ERROR struct SS { float f; S s; }; out SS outSS; // ERROR + +layout(std430) uniform U430 { int a; } U430i; // ERROR +layout(std430) buffer B430 { int a; } B430i; diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out index a34dc0be1b2da3e0aaab24e18b323b8f8c36ee14..b75c4895a27624c07e7e34a3e9718c56abb82e71 100644 --- a/Test/baseResults/300.vert.out +++ b/Test/baseResults/300.vert.out @@ -38,8 +38,10 @@ ERROR: 0:149: 'float' : cannot apply precision statement to this type; use 'floa ERROR: 0:168: 'Binst' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable ERROR: 0:169: 'Bblock' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable ERROR: 0:170: 'Bfoo' : cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable -ERROR: 0:173: '' : array size required -ERROR: 40 compilation errors. No code generated. +ERROR: 0:172: 'std430' : not supported for this version or the enabled extensions +ERROR: 0:172: 'std430 on a uniform block' : not supported with this profile: es +ERROR: 0:175: '' : array size required +ERROR: 42 compilation errors. No code generated. Shader version: 300 @@ -293,6 +295,7 @@ ERROR: node is still EOpNull! 0:? 'ssss' (smooth out structure{global highp float f}) 0:? 'Binst' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform highp int a}) 0:? 'Bfoo' (global highp int) +0:? 'B430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) @@ -551,6 +554,7 @@ ERROR: node is still EOpNull! 0:? 'ssss' (smooth out structure{global highp float f}) 0:? 'Binst' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform highp int a}) 0:? 'Bfoo' (global highp int) +0:? 'B430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out index b9ec0d394853b12aaf0a06550baa25fc0d1225e8..91ff06790d218fcd5baf08bd1fb289d8f2d1f47a 100644 --- a/Test/baseResults/310.frag.out +++ b/Test/baseResults/310.frag.out @@ -283,7 +283,7 @@ ERROR: node is still EOpNull! 0:? 'bigout1' (layout(location=40 ) out mediump 4-component vector of float) 0:? 'bigout2' (layout(location=40 ) out mediump 4-component vector of float) 0:? 'neg' (out mediump 4-component vector of float) -0:? 'b430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform mediump int i}) +0:? 'b430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer mediump int i}) 0:? 'bshari' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump int i}) 0:? 'smoothIn' (smooth in mediump 4-component vector of float) 0:? 'flatIn' (flat in mediump int) @@ -545,7 +545,7 @@ ERROR: node is still EOpNull! 0:? 'bigout1' (layout(location=40 ) out mediump 4-component vector of float) 0:? 'bigout2' (layout(location=40 ) out mediump 4-component vector of float) 0:? 'neg' (out mediump 4-component vector of float) -0:? 'b430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform mediump int i}) +0:? 'b430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer mediump int i}) 0:? 'bshari' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump int i}) 0:? 'smoothIn' (smooth in mediump 4-component vector of float) 0:? 'flatIn' (flat in mediump int) diff --git a/Test/baseResults/310.vert.out b/Test/baseResults/310.vert.out index 8d9575b9901181289491ffdbd89f12e2c835f21d..2b5f995fddf54b098d1c37d85842c1128da6b1b1 100644 --- a/Test/baseResults/310.vert.out +++ b/Test/baseResults/310.vert.out @@ -14,7 +14,8 @@ ERROR: 0:78: 'vertex-shader array-of-struct output' : not supported with this pr ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this profile: es ERROR: 0:81: 'vertex-shader struct output containing an array' : not supported with this profile: es ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported with this profile: es -ERROR: 14 compilation errors. No code generated. +ERROR: 0:85: 'std430 on a uniform block' : not supported with this profile: es +ERROR: 15 compilation errors. No code generated. Shader version: 310 @@ -185,6 +186,8 @@ ERROR: node is still EOpNull! 0:? 'outsa' (smooth out 4-element array of structure{global highp float f}) 0:? 'outSA' (smooth out structure{global 4-element array of highp float f}) 0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s}) +0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a}) +0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) @@ -360,6 +363,8 @@ ERROR: node is still EOpNull! 0:? 'outsa' (smooth out 4-element array of structure{global highp float f}) 0:? 'outSA' (smooth out structure{global 4-element array of highp float f}) 0:? 'outSS' (smooth out structure{global highp float f, global structure{global highp float f} s}) +0:? 'U430i' (layout(column_major std430 ) uniform block{layout(column_major std430 offset=0 ) uniform highp int a}) +0:? 'B430i' (layout(column_major std430 ) buffer block{layout(column_major std430 offset=0 ) buffer highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 44239aa08914e2aa296d179ac2c146dd7bb62de4..cfe64ef4d031664ab03920d0730dcb4e022d4350 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -4493,6 +4493,8 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr case EvqUniform: profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); profileRequires(loc, ENoProfile, 140, nullptr, "uniform block"); + if (currentBlockQualifier.layoutPacking == ElpStd430) + requireProfile(loc, ~EEsProfile, "std430 on a uniform block"); break; case EvqBuffer: requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block");