glslang AEP: The extension scheme, extension-enabled stage-existence testing, and compute-shader interface. Still needs in/out blocks, unsized arrays, etc. before real testing can be done.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31479 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2015-06-12 05:01:25 +00:00
parent 4751ce3fc1
commit 453bb26ef5
10 changed files with 627 additions and 32 deletions

143
Test/310.geom Normal file
View File

@@ -0,0 +1,143 @@
#version 310 es
#extension GL_EXT_geometry_shader : enable
precision mediump float;
in fromVertex {
in vec3 color;
} fromV[];
out toFragment {
out vec3 color;
} toF;
out fromVertex { // okay to reuse a block name for another block name
vec3 color;
};
out fooB {
vec2 color;
} fromVertex; // ERROR, cannot reuse block name as block instance
int fromVertex; // ERROR, cannot reuse a block name for something else
out fooC {
vec2 color;
} fooC; // ERROR, cannot have same name for block and instance name
void main()
{
EmitVertex();
EndPrimitive();
EmitStreamVertex(1); // ERROR
EndStreamPrimitive(0); // ERROR
color = fromV[0].color;
gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
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 = 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, 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
layout(max_vertices = 200) out;
layout(max_vertices = 300) out; // ERROR, too big
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(triangle_strip) in; // ERROR, not an input primitive
layout(triangle_strip) uniform; // ERROR
layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input
layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
out outbn2 {
layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0
layout(max_vertices = 3) int b; // ERROR, not on a block member
layout(triangle_strip) int c; // ERROR, not on a block member
} outbi;
layout(lines) out; // ERROR, not on output
layout(lines_adjacency) in;
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[];
out sameName {
float f15;
};
uniform sameName {
bool b15;
};
float summ = gl_MaxVertexAttribs +
gl_MaxVertexUniformComponents +
gl_MaxVaryingFloats +
gl_MaxVaryingComponents +
gl_MaxVertexOutputComponents +
gl_MaxGeometryInputComponents +
gl_MaxGeometryOutputComponents +
gl_MaxFragmentInputComponents +
gl_MaxVertexTextureImageUnits +
gl_MaxCombinedTextureImageUnits +
gl_MaxTextureImageUnits +
gl_MaxFragmentUniformComponents +
gl_MaxDrawBuffers +
gl_MaxClipDistances +
gl_MaxGeometryTextureImageUnits +
gl_MaxGeometryOutputVertices +
gl_MaxGeometryTotalOutputComponents +
gl_MaxGeometryUniformComponents +
gl_MaxGeometryVaryingComponents;
void fooe1()
{
gl_ViewportIndex = gl_MaxViewports - 1;
}
#extension GL_ARB_viewport_array : enable
void fooe2()
{
gl_ViewportIndex = gl_MaxViewports - 1;
}
out int gl_ViewportIndex;

View File

@@ -0,0 +1,299 @@
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.
Shader version: 310
Requested GL_ARB_viewport_array
Requested GL_EXT_geometry_shader
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: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:38 Constant:
0:38 0.000000
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:? Linker Objects
0:? 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
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:? '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:? '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@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)
Linked geometry stage:
Shader version: 310
Requested GL_ARB_viewport_array
Requested GL_EXT_geometry_shader
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: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:38 Constant:
0:38 0.000000
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:? Linker Objects
0:? 'fromV' (in 4-element array of block{in mediump 3-component vector of float color})
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:? '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:? '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@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)

View File

@@ -15,7 +15,7 @@ Shader version: 110
0:? Linker Objects
noMain1.geom
ERROR: #version: geometry shaders require non-es profile and version 150 or above
ERROR: #version: geometry shaders require es profile with version 310 or non-es profile with version 150 or above
ERROR: 1 compilation errors. No code generated.

View File

@@ -38,6 +38,7 @@ comment.frag
300block.frag
310.comp
310.vert
310.geom
310.frag
310implicitSizeArrayError.vert
310AofA.vert