glslang AEP: Full semantics for *_shader_io_blocks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31490 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -123,3 +123,62 @@ struct SA { float f[4]; };
|
||||
in SA inSA; // ERROR
|
||||
struct SS { float f; S s; };
|
||||
in SS inSS; // ERROR
|
||||
|
||||
#ifndef GL_EXT_shader_io_blocks
|
||||
#error GL_EXT_shader_io_blocks not defined
|
||||
#endif
|
||||
|
||||
#extension GL_EXT_shader_io_blocks : enable
|
||||
|
||||
out outbname { int a; } outbinst; // ERROR, not out block in fragment shader
|
||||
|
||||
in inbname {
|
||||
int a;
|
||||
vec4 v;
|
||||
struct { int b; } s; // ERROR, nested struct definition
|
||||
} inbinst;
|
||||
|
||||
in inbname2 {
|
||||
layout(location = 12) int aAnon;
|
||||
layout(location = 13) centroid in vec4 vAnon;
|
||||
};
|
||||
|
||||
in layout(location = 13) vec4 aliased; // ERROR, aliased
|
||||
|
||||
in inbname2 { // ERROR, reuse of block name
|
||||
int aAnon;
|
||||
centroid in vec4 vAnon;
|
||||
};
|
||||
|
||||
in badmember { // ERROR, aAnon already in global scope
|
||||
int aAnon;
|
||||
};
|
||||
|
||||
int inbname; // ERROR, redefinition of block name
|
||||
|
||||
vec4 vAnon; // ERROR, anon in global scope; redefinition
|
||||
|
||||
in arrayed {
|
||||
float f;
|
||||
} arrayedInst[4];
|
||||
|
||||
void fooIO()
|
||||
{
|
||||
vec4 v = inbinst.v + vAnon;
|
||||
v *= arrayedInst[2].f;
|
||||
v *= arrayedInst[i].f; // ERROR, not constant
|
||||
}
|
||||
|
||||
in vec4 gl_FragCoord;
|
||||
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES
|
||||
|
||||
layout(early_fragment_tests) in;
|
||||
out float gl_FragDepth;
|
||||
layout(depth_any) out float gl_FragDepth; // ERROR, non-ES
|
||||
|
||||
void foo_IO()
|
||||
{
|
||||
gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared
|
||||
}
|
||||
|
||||
out float gl_FragDepth;
|
||||
|
||||
@@ -84,3 +84,42 @@ out SS outSS; // ERROR
|
||||
|
||||
layout(std430) uniform U430 { int a; } U430i; // ERROR
|
||||
layout(std430) buffer B430 { int a; } B430i;
|
||||
|
||||
#ifndef GL_OES_shader_io_blocks
|
||||
#error GL_OES_shader_io_blocks not defined
|
||||
#endif
|
||||
|
||||
#extension GL_OES_shader_io_blocks : enable
|
||||
|
||||
out outbname {
|
||||
int a;
|
||||
out vec4 v;
|
||||
highp sampler2D s; // ERROR, opaque type
|
||||
} outbinst;
|
||||
|
||||
out outbname2 {
|
||||
layout(location = 12) int aAnon;
|
||||
layout(location = 13) vec4 vAnon;
|
||||
};
|
||||
|
||||
layout(location = 12) out highp int aliased; // ERROR, aliasing location
|
||||
|
||||
in inbname { int a; } inbinst; // ERROR, no in block in vertex shader
|
||||
|
||||
out gl_PerVertex { // ERROR, has extra member
|
||||
highp vec4 gl_Position;
|
||||
highp vec4 t;
|
||||
};
|
||||
|
||||
void foo_IO()
|
||||
{
|
||||
int sum = gl_VertexID +
|
||||
gl_InstanceID;
|
||||
gl_Position = vec4(1.0);
|
||||
gl_PointSize = 2.0; // ERROR, removed by redeclaration
|
||||
}
|
||||
|
||||
out gl_PerVertex { // ERROR, already used and already redeclared
|
||||
highp vec4 gl_Position;
|
||||
highp vec4 t;
|
||||
};
|
||||
|
||||
@@ -41,11 +41,28 @@ ERROR: 0:120: 'fragment-shader array-of-struct input' : not supported with this
|
||||
ERROR: 0:121: 'fragment-shader array-of-struct input' : not supported with this profile: es
|
||||
ERROR: 0:123: 'fragment-shader struct input containing an array' : not supported with this profile: es
|
||||
ERROR: 0:125: 'fragment-shader struct input containing structure' : not supported with this profile: es
|
||||
ERROR: 41 compilation errors. No code generated.
|
||||
ERROR: 0:133: 'out' : cannot declare an output block in a fragment shader
|
||||
ERROR: 0:138: '' : cannot nest a structure definition inside a structure or block
|
||||
ERROR: 0:146: 'location' : overlapping use of location 13
|
||||
ERROR: 0:148: 'inbname2' : Cannot reuse block name within the same interface: in
|
||||
ERROR: 0:153: 'badmember' : nameless block contains a member that already has a name at global scope
|
||||
ERROR: 0:157: 'inbname' : redefinition
|
||||
ERROR: 0:159: 'vAnon' : redefinition
|
||||
ERROR: 0:169: 'variable indexing block array' : not supported with this profile: es
|
||||
ERROR: 0:173: 'origin_upper_left' : not supported with this profile: es
|
||||
ERROR: 0:173: 'pixel_center_integer' : not supported with this profile: es
|
||||
ERROR: 0:173: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
|
||||
ERROR: 0:177: 'depth layout qualifier' : not supported with this profile: es
|
||||
ERROR: 0:181: 'assign' : l-value required "gl_FragDepth" (can't modify gl_FragDepth if using early_fragment_tests)
|
||||
ERROR: 54 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 310
|
||||
Requested GL_EXT_shader_io_blocks
|
||||
gl_FragCoord pixel center is integer
|
||||
gl_FragCoord origin is upper left
|
||||
using early_fragment_tests
|
||||
using depth_any
|
||||
ERROR: node is still EOpNull!
|
||||
0:21 Function Definition: main( (global void)
|
||||
0:21 Function Parameters:
|
||||
@@ -259,6 +276,45 @@ ERROR: node is still EOpNull!
|
||||
0:107 'v2' (temp highp 2-component vector of int)
|
||||
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
|
||||
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
|
||||
0:165 Function Definition: fooIO( (global void)
|
||||
0:165 Function Parameters:
|
||||
0:167 Sequence
|
||||
0:167 Sequence
|
||||
0:167 move second child to first child (temp mediump 4-component vector of float)
|
||||
0:167 'v' (temp mediump 4-component vector of float)
|
||||
0:167 add (temp mediump 4-component vector of float)
|
||||
0:167 v: direct index for structure (in mediump 4-component vector of float)
|
||||
0:167 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
|
||||
0:167 Constant:
|
||||
0:167 1 (const int)
|
||||
0:167 vAnon: direct index for structure (layout(location=13 ) centroid in mediump 4-component vector of float)
|
||||
0:167 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
|
||||
0:167 Constant:
|
||||
0:167 1 (const uint)
|
||||
0:168 vector scale second child into first child (temp mediump 4-component vector of float)
|
||||
0:168 'v' (temp mediump 4-component vector of float)
|
||||
0:168 f: direct index for structure (in mediump float)
|
||||
0:168 direct index (temp block{in mediump float f})
|
||||
0:168 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:168 Constant:
|
||||
0:168 2 (const int)
|
||||
0:168 Constant:
|
||||
0:168 0 (const int)
|
||||
0:169 vector scale second child into first child (temp mediump 4-component vector of float)
|
||||
0:169 'v' (temp mediump 4-component vector of float)
|
||||
0:169 f: direct index for structure (in mediump float)
|
||||
0:169 indirect index (temp block{in mediump float f})
|
||||
0:169 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:169 'i' (uniform mediump int)
|
||||
0:169 Constant:
|
||||
0:169 0 (const int)
|
||||
0:179 Function Definition: foo_IO( (global void)
|
||||
0:179 Function Parameters:
|
||||
0:181 Sequence
|
||||
0:181 move second child to first child (temp highp float)
|
||||
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
0:181 Constant:
|
||||
0:181 0.200000
|
||||
0:? Linker Objects
|
||||
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
|
||||
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
|
||||
@@ -300,6 +356,13 @@ ERROR: node is still EOpNull!
|
||||
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
|
||||
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
|
||||
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
|
||||
0:? 'outbinst' (out block{out mediump int a})
|
||||
0:? 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
|
||||
0:? 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout(location=13 ) smooth in mediump 4-component vector of float)
|
||||
0:? 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
@@ -307,7 +370,11 @@ Linked fragment stage:
|
||||
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers
|
||||
|
||||
Shader version: 310
|
||||
Requested GL_EXT_shader_io_blocks
|
||||
gl_FragCoord pixel center is integer
|
||||
gl_FragCoord origin is upper left
|
||||
using early_fragment_tests
|
||||
using depth_any
|
||||
ERROR: node is still EOpNull!
|
||||
0:21 Function Definition: main( (global void)
|
||||
0:21 Function Parameters:
|
||||
@@ -521,6 +588,45 @@ ERROR: node is still EOpNull!
|
||||
0:107 'v2' (temp highp 2-component vector of int)
|
||||
0:107 Function Call: imageSize(I21; (global highp 2-component vector of int)
|
||||
0:107 'i2Dqualified' (layout(binding=6 ) coherent volatile restrict uniform highp image2D)
|
||||
0:165 Function Definition: fooIO( (global void)
|
||||
0:165 Function Parameters:
|
||||
0:167 Sequence
|
||||
0:167 Sequence
|
||||
0:167 move second child to first child (temp mediump 4-component vector of float)
|
||||
0:167 'v' (temp mediump 4-component vector of float)
|
||||
0:167 add (temp mediump 4-component vector of float)
|
||||
0:167 v: direct index for structure (in mediump 4-component vector of float)
|
||||
0:167 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
|
||||
0:167 Constant:
|
||||
0:167 1 (const int)
|
||||
0:167 vAnon: direct index for structure (layout(location=13 ) centroid in mediump 4-component vector of float)
|
||||
0:167 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
|
||||
0:167 Constant:
|
||||
0:167 1 (const uint)
|
||||
0:168 vector scale second child into first child (temp mediump 4-component vector of float)
|
||||
0:168 'v' (temp mediump 4-component vector of float)
|
||||
0:168 f: direct index for structure (in mediump float)
|
||||
0:168 direct index (temp block{in mediump float f})
|
||||
0:168 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:168 Constant:
|
||||
0:168 2 (const int)
|
||||
0:168 Constant:
|
||||
0:168 0 (const int)
|
||||
0:169 vector scale second child into first child (temp mediump 4-component vector of float)
|
||||
0:169 'v' (temp mediump 4-component vector of float)
|
||||
0:169 f: direct index for structure (in mediump float)
|
||||
0:169 indirect index (temp block{in mediump float f})
|
||||
0:169 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:169 'i' (uniform mediump int)
|
||||
0:169 Constant:
|
||||
0:169 0 (const int)
|
||||
0:179 Function Definition: foo_IO( (global void)
|
||||
0:179 Function Parameters:
|
||||
0:181 Sequence
|
||||
0:181 move second child to first child (temp highp float)
|
||||
0:181 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
0:181 Constant:
|
||||
0:181 0.200000
|
||||
0:? Linker Objects
|
||||
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
|
||||
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
|
||||
@@ -562,4 +668,11 @@ ERROR: node is still EOpNull!
|
||||
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})
|
||||
0:? 'inSA' (smooth in structure{global 4-element array of mediump float f})
|
||||
0:? 'inSS' (smooth in structure{global mediump float f, global structure{global mediump float f} s})
|
||||
0:? 'outbinst' (out block{out mediump int a})
|
||||
0:? 'inbinst' (in block{in mediump int a, in mediump 4-component vector of float v, in structure{global mediump int b} s})
|
||||
0:? 'anon@0' (in block{layout(location=12 ) in mediump int aAnon, layout(location=13 ) centroid in mediump 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout(location=13 ) smooth in mediump 4-component vector of float)
|
||||
0:? 'arrayedInst' (in 4-element array of block{in mediump float f})
|
||||
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
0:? 'gl_FragDepth' (gl_FragDepth highp float FragDepth)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
310.geom
|
||||
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
|
||||
WARNING: 0:3: '#extension' : extension is only partially supported: GL_EXT_geometry_shader
|
||||
WARNING: 0:3: '#extension' : extension is only partially supported: GL_EXT_shader_io_blocks
|
||||
ERROR: 0:21: 'fromVertex' : block instance name redefinition
|
||||
ERROR: 0:25: 'fromVertex' : redefinition
|
||||
ERROR: 0:27: 'fooC' : block instance name redefinition
|
||||
|
||||
@@ -15,10 +15,18 @@ ERROR: 0:79: 'vertex-shader array-of-struct output' : not supported with this pr
|
||||
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: 0:85: 'std430 on a uniform block' : not supported with this profile: es
|
||||
ERROR: 15 compilation errors. No code generated.
|
||||
ERROR: 0:97: 's' : member of block cannot be a sampler type
|
||||
ERROR: 0:105: 'location' : overlapping use of location 12
|
||||
ERROR: 0:107: 'in' : cannot declare an input block in a vertex shader
|
||||
ERROR: 0:109: 'gl_PerVertex' : block redeclaration has extra members
|
||||
ERROR: 0:119: 'gl_PointSize' : member of nameless block was not redeclared
|
||||
ERROR: 0:119: 'assign' : cannot convert from 'const float' to 'gl_PointSize highp void PointSize'
|
||||
ERROR: 0:122: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
|
||||
ERROR: 22 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 310
|
||||
Requested GL_OES_shader_io_blocks
|
||||
ERROR: node is still EOpNull!
|
||||
0:12 Function Definition: main( (global void)
|
||||
0:12 Function Parameters:
|
||||
@@ -166,6 +174,29 @@ ERROR: node is still EOpNull!
|
||||
0:66 2 (const int)
|
||||
0:67 Constant:
|
||||
0:67 0.000000
|
||||
0:114 Function Definition: foo_IO( (global void)
|
||||
0:114 Function Parameters:
|
||||
0:116 Sequence
|
||||
0:116 Sequence
|
||||
0:116 move second child to first child (temp highp int)
|
||||
0:116 'sum' (temp highp int)
|
||||
0:116 add (temp highp int)
|
||||
0:116 'gl_VertexID' (gl_VertexId highp int VertexId)
|
||||
0:117 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
|
||||
0:118 move second child to first child (temp highp 4-component vector of float)
|
||||
0:118 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position)
|
||||
0:118 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:118 Constant:
|
||||
0:118 0 (const uint)
|
||||
0:118 Constant:
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:119 gl_PointSize: direct index for structure (gl_PointSize highp void PointSize)
|
||||
0:119 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:119 Constant:
|
||||
0:119 1 (const uint)
|
||||
0:? Linker Objects
|
||||
0:? 's' (shared highp 4-component vector of float)
|
||||
0:? 'v' (buffer highp 4-component vector of float)
|
||||
@@ -188,6 +219,11 @@ ERROR: node is still EOpNull!
|
||||
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:? 'outbinst' (out block{out highp int a, out highp 4-component vector of float v, out highp sampler2D s})
|
||||
0:? 'anon@0' (out block{layout(location=12 ) out highp int aAnon, layout(location=13 ) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout(location=12 ) smooth out highp int)
|
||||
0:? 'inbinst' (in block{in highp int a})
|
||||
0:? 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
|
||||
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
|
||||
|
||||
@@ -196,6 +232,7 @@ Linked vertex stage:
|
||||
|
||||
|
||||
Shader version: 310
|
||||
Requested GL_OES_shader_io_blocks
|
||||
ERROR: node is still EOpNull!
|
||||
0:12 Function Definition: main( (global void)
|
||||
0:12 Function Parameters:
|
||||
@@ -343,6 +380,29 @@ ERROR: node is still EOpNull!
|
||||
0:66 2 (const int)
|
||||
0:67 Constant:
|
||||
0:67 0.000000
|
||||
0:114 Function Definition: foo_IO( (global void)
|
||||
0:114 Function Parameters:
|
||||
0:116 Sequence
|
||||
0:116 Sequence
|
||||
0:116 move second child to first child (temp highp int)
|
||||
0:116 'sum' (temp highp int)
|
||||
0:116 add (temp highp int)
|
||||
0:116 'gl_VertexID' (gl_VertexId highp int VertexId)
|
||||
0:117 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
|
||||
0:118 move second child to first child (temp highp 4-component vector of float)
|
||||
0:118 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position)
|
||||
0:118 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:118 Constant:
|
||||
0:118 0 (const uint)
|
||||
0:118 Constant:
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:119 gl_PointSize: direct index for structure (gl_PointSize highp void PointSize)
|
||||
0:119 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:119 Constant:
|
||||
0:119 1 (const uint)
|
||||
0:? Linker Objects
|
||||
0:? 's' (shared highp 4-component vector of float)
|
||||
0:? 'v' (buffer highp 4-component vector of float)
|
||||
@@ -365,6 +425,11 @@ ERROR: node is still EOpNull!
|
||||
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:? 'outbinst' (out block{out highp int a, out highp 4-component vector of float v, out highp sampler2D s})
|
||||
0:? 'anon@0' (out block{layout(location=12 ) out highp int aAnon, layout(location=13 ) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout(location=12 ) smooth out highp int)
|
||||
0:? 'inbinst' (in block{in highp int a})
|
||||
0:? 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'gl_VertexID' (gl_VertexId highp int VertexId)
|
||||
0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user