glslang AEP: Geometry shader features nominally working. (Full semantic check and turn on pending.) Also picked up partial tessellation shader interface, shader_io_blocks, and mirrored OES set of extensions functionality.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31487 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-06-14 21:36:44 +00:00
parent e5e0f6e37a
commit f6deb6203a
14 changed files with 499 additions and 367 deletions

View File

@ -223,3 +223,11 @@ void foomultio()
wo.values[2] = 3.4;
wo.value = 2; // ERROR, readonly
}
in inb { // ERROR
int a;
} inbi;
out outb { // ERROR
int a;
} outbi;

View File

@ -8,6 +8,8 @@ in fromVertex {
in vec3 color;
} fromV[];
in vec4 nonBlockUnsized[];
out toFragment {
out vec3 color;
} toF;
@ -34,37 +36,19 @@ void main()
EndStreamPrimitive(0); // ERROR
color = fromV[0].color;
gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
gl_ClipDistance[3] = // ERROR, no ClipDistance
gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance
gl_Position = gl_in[0].gl_Position;
gl_PointSize = gl_in[3].gl_PointSize;
gl_PrimitiveID = gl_PrimitiveIDIn;
gl_Layer = 2;
}
out vec4 ov0; // stream should be 0
layout(stream = 4) out vec4 ov4;
out vec4 o1v0; // stream should be 0
layout(stream = 4) out vec4 ov4; // ERROR, no streams
layout(stream = 3) uniform; // ERROR
layout(stream = 3) in; // ERROR
layout(stream = 3) uniform int ua; // ERROR
layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR
layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip"
layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip"
layout(stream = 3, triangle_strip) out;
out vec4 ov3; // stream should be 3
layout(stream = 6) out ooutb { vec4 a; } ouuaa6;
layout(stream = 6) out ooutb2 {
layout(stream = 6) vec4 a;
} ouua6;
layout(stream = 7) out ooutb3 {
layout(stream = 6) vec4 a; // ERROR
} ouua7;
out vec4 ov2s3; // stream should be 3
out ooutb { vec4 a; } ouuaa6;
layout(max_vertices = 200) out;
layout(max_vertices = 300) out; // ERROR, too big
@ -73,8 +57,8 @@ void foo(layout(max_vertices = 4) int a) // ERROR
ouuaa6.a = vec4(1.0);
}
layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive
layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive
layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive
layout(line_strip, points) out; // ERROR, changing output primitive
layout(triangle_strip) in; // ERROR, not an input primitive
layout(triangle_strip) uniform; // ERROR
layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
@ -92,10 +76,6 @@ layout(triangles) in; // ERROR, can't change it
layout(triangles_adjacency) in; // ERROR, can't change it
layout(invocations = 4) in; // ERROR, not until 4.0
in inbn {
layout(stream = 2) int a; // ERROR, stream on input
} inbi[];
in sameName {
int a15;
} insn[];
@ -108,36 +88,23 @@ uniform sameName {
bool b15;
};
float summ = gl_MaxVertexAttribs +
gl_MaxVertexUniformComponents +
gl_MaxVaryingFloats +
gl_MaxVaryingComponents +
gl_MaxVertexOutputComponents +
const int summ = gl_MaxVertexAttribs +
gl_MaxGeometryInputComponents +
gl_MaxGeometryOutputComponents +
gl_MaxFragmentInputComponents +
gl_MaxVertexTextureImageUnits +
gl_MaxCombinedTextureImageUnits +
gl_MaxTextureImageUnits +
gl_MaxFragmentUniformComponents +
gl_MaxDrawBuffers +
gl_MaxClipDistances +
gl_MaxGeometryImageUniforms +
gl_MaxGeometryTextureImageUnits +
gl_MaxGeometryOutputVertices +
gl_MaxGeometryTotalOutputComponents +
gl_MaxGeometryUniformComponents +
gl_MaxGeometryVaryingComponents;
gl_MaxGeometryAtomicCounters +
gl_MaxGeometryAtomicCounterBuffers +
gl_MaxVertexTextureImageUnits +
gl_MaxCombinedTextureImageUnits +
gl_MaxTextureImageUnits +
gl_MaxDrawBuffers;
void fooe1()
{
gl_ViewportIndex = gl_MaxViewports - 1;
gl_ViewportIndex; // ERROR, not in ES
gl_MaxViewports; // ERROR, not in ES
}
#extension GL_ARB_viewport_array : enable
void fooe2()
{
gl_ViewportIndex = gl_MaxViewports - 1;
}
out int gl_ViewportIndex;

View File

@ -77,3 +77,11 @@ void fooaoeu() {
int i = globalCoef; // ERROR, can't convert from double to int
double di = i;
}
in inb { // ERROR
int a;
} inbi;
out outb { // ERROR
int a;
} outbi;

View File

@ -11,7 +11,7 @@ ERROR: 0:21: 'bad1' : member of block cannot have a packing layout qualifier
ERROR: 0:22: 'bad2' : member of block cannot have a packing layout qualifier
ERROR: 0:23: 'bad3' : member of block cannot have a packing layout qualifier
ERROR: 0:31: 'T3' : nameless block contains a member that already has a name at global scope
ERROR: 0:38: 'output block' : not supported with this profile: es
ERROR: 0:38: 'vertex output block' : not supported for this version or the enabled extensions
ERROR: 0:42: 'location qualifier on output' : not supported in this stage: vertex
ERROR: 0:42: 'location qualifier on output' : not supported for this version or the enabled extensions
ERROR: 0:50: 'shared' : not supported for this version or the enabled extensions

View File

@ -72,7 +72,9 @@ ERROR: 0:207: 'constructor' : can't read from writeonly object: wo
ERROR: 0:208: '~' : can't read from writeonly object: wo
ERROR: 0:221: 'assign' : can't read from writeonly object: wo
ERROR: 0:222: '~' : can't read from writeonly object: wo
ERROR: 72 compilation errors. No code generated.
ERROR: 0:227: 'input block' : not supported in this stage: compute
ERROR: 0:231: 'output block' : not supported in this stage: compute
ERROR: 74 compilation errors. No code generated.
Shader version: 310
@ -479,6 +481,8 @@ ERROR: node is still EOpNull!
0:? 'badQ3' (layout(rgba16ui ) coherent volatile restrict uniform highp uimage2D)
0:? 'wo' (layout(column_major shared ) writeonly buffer block{layout(column_major shared ) buffer highp int value, layout(column_major shared ) buffer implicitly-sized array of highp float values})
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'inbi' (in block{in highp int a})
0:? 'outbi' (out block{out highp int a})
Linked compute stage:
@ -888,4 +892,6 @@ ERROR: node is still EOpNull!
0:? 'badQ3' (layout(rgba16ui ) coherent volatile restrict uniform highp uimage2D)
0:? 'wo' (layout(column_major shared ) writeonly buffer block{layout(column_major shared ) buffer highp int value, layout(column_major shared ) buffer implicitly-sized array of highp float values})
0:? 'multio' (layout(column_major shared ) buffer block{layout(column_major shared ) readonly buffer highp int value, layout(column_major shared ) writeonly buffer implicitly-sized array of highp float values})
0:? 'inbi' (in block{in highp int a})
0:? 'outbi' (out block{out highp int a})

View File

@ -1,299 +1,244 @@
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
ERROR: 0:7: '' : array size required
ERROR: 0:7: 'input block' : not supported with this profile: es
ERROR: 0:11: 'output block' : not supported with this profile: es
ERROR: 0:15: 'output block' : not supported with this profile: es
ERROR: 0:19: 'output block' : not supported with this profile: es
ERROR: 0:19: 'fromVertex' : block instance name redefinition
ERROR: 0:23: 'fromVertex' : redefinition
ERROR: 0:25: 'output block' : not supported with this profile: es
ERROR: 0:25: 'fooC' : block instance name redefinition
ERROR: 0:31: 'EmitVertex' : no matching overloaded function found
ERROR: 0:32: 'EndPrimitive' : no matching overloaded function found
ERROR: 0:33: 'EmitStreamVertex' : no matching overloaded function found
ERROR: 0:34: 'EndStreamPrimitive' : no matching overloaded function found
ERROR: 0:37: 'gl_ClipDistance' : undeclared identifier
ERROR: 0:37: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector
ERROR: 0:37: 'gl_in' : undeclared identifier
ERROR: 0:37: 'gl_in' : left of '[' is not of type array, matrix, or vector
ERROR: 0:37: 'scalar swizzle' : not supported with this profile: es
ERROR: 0:37: 'gl_ClipDistance' : illegal vector field selection
ERROR: 0:37: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:37: 'assign' : l-value required (can't modify a const)
ERROR: 0:38: 'gl_Position' : undeclared identifier
ERROR: 0:38: 'gl_in' : left of '[' is not of type array, matrix, or vector
ERROR: 0:38: 'scalar swizzle' : not supported with this profile: es
ERROR: 0:38: 'gl_Position' : illegal vector field selection
ERROR: 0:39: 'gl_PointSize' : undeclared identifier
ERROR: 0:39: 'gl_in' : left of '[' is not of type array, matrix, or vector
ERROR: 0:39: 'scalar swizzle' : not supported with this profile: es
ERROR: 0:39: 'gl_PointSize' : illegal vector field selection
ERROR: 0:40: 'gl_PrimitiveID' : undeclared identifier
ERROR: 0:40: 'gl_PrimitiveIDIn' : undeclared identifier
ERROR: 0:41: 'gl_Layer' : undeclared identifier
ERROR: 0:41: 'assign' : cannot convert from 'const int' to 'temp float'
ERROR: 0:48: 'stream' : can only be used on an output
ERROR: 0:49: 'stream' : can only be used on an output
ERROR: 0:50: 'stream' : can only be used on an output
ERROR: 0:51: 'stream' : can only be used on an output
ERROR: 0:51: 'stream' : can only be used on an output
ERROR: 0:57: 'output block' : not supported with this profile: es
ERROR: 0:59: 'output block' : not supported with this profile: es
ERROR: 0:63: 'output block' : not supported with this profile: es
ERROR: 0:64: 'stream' : member cannot contradict block
ERROR: 0:70: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices
ERROR: 0:70: 'max_vertices' : cannot change previously set layout value
ERROR: 0:71: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:76: 'points' : cannot change previously set output primitive
ERROR: 0:77: 'points' : cannot change previously set output primitive
ERROR: 0:78: 'triangle_strip' : cannot apply to input
ERROR: 0:79: 'triangle_strip' : cannot apply to: uniform
ERROR: 0:80: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:81: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:81: '' : array size required
ERROR: 0:82: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:82: 'output block' : not supported with this profile: es
ERROR: 0:84: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:85: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:86: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:83: 'output block' : not supported with this profile: es
ERROR: 0:89: 'lines' : cannot apply to 'out'
ERROR: 0:91: 'triangles' : cannot change previously set input primitive
ERROR: 0:92: 'triangles_adjacency' : cannot change previously set input primitive
ERROR: 0:95: '' : array size required
ERROR: 0:95: 'input block' : not supported with this profile: es
ERROR: 0:96: 'stream' : member cannot contradict block
ERROR: 0:96: 'stream' : can only be used on an output
ERROR: 0:99: '' : array size required
ERROR: 0:99: 'input block' : not supported with this profile: es
ERROR: 0:103: 'output block' : not supported with this profile: es
ERROR: 0:112: 'gl_MaxVertexUniformComponents' : undeclared identifier
ERROR: 0:111: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:113: 'gl_MaxVaryingFloats' : undeclared identifier
ERROR: 0:112: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:114: 'gl_MaxVaryingComponents' : undeclared identifier
ERROR: 0:113: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:115: 'gl_MaxVertexOutputComponents' : undeclared identifier
ERROR: 0:114: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:118: 'gl_MaxFragmentInputComponents' : undeclared identifier
ERROR: 0:117: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:122: 'gl_MaxFragmentUniformComponents' : undeclared identifier
ERROR: 0:121: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:124: 'gl_MaxClipDistances' : undeclared identifier
ERROR: 0:123: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:129: 'gl_MaxGeometryVaryingComponents' : undeclared identifier
ERROR: 0:128: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type 'const mediump int' and a right operand of type 'temp float' (or there is no acceptable conversion)
ERROR: 0:111: '=' : cannot convert from 'const mediump int' to 'global mediump float'
ERROR: 0:133: 'gl_ViewportIndex' : undeclared identifier
ERROR: 0:133: 'gl_MaxViewports' : undeclared identifier
ERROR: 0:133: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type 'temp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:140: 'gl_ViewportIndex' : undeclared identifier
ERROR: 0:140: 'gl_MaxViewports' : undeclared identifier
ERROR: 0:140: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type 'temp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 91 compilation errors. No code generated.
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
ERROR: 0:35: 'EmitStreamVertex' : no matching overloaded function found
ERROR: 0:36: 'EndStreamPrimitive' : no matching overloaded function found
ERROR: 0:39: 'gl_ClipDistance' : undeclared identifier
ERROR: 0:39: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector
ERROR: 0:40: 'gl_ClipDistance' : no such field in structure
ERROR: 0:40: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:39: 'assign' : l-value required (can't modify a const)
ERROR: 0:47: 'selecting output stream' : not supported with this profile: es
ERROR: 0:54: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices
ERROR: 0:54: 'max_vertices' : cannot change previously set layout value
ERROR: 0:55: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:60: 'points' : cannot change previously set output primitive
ERROR: 0:61: 'points' : cannot change previously set output primitive
ERROR: 0:62: 'triangle_strip' : cannot apply to input
ERROR: 0:63: 'triangle_strip' : cannot apply to: uniform
ERROR: 0:64: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:65: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:66: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:68: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:69: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:70: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:73: 'lines' : cannot apply to 'out'
ERROR: 0:75: 'triangles' : cannot change previously set input primitive
ERROR: 0:76: 'triangles_adjacency' : cannot change previously set input primitive
ERROR: 0:108: 'gl_ViewportIndex' : undeclared identifier
ERROR: 0:109: 'gl_MaxViewports' : undeclared identifier
ERROR: 29 compilation errors. No code generated.
Shader version: 310
Requested GL_ARB_viewport_array
Requested GL_EXT_geometry_shader
Requested GL_EXT_shader_io_blocks
invocations = 4
max_vertices = 200
input primitive = lines_adjacency
output primitive = triangle_strip
ERROR: node is still EOpNull!
0:29 Function Definition: main( (global void)
0:29 Function Parameters:
0:31 Sequence
0:31 Constant:
0:31 0.000000
0:32 Constant:
0:32 0.000000
0:33 Constant:
0:33 0.000000
0:34 Constant:
0:34 0.000000
0:36 move second child to first child (temp mediump 3-component vector of float)
0:36 color: direct index for structure (layout(stream=0 ) out mediump 3-component vector of float)
0:36 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:31 Function Definition: main( (global void)
0:31 Function Parameters:
0:33 Sequence
0:33 EmitVertex (global void)
0:34 EndPrimitive (global void)
0:35 Constant:
0:35 0.000000
0:36 Constant:
0:36 0 (const uint)
0:36 color: direct index for structure (in mediump 3-component vector of float)
0:36 direct index (temp block{in mediump 3-component vector of float color})
0:36 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:36 Constant:
0:36 0 (const int)
0:36 Constant:
0:36 0 (const int)
0:37 move second child to first child (temp float)
0:37 Constant:
0:37 0.000000
0:37 Constant:
0:37 0.000000
0:38 move second child to first child (temp float)
0:38 'gl_Position' (temp float)
0:36 0.000000
0:38 move second child to first child (temp mediump 3-component vector of float)
0:38 color: direct index for structure (layout(stream=0 ) out mediump 3-component vector of float)
0:38 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:38 Constant:
0:38 0.000000
0:38 0 (const uint)
0:38 color: direct index for structure (in mediump 3-component vector of float)
0:38 direct index (temp block{in mediump 3-component vector of float color})
0:38 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:38 Constant:
0:38 0 (const int)
0:38 Constant:
0:38 0 (const int)
0:39 move second child to first child (temp float)
0:39 'gl_PointSize' (temp float)
0:39 Constant:
0:39 0.000000
0:40 move second child to first child (temp float)
0:40 'gl_PrimitiveID' (temp float)
0:40 'gl_PrimitiveIDIn' (temp float)
0:41 'gl_Layer' (temp float)
0:71 Function Definition: foo(i1; (global void)
0:71 Function Parameters:
0:71 'a' (in highp int)
0:73 Sequence
0:73 move second child to first child (temp mediump 4-component vector of float)
0:73 a: direct index for structure (layout(stream=6 ) out mediump 4-component vector of float)
0:73 'ouuaa6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:73 Constant:
0:73 0 (const int)
0:73 Constant:
0:73 1.000000
0:73 1.000000
0:73 1.000000
0:73 1.000000
0:131 Function Definition: fooe1( (global void)
0:131 Function Parameters:
0:133 Sequence
0:133 move second child to first child (temp float)
0:133 'gl_ViewportIndex' (temp float)
0:133 'gl_MaxViewports' (temp float)
0:138 Function Definition: fooe2( (global void)
0:138 Function Parameters:
0:140 Sequence
0:140 move second child to first child (temp float)
0:140 'gl_ViewportIndex' (temp float)
0:140 'gl_MaxViewports' (temp float)
0:40 Constant:
0:40 0.000000
0:41 move second child to first child (temp highp 4-component vector of float)
0:41 gl_Position: direct index for structure (layout(stream=0 ) gl_Position highp 4-component vector of float Position)
0:41 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position highp 4-component vector of float Position gl_Position, layout(stream=0 ) gl_PointSize highp float PointSize gl_PointSize})
0:41 Constant:
0:41 0 (const uint)
0:41 gl_Position: direct index for structure (in highp 4-component vector of float Position)
0:41 direct index (temp block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:41 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0 (const int)
0:42 move second child to first child (temp highp float)
0:42 gl_PointSize: direct index for structure (layout(stream=0 ) gl_PointSize highp float PointSize)
0:42 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position highp 4-component vector of float Position gl_Position, layout(stream=0 ) gl_PointSize highp float PointSize gl_PointSize})
0:42 Constant:
0:42 1 (const uint)
0:42 gl_PointSize: direct index for structure (in highp float PointSize)
0:42 direct index (temp block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:42 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:42 Constant:
0:42 3 (const int)
0:42 Constant:
0:42 1 (const int)
0:43 move second child to first child (temp highp int)
0:43 'gl_PrimitiveID' (layout(stream=0 ) out highp int PrimitiveID)
0:43 'gl_PrimitiveIDIn' (in highp int PrimitiveID)
0:44 move second child to first child (temp highp int)
0:44 'gl_Layer' (layout(stream=0 ) out highp int Layer)
0:44 Constant:
0:44 2 (const int)
0:55 Function Definition: foo(i1; (global void)
0:55 Function Parameters:
0:55 'a' (in highp int)
0:57 Sequence
0:57 move second child to first child (temp mediump 4-component vector of float)
0:57 a: direct index for structure (layout(stream=0 ) out mediump 4-component vector of float)
0:57 'ouuaa6' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 4-component vector of float a})
0:57 Constant:
0:57 0 (const int)
0:57 Constant:
0:57 1.000000
0:57 1.000000
0:57 1.000000
0:57 1.000000
0:106 Function Definition: fooe1( (global void)
0:106 Function Parameters:
0:108 Sequence
0:108 'gl_ViewportIndex' (temp float)
0:109 'gl_MaxViewports' (temp float)
0:? Linker Objects
0:? 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:? 'nonBlockUnsized' (in 4-element array of mediump 4-component vector of float)
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:? 'ov0' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:? 'ov4' (layout(stream=4 ) out mediump 4-component vector of float)
0:? 'o1v0' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'ua' (layout(stream=3 ) uniform highp int)
0:? 'ibb' (layout(stream=3 column_major shared ) uniform block{layout(stream=3 column_major shared ) uniform highp int ua})
0:? 'ov3' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'ouuaa6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ouua6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ouua7' (layout(stream=7 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ov2s3' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'badv4' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'bad2v4' (in implicitly-sized array of mediump 4-component vector of float)
0:? 'anon@1' (layout(stream=3 ) out block{layout(stream=3 ) out highp int a})
0:? 'outbi' (layout(stream=3 ) out block{layout(stream=3 ) out highp int a, layout(stream=3 ) out highp int b, layout(stream=3 ) out highp int c})
0:? 'inbi' (in 4-element array of block{layout(stream=2 ) in highp int a})
0:? 'ouuaa6' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 4-component vector of float a})
0:? 'badv4' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'bad2v4' (in 4-element array of mediump 4-component vector of float)
0:? 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) out highp int a})
0:? 'outbi' (layout(stream=0 ) out block{layout(stream=0 ) out highp int a, layout(stream=0 ) out highp int b, layout(stream=0 ) out highp int c})
0:? 'insn' (in 4-element array of block{in highp int a15})
0:? 'anon@2' (layout(stream=3 ) out block{layout(stream=3 ) out mediump float f15})
0:? 'anon@2' (layout(stream=0 ) out block{layout(stream=0 ) out mediump float f15})
0:? 'anon@3' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'summ' (global mediump float)
0:? 'gl_ViewportIndex' (layout(stream=3 ) out highp int)
0:? 'summ' (const highp int)
0:? 2752 (const int)
Linked geometry stage:
Shader version: 310
Requested GL_ARB_viewport_array
Requested GL_EXT_geometry_shader
Requested GL_EXT_shader_io_blocks
invocations = 4
max_vertices = 200
input primitive = lines_adjacency
output primitive = triangle_strip
ERROR: node is still EOpNull!
0:29 Function Definition: main( (global void)
0:29 Function Parameters:
0:31 Sequence
0:31 Constant:
0:31 0.000000
0:32 Constant:
0:32 0.000000
0:33 Constant:
0:33 0.000000
0:34 Constant:
0:34 0.000000
0:36 move second child to first child (temp mediump 3-component vector of float)
0:36 color: direct index for structure (layout(stream=0 ) out mediump 3-component vector of float)
0:36 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:31 Function Definition: main( (global void)
0:31 Function Parameters:
0:33 Sequence
0:33 EmitVertex (global void)
0:34 EndPrimitive (global void)
0:35 Constant:
0:35 0.000000
0:36 Constant:
0:36 0 (const uint)
0:36 color: direct index for structure (in mediump 3-component vector of float)
0:36 direct index (temp block{in mediump 3-component vector of float color})
0:36 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:36 Constant:
0:36 0 (const int)
0:36 Constant:
0:36 0 (const int)
0:37 move second child to first child (temp float)
0:37 Constant:
0:37 0.000000
0:37 Constant:
0:37 0.000000
0:38 move second child to first child (temp float)
0:38 'gl_Position' (temp float)
0:36 0.000000
0:38 move second child to first child (temp mediump 3-component vector of float)
0:38 color: direct index for structure (layout(stream=0 ) out mediump 3-component vector of float)
0:38 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:38 Constant:
0:38 0.000000
0:38 0 (const uint)
0:38 color: direct index for structure (in mediump 3-component vector of float)
0:38 direct index (temp block{in mediump 3-component vector of float color})
0:38 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:38 Constant:
0:38 0 (const int)
0:38 Constant:
0:38 0 (const int)
0:39 move second child to first child (temp float)
0:39 'gl_PointSize' (temp float)
0:39 Constant:
0:39 0.000000
0:40 move second child to first child (temp float)
0:40 'gl_PrimitiveID' (temp float)
0:40 'gl_PrimitiveIDIn' (temp float)
0:41 'gl_Layer' (temp float)
0:71 Function Definition: foo(i1; (global void)
0:71 Function Parameters:
0:71 'a' (in highp int)
0:73 Sequence
0:73 move second child to first child (temp mediump 4-component vector of float)
0:73 a: direct index for structure (layout(stream=6 ) out mediump 4-component vector of float)
0:73 'ouuaa6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:73 Constant:
0:73 0 (const int)
0:73 Constant:
0:73 1.000000
0:73 1.000000
0:73 1.000000
0:73 1.000000
0:131 Function Definition: fooe1( (global void)
0:131 Function Parameters:
0:133 Sequence
0:133 move second child to first child (temp float)
0:133 'gl_ViewportIndex' (temp float)
0:133 'gl_MaxViewports' (temp float)
0:138 Function Definition: fooe2( (global void)
0:138 Function Parameters:
0:140 Sequence
0:140 move second child to first child (temp float)
0:140 'gl_ViewportIndex' (temp float)
0:140 'gl_MaxViewports' (temp float)
0:40 Constant:
0:40 0.000000
0:41 move second child to first child (temp highp 4-component vector of float)
0:41 gl_Position: direct index for structure (layout(stream=0 ) gl_Position highp 4-component vector of float Position)
0:41 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position highp 4-component vector of float Position gl_Position, layout(stream=0 ) gl_PointSize highp float PointSize gl_PointSize})
0:41 Constant:
0:41 0 (const uint)
0:41 gl_Position: direct index for structure (in highp 4-component vector of float Position)
0:41 direct index (temp block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:41 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0 (const int)
0:42 move second child to first child (temp highp float)
0:42 gl_PointSize: direct index for structure (layout(stream=0 ) gl_PointSize highp float PointSize)
0:42 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position highp 4-component vector of float Position gl_Position, layout(stream=0 ) gl_PointSize highp float PointSize gl_PointSize})
0:42 Constant:
0:42 1 (const uint)
0:42 gl_PointSize: direct index for structure (in highp float PointSize)
0:42 direct index (temp block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:42 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:42 Constant:
0:42 3 (const int)
0:42 Constant:
0:42 1 (const int)
0:43 move second child to first child (temp highp int)
0:43 'gl_PrimitiveID' (layout(stream=0 ) out highp int PrimitiveID)
0:43 'gl_PrimitiveIDIn' (in highp int PrimitiveID)
0:44 move second child to first child (temp highp int)
0:44 'gl_Layer' (layout(stream=0 ) out highp int Layer)
0:44 Constant:
0:44 2 (const int)
0:55 Function Definition: foo(i1; (global void)
0:55 Function Parameters:
0:55 'a' (in highp int)
0:57 Sequence
0:57 move second child to first child (temp mediump 4-component vector of float)
0:57 a: direct index for structure (layout(stream=0 ) out mediump 4-component vector of float)
0:57 'ouuaa6' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 4-component vector of float a})
0:57 Constant:
0:57 0 (const int)
0:57 Constant:
0:57 1.000000
0:57 1.000000
0:57 1.000000
0:57 1.000000
0:106 Function Definition: fooe1( (global void)
0:106 Function Parameters:
0:108 Sequence
0:108 'gl_ViewportIndex' (temp float)
0:109 'gl_MaxViewports' (temp float)
0:? Linker Objects
0:? 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
0:? 'nonBlockUnsized' (in 4-element array of mediump 4-component vector of float)
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 3-component vector of float color})
0:? 'ov0' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'gl_in' (in 4-element array of block{in highp 4-component vector of float Position gl_Position, in highp float PointSize gl_PointSize})
0:? 'ov4' (layout(stream=4 ) out mediump 4-component vector of float)
0:? 'o1v0' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'ua' (layout(stream=3 ) uniform highp int)
0:? 'ibb' (layout(stream=3 column_major shared ) uniform block{layout(stream=3 column_major shared ) uniform highp int ua})
0:? 'ov3' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'ouuaa6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ouua6' (layout(stream=6 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ouua7' (layout(stream=7 ) out block{layout(stream=6 ) out mediump 4-component vector of float a})
0:? 'ov2s3' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'badv4' (layout(stream=3 ) out mediump 4-component vector of float)
0:? 'bad2v4' (in 1-element array of mediump 4-component vector of float)
0:? 'anon@1' (layout(stream=3 ) out block{layout(stream=3 ) out highp int a})
0:? 'outbi' (layout(stream=3 ) out block{layout(stream=3 ) out highp int a, layout(stream=3 ) out highp int b, layout(stream=3 ) out highp int c})
0:? 'inbi' (in 4-element array of block{layout(stream=2 ) in highp int a})
0:? 'ouuaa6' (layout(stream=0 ) out block{layout(stream=0 ) out mediump 4-component vector of float a})
0:? 'badv4' (layout(stream=0 ) out mediump 4-component vector of float)
0:? 'bad2v4' (in 4-element array of mediump 4-component vector of float)
0:? 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) out highp int a})
0:? 'outbi' (layout(stream=0 ) out block{layout(stream=0 ) out highp int a, layout(stream=0 ) out highp int b, layout(stream=0 ) out highp int c})
0:? 'insn' (in 4-element array of block{in highp int a15})
0:? 'anon@2' (layout(stream=3 ) out block{layout(stream=3 ) out mediump float f15})
0:? 'anon@2' (layout(stream=0 ) out block{layout(stream=0 ) out mediump float f15})
0:? 'anon@3' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'summ' (global mediump float)
0:? 'gl_ViewportIndex' (layout(stream=3 ) out highp int)
0:? 'summ' (const highp int)
0:? 2752 (const int)

View File

@ -15,7 +15,9 @@ ERROR: 0:51: 'local_size' : can only apply to 'in'
ERROR: 0:51: 'local_size' : can only apply to 'in'
ERROR: 0:65: 'assign' : l-value required "ro" (can't modify a readonly buffer)
ERROR: 0:77: '=' : cannot convert from 'temp double' to 'temp int'
ERROR: 15 compilation errors. No code generated.
ERROR: 0:81: 'input block' : not supported in this stage: compute
ERROR: 0:85: 'output block' : not supported in this stage: compute
ERROR: 17 compilation errors. No code generated.
Shader version: 430
@ -143,6 +145,8 @@ ERROR: node is still EOpNull!
0:? 'ro' (layout(column_major shared ) readonly buffer block{layout(column_major shared ) buffer int value, layout(column_major shared ) buffer implicitly-sized array of float values})
0:? 'roll' (uniform double)
0:? 'destTex' (writeonly uniform image2D)
0:? 'inbi' (in block{in int a})
0:? 'outbi' (out block{out int a})
Linked compute stage:
@ -273,4 +277,6 @@ ERROR: node is still EOpNull!
0:? 'ro' (layout(column_major shared ) readonly buffer block{layout(column_major shared ) buffer int value, layout(column_major shared ) buffer implicitly-sized array of float values})
0:? 'roll' (uniform double)
0:? 'destTex' (writeonly uniform image2D)
0:? 'inbi' (in block{in int a})
0:? 'outbi' (out block{out int a})

View File

@ -622,6 +622,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
"\n");
// 120 is correct for both ES and desktop
if (version >= 120) {
commonBuiltins.append(
"mat2 outerProduct(vec2 c, vec2 r);"
@ -653,6 +654,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
"\n");
// 150 is correct for both ES and desktop
if (version >= 150) {
commonBuiltins.append(
"float determinant(mat2 m);"
@ -1043,7 +1045,6 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins[EShLangGeometry].append(
"void EmitVertex();"
"void EndPrimitive();"
"\n");
}
@ -1569,7 +1570,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
//
//============================================================================
if (version >= 150) {
if (profile != EEsProfile && version >= 150) {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices.
@ -1603,6 +1604,25 @@ void TBuiltIns::initialize(int version, EProfile profile)
"patch out float gl_TessLevelOuter[4];"
"patch out float gl_TessLevelInner[2];"
"\n");
} else {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices.
stageBuiltins[EShLangTessControl].append(
"in highp int gl_PatchVerticesIn;"
"in highp int gl_PrimitiveID;"
"in highp int gl_InvocationID;"
"out gl_PerVertex {"
"highp vec4 gl_Position;"
"highp float gl_PointSize;"
);
stageBuiltins[EShLangTessControl].append(
"} gl_out[];"
"patch out highp float gl_TessLevelOuter[4];"
"patch out highp float gl_TessLevelInner[2];"
"\n");
}
//============================================================================
@ -1611,7 +1631,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
//
//============================================================================
if (version >= 150) {
if (profile != EEsProfile && version >= 150) {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices.
@ -1645,6 +1665,25 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins[EShLangTessEvaluation].append(
"};"
"\n");
} else {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices.
stageBuiltins[EShLangTessEvaluation].append(
"in highp int gl_PatchVerticesIn;"
"in highp int gl_PrimitiveID;"
"in highp vec3 gl_TessCoord;"
"patch in highp float gl_TessLevelOuter[4];"
"patch in highp float gl_TessLevelInner[2];"
"out gl_PerVertex {"
"vec4 gl_Position;"
"float gl_PointSize;"
);
stageBuiltins[EShLangTessEvaluation].append(
"};"
"\n");
}
//============================================================================
@ -2923,6 +2962,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
symbolTable.relateToOperator("not", EOpVectorLogicalNot);
symbolTable.relateToOperator("matrixCompMult", EOpMul);
// 120 and 150 are correct for both ES and desktop
if (version >= 120) {
symbolTable.relateToOperator("outerProduct", EOpOuterProduct);
symbolTable.relateToOperator("transpose", EOpTranspose);

View File

@ -2418,15 +2418,13 @@ bool TParseContext::arrayError(TSourceLoc loc, const TType& type)
//
void TParseContext::arraySizeRequiredCheck(TSourceLoc loc, int size)
{
if (size == 0) {
if (size == 0)
error(loc, "array size required", "", "");
size = 1;
}
}
void TParseContext::structArrayCheck(TSourceLoc /*loc*/, TType* type)
void TParseContext::structArrayCheck(TSourceLoc /*loc*/, const TType& type)
{
const TTypeList& structure = *type->getStruct();
const TTypeList& structure = *type.getStruct();
for (int m = 0; m < (int)structure.size(); ++m) {
const TType& member = *structure[m].type;
if (member.isArray() && ! member.isExplicitlySizedArray())
@ -2434,6 +2432,33 @@ void TParseContext::structArrayCheck(TSourceLoc /*loc*/, TType* type)
}
}
void TParseContext::variableArrayUnsizedCheck(TSourceLoc loc, const TType& type, bool initializer)
{
// desktop always allows unsized variable arrays,
// ES always allows them if there is an initializer present to get the size from
if (profile != EEsProfile || initializer)
return;
// for ES, if size isn't coming from an initializer, it has to be explicitly declared now,
// with very few exceptions
switch (language) {
case EShLangGeometry:
if (type.getQualifier().storage == EvqVaryingIn)
if (extensionsTurnedOn(Num_AEP_geometry_shader, AEP_geometry_shader))
return;
break;
case EShLangTessControl:
if (type.getQualifier().storage == EvqVaryingOut)
if (extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
return;
break;
default:
break;
}
arraySizeRequiredCheck(loc, type.getArraySize());
}
void TParseContext::arrayDimError(TSourceLoc loc)
{
requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "arrays of arrays");
@ -2612,7 +2637,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
// Special case when using GL_ARB_separate_shader_objects
bool ssoPre150 = false; // means the only reason this variable is redeclared is due to this combination
if (version <= 140 && extensionsTurnedOn(1, &GL_ARB_separate_shader_objects)) {
if (profile != EEsProfile && version <= 140 && extensionsTurnedOn(1, &GL_ARB_separate_shader_objects)) {
if (identifier == "gl_Position" ||
identifier == "gl_PointSize" ||
identifier == "gl_ClipVertex" ||
@ -3086,7 +3111,7 @@ void TParseContext::arrayLimitCheck(TSourceLoc loc, const TString& identifier, i
limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistance array size");
}
// See if the provide value is less than the symbol indicated by limit,
// See if the provided value is less than the symbol indicated by limit,
// which should be a constant in the symbol table.
void TParseContext::limitCheck(TSourceLoc loc, int value, const char* limit, const char* feature)
{
@ -3108,18 +3133,19 @@ void TParseContext::finalErrorCheck()
constantIndexExpressionCheck(needsIndexLimitationChecking[i]);
// Check for stages that are enabled by extension.
// Can't do this at the beginning, it is chicken and egg to add a stage by extension.
// Specific stage-specific features were correctly tested for already, this is just
// Can't do this at the beginning, it is chicken and egg to add a stage by
// extension.
// Stage-specific features were correctly tested for already, this is just
// about the stage itself.
switch (language) {
case EShLangGeometry:
if (profile == EEsProfile && version == 310)
requireExtensions(getCurrentLoc(), 1, &GL_EXT_geometry_shader, "geometry shaders");
requireExtensions(getCurrentLoc(), Num_AEP_geometry_shader, AEP_geometry_shader, "geometry shaders");
break;
case EShLangTessControl:
case EShLangTessEvaluation:
if (profile == EEsProfile && version == 310)
requireExtensions(getCurrentLoc(), 1, &GL_EXT_tessellation_shader, "tessellation shaders");
requireExtensions(getCurrentLoc(), Num_AEP_tessellation_shader, AEP_tessellation_shader, "tessellation shaders");
else if (profile != EEsProfile && version < 400)
requireExtensions(getCurrentLoc(), 1, &GL_ARB_tessellation_shader, "tessellation shaders");
break;
@ -3431,6 +3457,7 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
return;
}
if (id == "stream") {
requireProfile(loc, ~EEsProfile, "selecting output stream");
publicType.qualifier.layoutStream = value;
return;
}
@ -4027,9 +4054,7 @@ TIntermNode* TParseContext::declareVariable(TSourceLoc loc, TString& identifier,
if (arraySizes)
type.setArraySizes(arraySizes);
// for ES, if size isn't coming from an initializer, it has to be explicitly declared now
if (profile == EEsProfile && ! initializer)
arraySizeRequiredCheck(loc, type.getArraySize());
variableArrayUnsizedCheck(loc, type, initializer != nullptr);
if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type))
declareArray(loc, identifier, type, symbol, newDeclaration);
@ -4486,38 +4511,7 @@ TIntermTyped* TParseContext::constructStruct(TIntermNode* node, const TType& typ
//
void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes)
{
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
switch (currentBlockQualifier.storage) {
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");
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "buffer block");
profileRequires(loc, EEsProfile, 310, nullptr, "buffer block");
break;
case EvqVaryingIn:
requireProfile(loc, ~EEsProfile, "input block");
profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "input block");
if (language == EShLangVertex)
error(loc, "cannot declare an input block in a vertex shader", "in", "");
break;
case EvqVaryingOut:
requireProfile(loc, ~EEsProfile, "output block");
profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "output block");
if (language == EShLangFragment)
error(loc, "cannot declare an output block in a fragment shader", "out", "");
break;
default:
error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
return;
}
blockStageIoCheck(loc, currentBlockQualifier.storage, arraySizes);
arrayDimCheck(loc, arraySizes, 0);
// fix and check for member storage qualifiers and types that don't belong within a block
@ -4706,6 +4700,91 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr
intermediate.addSymbolLinkageNode(linkage, variable);
}
// Do all block-declaration checking regarding the combination of in/out/uniform/buffer
// with a particular stage and with a given arrayness.
void TParseContext::blockStageIoCheck(TSourceLoc loc, TStorageQualifier storageQualifier, TArraySizes* arraySizes)
{
switch (storageQualifier) {
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");
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EvqBuffer:
requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block");
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "buffer block");
profileRequires(loc, EEsProfile, 310, nullptr, "buffer block");
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EvqVaryingIn:
profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "input block");
switch (language) {
case EShLangVertex:
// It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader
error(loc, "cannot declare an input block in a vertex shader", "in", "");
break;
case EShLangTessEvaluation:
case EShLangTessControl:
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EShLangGeometry:
break;
case EShLangFragment:
profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block");
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EShLangCompute:
// "Compute shaders do not permit user-defined input variables..."
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, "input block");
break;
default:
error(loc, "unexpected stage", "", "");
break;
}
break;
case EvqVaryingOut:
profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "output block");
switch (language) {
case EShLangVertex:
profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block");
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EShLangTessEvaluation:
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EShLangTessControl:
break;
case EShLangGeometry:
if (profile == EEsProfile && arraySizes)
arraySizeRequiredCheck(loc, arraySizes->getSize());
break;
case EShLangFragment:
// It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader
error(loc, "cannot declare an output block in a fragment shader", "out", "");
break;
case EShLangCompute:
// "Compute shaders ... do not support user-defined output variables..."
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, "output block");
break;
default:
error(loc, "unexpected stage", "", "");
break;
}
break;
default:
error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
return;
}
}
//
// "For a block, this process applies to the entire block, or until the first member
// is reached that has a location layout qualifier. When a block member is declared with a location

View File

@ -123,7 +123,8 @@ public:
bool arrayQualifierError(TSourceLoc, const TQualifier&);
bool arrayError(TSourceLoc, const TType&);
void arraySizeRequiredCheck(TSourceLoc, int size);
void structArrayCheck(TSourceLoc, TType* structure);
void structArrayCheck(TSourceLoc, const TType& structure);
void variableArrayUnsizedCheck(TSourceLoc, const TType&, bool initializer);
void arrayDimError(TSourceLoc);
void arrayDimCheck(TSourceLoc, TArraySizes* sizes1, TArraySizes* sizes2);
void arrayDimCheck(TSourceLoc, const TType*, TArraySizes*);
@ -177,6 +178,7 @@ public:
TIntermTyped* constructStruct(TIntermNode*, const TType&, int, TSourceLoc);
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, TSourceLoc, bool subset);
void declareBlock(TSourceLoc, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
void blockStageIoCheck(TSourceLoc, TStorageQualifier, TArraySizes*);
void fixBlockLocations(TSourceLoc, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation);
void fixBlockXfbOffsets(TQualifier&, TTypeList&);
void fixBlockUniformOffsets(TQualifier&, TTypeList&);

View File

@ -178,7 +178,7 @@ void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profi
//
// Initialize the full set of shareable symbol tables;
// The common (cross-stage) and those sharable per-stage.
// The common (cross-stage) and those shareable per-stage.
//
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile)
{
@ -191,14 +191,24 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
InitializeSymbolTable(builtIns.getCommonString(), version, profile, EShLangFragment, infoSink, *commonTable[EPcFragment]);
// do the per-stage tables
// always have vertex and fragment
InitializeStageSymbolTable(builtIns, version, profile, EShLangVertex, infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(builtIns, version, profile, EShLangFragment, infoSink, commonTable, symbolTables);
if (profile != EEsProfile && version >= 150) {
// check for tessellation
if ((profile != EEsProfile && version >= 150) ||
(profile == EEsProfile && version >= 310)) {
InitializeStageSymbolTable(builtIns, version, profile, EShLangTessControl, infoSink, commonTable, symbolTables);
InitializeStageSymbolTable(builtIns, version, profile, EShLangTessEvaluation, infoSink, commonTable, symbolTables);
}
if (profile != EEsProfile && version >= 150)
// check for geometry
if ((profile != EEsProfile && version >= 150) ||
(profile == EEsProfile && version >= 310))
InitializeStageSymbolTable(builtIns, version, profile, EShLangGeometry, infoSink, commonTable, symbolTables);
// check for compute
if ((profile != EEsProfile && version >= 430) ||
(profile == EEsProfile && version >= 310))
InitializeStageSymbolTable(builtIns, version, profile, EShLangCompute, infoSink, commonTable, symbolTables);

View File

@ -190,6 +190,15 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior[GL_EXT_tessellation_point_size] = EBhDisablePartial;
extensionBehavior[GL_EXT_texture_buffer] = EBhDisablePartial;
extensionBehavior[GL_EXT_texture_cube_map_array] = EBhDisablePartial;
// OES matching AEP
extensionBehavior[GL_OES_geometry_shader] = EBhDisablePartial;
extensionBehavior[GL_OES_gpu_shader5] = EBhDisablePartial;
extensionBehavior[GL_OES_primitive_bounding_box] = EBhDisablePartial;
extensionBehavior[GL_OES_shader_io_blocks] = EBhDisablePartial;
extensionBehavior[GL_OES_tessellation_shader] = EBhDisablePartial;
extensionBehavior[GL_OES_texture_buffer] = EBhDisablePartial;
extensionBehavior[GL_OES_texture_cube_map_array] = EBhDisablePartial;
}
// Get code that is not part of a shared symbol table, is specific to this shader,
@ -222,6 +231,15 @@ const char* TParseContext::getPreamble()
"#define GL_EXT_tessellation_point_size 1\n"
"#define GL_EXT_texture_buffer 1\n"
"#define GL_EXT_texture_cube_map_array 1\n"
// OES matching AEP
"#define GL_OES_geometry_shader 1\n"
"#define GL_OES_gpu_shader5 1\n"
"#define GL_OES_primitive_bounding_box 1\n"
"#define GL_OES_shader_io_blocks 1\n"
"#define GL_OES_tessellation_shader 1\n"
"#define GL_OES_texture_buffer 1\n"
"#define GL_OES_texture_cube_map_array 1\n"
;
} else {
return
@ -478,8 +496,9 @@ void TParseContext::updateExtensionBehavior(const char* extension, const char* b
// update the requested extension
updateExtensionBehavior(extension, behavior);
// see if need to propagate to everything in AEP
// see if need to propagate to implicitly modified things
if (strcmp(extension, "GL_ANDROID_extension_pack_es31a") == 0) {
// to everything in AEP
updateExtensionBehavior("GL_KHR_blend_equation_advanced", behaviorString);
updateExtensionBehavior("GL_OES_sample_variables", behaviorString);
updateExtensionBehavior("GL_OES_shader_image_atomic", behaviorString);
@ -493,6 +512,16 @@ void TParseContext::updateExtensionBehavior(const char* extension, const char* b
updateExtensionBehavior("GL_EXT_texture_buffer", behaviorString);
updateExtensionBehavior("GL_EXT_texture_cube_map_array", behaviorString);
}
// geometry to io_blocks
else if (strcmp(extension, "GL_EXT_geometry_shader") == 0)
updateExtensionBehavior("GL_EXT_shader_io_blocks", behaviorString);
else if (strcmp(extension, "GL_OES_geometry_shader") == 0)
updateExtensionBehavior("GL_OES_shader_io_blocks", behaviorString);
// tessellation to io_blocks
else if (strcmp(extension, "GL_EXT_tessellation_shader") == 0)
updateExtensionBehavior("GL_EXT_shader_io_blocks", behaviorString);
else if (strcmp(extension, "GL_OES_tessellation_shader") == 0)
updateExtensionBehavior("GL_OES_shader_io_blocks", behaviorString);
}
void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior)

View File

@ -115,6 +115,38 @@ const char* const GL_EXT_tessellation_point_size = "GL_EXT_tessella
const char* const GL_EXT_texture_buffer = "GL_EXT_texture_buffer";
const char* const GL_EXT_texture_cube_map_array = "GL_EXT_texture_cube_map_array";
// OES matching AEP
const char* const GL_OES_geometry_shader = "GL_OES_geometry_shader";
const char* const GL_OES_gpu_shader5 = "GL_OES_gpu_shader5";
const char* const GL_OES_primitive_bounding_box = "GL_OES_primitive_bounding_box";
const char* const GL_OES_shader_io_blocks = "GL_OES_shader_io_blocks";
const char* const GL_OES_tessellation_shader = "GL_OES_tessellation_shader";
const char* const GL_OES_texture_buffer = "GL_OES_texture_buffer";
const char* const GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array";
// Arrays of extensions for the above AEP duplications
const char* const AEP_geometry_shader[] = { GL_EXT_geometry_shader, GL_OES_geometry_shader };
const int Num_AEP_geometry_shader = sizeof(AEP_geometry_shader)/sizeof(AEP_geometry_shader[0]);
const char* const AEP_gpu_shader5[] = { GL_EXT_gpu_shader5, GL_OES_gpu_shader5 };
const int Num_AEP_gpu_shader5 = sizeof(AEP_gpu_shader5)/sizeof(AEP_gpu_shader5[0]);
const char* const AEP_primitive_bounding_box[] = { GL_EXT_primitive_bounding_box, GL_OES_primitive_bounding_box };
const int Num_AEP_primitive_bounding_box = sizeof(AEP_primitive_bounding_box)/sizeof(AEP_primitive_bounding_box[0]);
const char* const AEP_shader_io_blocks[] = { GL_EXT_shader_io_blocks, GL_OES_shader_io_blocks };
const int Num_AEP_shader_io_blocks = sizeof(AEP_shader_io_blocks)/sizeof(AEP_shader_io_blocks[0]);
const char* const AEP_tessellation_shader[] = { GL_EXT_tessellation_shader, GL_OES_tessellation_shader };
const int Num_AEP_tessellation_shader = sizeof(AEP_tessellation_shader)/sizeof(AEP_tessellation_shader[0]);
const char* const AEP_texture_buffer[] = { GL_EXT_texture_buffer, GL_OES_texture_buffer };
const int Num_AEP_texture_buffer = sizeof(AEP_texture_buffer)/sizeof(AEP_texture_buffer[0]);
const char* const AEP_texture_cube_map_array[] = { GL_EXT_texture_cube_map_array, GL_OES_texture_cube_map_array };
const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]);
} // end namespace glslang
#endif // _VERSIONS_INCLUDED_

View File

@ -1919,7 +1919,7 @@ precision_qualifier
struct_specifier
: STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
TType* structure = new TType($5, *$2.string);
parseContext.structArrayCheck($2.loc, structure);
parseContext.structArrayCheck($2.loc, *structure);
TVariable* userTypeDef = new TVariable($2.string, *structure, true);
if (! parseContext.symbolTable.insert(*userTypeDef))
parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct");