glslang ES reference: Don't allow std430 on uniform blocks (bug 14095).

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31484 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-06-12 22:09:25 +00:00
parent 453bb26ef5
commit 93930d6f9a
7 changed files with 22 additions and 6 deletions

View File

@ -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
};

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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");