From 6e76bdc88ddb2840cbb7977863cf20b354631f38 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 19 Jun 2015 23:03:32 +0000 Subject: [PATCH] glslang front-end: Full turn-on of AEP tessellation semantics. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31538 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- Test/310.tesc | 121 +++++++ Test/310.tese | 113 ++++++ Test/400.tesc | 4 +- Test/400.tese | 12 +- Test/baseResults/310.frag.out | 2 +- Test/baseResults/310.tesc.out | 388 +++++++++++++++++++++ Test/baseResults/310.tese.out | 276 +++++++++++++++ Test/baseResults/310.vert.out | 2 +- Test/baseResults/330.frag.out | 2 +- Test/baseResults/420.vert.out | 2 +- Test/baseResults/430.vert.out | 10 +- Test/baseResults/440.frag.out | 4 +- Test/testlist | 2 + glslang/MachineIndependent/Initialize.cpp | 46 ++- glslang/MachineIndependent/ParseHelper.cpp | 95 ++--- glslang/MachineIndependent/ParseHelper.h | 4 +- glslang/MachineIndependent/Scan.cpp | 10 +- glslang/MachineIndependent/Versions.cpp | 4 +- 18 files changed, 1000 insertions(+), 97 deletions(-) create mode 100644 Test/310.tesc create mode 100644 Test/310.tese create mode 100644 Test/baseResults/310.tesc.out create mode 100644 Test/baseResults/310.tese.out diff --git a/Test/310.tesc b/Test/310.tesc new file mode 100644 index 00000000..d35014a3 --- /dev/null +++ b/Test/310.tesc @@ -0,0 +1,121 @@ +#version 310 es + +#extension GL_OES_tessellation_shader : enable + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[1].gl_Position = p; + gl_out[1].gl_PointSize = ps; + gl_out[1].gl_ClipDistance[1] = cd; // ERROR, not in ES + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR, not on in +layout(vertices = 5) out; // ERROR, changing # + +void foo() +{ + gl_out[4].gl_Position; // ERROR, out of range + + barrier(); // ERROR, not in main +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; +patch out float implA[]; // ERROR, not sized + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +void foop() +{ + precise float d; // ERROR without gpu_shader5 + d = fma(d, d, d); // ERROR without gpu_shader5 +} + +patch out pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2[]; +centroid in vec3 centr[]; +sample out vec4 perSampleColor[]; // ERROR without sample extensions + +layout(vertices = 4) out float badlay[]; // ERROR, not on a variable +out float misSized[5]; // ERROR, size doesn't match +out float okaySize[4]; + +// for testing with gpu_shader5 +//precise vec3 pv3; +// +//void foop() +//{ +// precise double d; +// +// pv3 *= pv3; +// pv3 = fma(pv3, pv3, pv3); +// d = fma(d, d, d); +//} +// diff --git a/Test/310.tese b/Test/310.tese new file mode 100644 index 00000000..c0ac6e9b --- /dev/null +++ b/Test/310.tese @@ -0,0 +1,113 @@ +#version 310 es + +#extension GL_EXT_tessellation_shader : enable +#extension GL_OES_tessellation_shader : enable +#extension GL_EXT_tessellation_shader : disable + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; // ERROR, not in ES +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex // ERROR, no size +{ + vec4 gl_Position; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + vec4 gl_Position; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { // ERROR, not array + int f; +} bla; + +in testblb { + int f; +} blb[]; + +in testblc { // ERROR wrong size + int f; +} blc[18]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR, overlap + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions diff --git a/Test/400.tesc b/Test/400.tesc index efbcbce5..cf9ba517 100644 --- a/Test/400.tesc +++ b/Test/400.tesc @@ -80,11 +80,11 @@ in vec2 ind[gl_MaxPatchVertices]; layout(location = 3) in vec4 ivla[]; layout(location = 4) in vec4 ivlb[]; -layout(location = 4) in vec4 ivlc[]; // ERROR +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping layout(location = 3) out vec4 ovla[]; layout(location = 4) out vec4 ovlb[]; -layout(location = 4) out vec4 ovlc[]; // ERROR +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping precise vec3 pv3; diff --git a/Test/400.tese b/Test/400.tese index 408d291a..a1d3ed82 100644 --- a/Test/400.tese +++ b/Test/400.tese @@ -51,14 +51,14 @@ patch sample in vec3 badp4; // ERROR #extension GL_ARB_separate_shader_objects : enable -in gl_PerVertex +in gl_PerVertex // ERROR, no size { -float gl_ClipDistance[1]; -} gl_in[]; // ERROR, no size + float gl_ClipDistance[1]; +} gl_in[]; -in gl_PerVertex +in gl_PerVertex // ERROR, second redeclaration of gl_in { -float gl_ClipDistance[1]; + float gl_ClipDistance[1]; } gl_in[]; layout(quads, cw) out; // ERROR @@ -98,7 +98,7 @@ layout(location = 24) in vec4 ivlc[]; // ERROR layout(location = 23) out vec4 ovla[2]; layout(location = 24) out vec4 ovlb[2]; // ERROR -in float gl_TessLevelOuter[4]; // ERROR +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare patch in pinbn { int a; diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out index f9c42e51..09c54fcb 100644 --- a/Test/baseResults/310.frag.out +++ b/Test/baseResults/310.frag.out @@ -41,7 +41,7 @@ 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: 0:133: 'out' : cannot declare an output block in a fragment shader +ERROR: 0:133: 'output block' : not supported in this stage: fragment 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 diff --git a/Test/baseResults/310.tesc.out b/Test/baseResults/310.tesc.out new file mode 100644 index 00000000..b1b2633b --- /dev/null +++ b/Test/baseResults/310.tesc.out @@ -0,0 +1,388 @@ +310.tesc +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:8: 'quads' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:9: 'ccw' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:10: 'fractional_even_spacing' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) +ERROR: 0:12: 'patch' : can only use on output in tessellation-control shader +ERROR: 0:27: 'gl_ClipDistance' : no such field in structure +ERROR: 0:27: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:35: 'gl_ClipDistance' : no such field in structure +ERROR: 0:35: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:35: 'assign' : l-value required (can't modify a const) +ERROR: 0:41: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:43: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:48: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:53: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:56: '' : tessellation control barrier() cannot be placed within flow control +ERROR: 0:63: '' : tessellation control barrier() cannot be placed after a return from main() +ERROR: 0:66: 'vertices' : can only apply to 'out' +ERROR: 0:67: 'vertices' : cannot change previously set layout value +ERROR: 0:71: '[' : array index out of range '4' +ERROR: 0:73: '' : tessellation control barrier() must be in main() +ERROR: 0:76: 'in' : type must be an array: ina +ERROR: 0:78: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:80: '' : array size required +ERROR: 0:86: 'location' : overlapping use of location 4 +ERROR: 0:90: 'location' : overlapping use of location 4 +ERROR: 0:94: 'precise' : Reserved word. +ERROR: 0:95: 'fma' : no matching overloaded function found +ERROR: 0:104: 'sample' : Reserved word. +ERROR: 0:106: 'vertices' : can only apply to a standalone qualifier +ERROR: 0:107: 'vertices' : inconsistent output number of vertices for array size of misSized +ERROR: 29 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_shader +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( (global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Barrier (global void) +0:19 Sequence +0:19 move second child to first child (temp highp int) +0:19 'a' (temp highp int) +0:19 Constant: +0:19 5392 (const int) +0:25 Sequence +0:25 move second child to first child (temp highp 4-component vector of float) +0:25 'p' (temp highp 4-component vector of float) +0:25 gl_Position: direct index for structure (in highp 4-component vector of float) +0:25 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:25 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 Sequence +0:26 move second child to first child (temp highp float) +0:26 'ps' (temp highp float) +0:26 gl_PointSize: direct index for structure (in highp float) +0:26 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:26 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 Sequence +0:27 move second child to first child (temp highp float) +0:27 'cd' (temp highp float) +0:27 Constant: +0:27 0.000000 +0:29 Sequence +0:29 move second child to first child (temp highp int) +0:29 'pvi' (temp highp int) +0:29 'gl_PatchVerticesIn' (in highp int PatchVertices) +0:30 Sequence +0:30 move second child to first child (temp highp int) +0:30 'pid' (temp highp int) +0:30 'gl_PrimitiveID' (in highp int PrimitiveID) +0:31 Sequence +0:31 move second child to first child (temp highp int) +0:31 'iid' (temp highp int) +0:31 'gl_InvocationID' (in highp int InvocationID) +0:33 move second child to first child (temp highp 4-component vector of float) +0:33 gl_Position: direct index for structure (out highp 4-component vector of float Position) +0:33 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 'p' (temp highp 4-component vector of float) +0:34 move second child to first child (temp highp float) +0:34 gl_PointSize: direct index for structure (out highp float PointSize) +0:34 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1 (const int) +0:34 'ps' (temp highp float) +0:35 move second child to first child (temp highp float) +0:35 Constant: +0:35 0.000000 +0:35 'cd' (temp highp float) +0:37 move second child to first child (temp highp float) +0:37 direct index (patch temp highp float TessLevelOuter) +0:37 'gl_TessLevelOuter' (patch out 4-element array of highp float TessLevelOuter) +0:37 Constant: +0:37 3 (const int) +0:37 Constant: +0:37 3.200000 +0:38 move second child to first child (temp highp float) +0:38 direct index (patch temp highp float TessLevelInner) +0:38 'gl_TessLevelInner' (patch out 2-element array of highp float TessLevelInner) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 1.300000 +0:40 Test condition and select (temp void) +0:40 Condition +0:40 Compare Greater Than (temp bool) +0:40 'a' (temp highp int) +0:40 Constant: +0:40 10 (const int) +0:40 true case +0:41 Barrier (global void) +0:40 false case +0:43 Barrier (global void) +0:45 Barrier (global void) +0:49 Loop with condition not tested first +0:49 Loop Condition +0:49 Compare Greater Than (temp bool) +0:49 'a' (temp highp int) +0:49 Constant: +0:49 10 (const int) +0:49 Loop Body +0:48 Sequence +0:48 Barrier (global void) +0:51 switch +0:51 condition +0:51 'a' (temp highp int) +0:51 body +0:51 Sequence +0:52 default: +0:? Sequence +0:53 Barrier (global void) +0:54 Branch: Break +0:56 Test condition and select (temp highp int) +0:56 Condition +0:56 Compare Less Than (temp bool) +0:56 'a' (temp highp int) +0:56 Constant: +0:56 12 (const int) +0:56 true case +0:56 'a' (temp highp int) +0:56 false case +0:56 Comma (temp highp int) +0:56 Barrier (global void) +0:56 'a' (temp highp int) +0:58 Sequence +0:58 Barrier (global void) +0:61 Branch: Return +0:63 Barrier (global void) +0:69 Function Definition: foo( (global void) +0:69 Function Parameters: +0:71 Sequence +0:71 gl_Position: direct index for structure (out highp 4-component vector of float Position) +0:71 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 Constant: +0:71 4 (const int) +0:71 Constant: +0:71 0 (const int) +0:73 Barrier (global void) +0:92 Function Definition: foop( (global void) +0:92 Function Parameters: +0:? Sequence +0:95 move second child to first child (temp highp float) +0:95 'd' (temp highp float) +0:95 Constant: +0:95 0.000000 +0:? Linker Objects +0:? 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' (global 4-element array of highp int) +0:? 'patchIn' (patch in highp 4-component vector of float) +0:? 'patchOut' (patch out highp 4-component vector of float) +0:? 'ina' (in highp 2-component vector of float) +0:? 'inb' (in 32-element array of highp 2-component vector of float) +0:? 'inc' (in 32-element array of highp 2-component vector of float) +0:? 'ind' (in 32-element array of highp 2-component vector of float) +0:? 'implA' (patch out implicitly-sized array of highp float) +0:? 'ivla' (layout(location=3 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout(location=4 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout(location=4 ) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout(location=3 ) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout(location=4 ) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout(location=4 ) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' (patch out block{out highp int a}) +0:? 'myColor2' (centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' (centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' (sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' (out 4-element array of highp float) +0:? 'misSized' (out 5-element array of highp float) +0:? 'okaySize' (out 4-element array of highp float) + + +Linked tessellation control stage: + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_shader +vertices = 4 +ERROR: node is still EOpNull! +0:15 Function Definition: main( (global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Barrier (global void) +0:19 Sequence +0:19 move second child to first child (temp highp int) +0:19 'a' (temp highp int) +0:19 Constant: +0:19 5392 (const int) +0:25 Sequence +0:25 move second child to first child (temp highp 4-component vector of float) +0:25 'p' (temp highp 4-component vector of float) +0:25 gl_Position: direct index for structure (in highp 4-component vector of float) +0:25 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:25 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:25 Constant: +0:25 1 (const int) +0:25 Constant: +0:25 0 (const int) +0:26 Sequence +0:26 move second child to first child (temp highp float) +0:26 'ps' (temp highp float) +0:26 gl_PointSize: direct index for structure (in highp float) +0:26 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:26 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:26 Constant: +0:26 1 (const int) +0:26 Constant: +0:26 1 (const int) +0:27 Sequence +0:27 move second child to first child (temp highp float) +0:27 'cd' (temp highp float) +0:27 Constant: +0:27 0.000000 +0:29 Sequence +0:29 move second child to first child (temp highp int) +0:29 'pvi' (temp highp int) +0:29 'gl_PatchVerticesIn' (in highp int PatchVertices) +0:30 Sequence +0:30 move second child to first child (temp highp int) +0:30 'pid' (temp highp int) +0:30 'gl_PrimitiveID' (in highp int PrimitiveID) +0:31 Sequence +0:31 move second child to first child (temp highp int) +0:31 'iid' (temp highp int) +0:31 'gl_InvocationID' (in highp int InvocationID) +0:33 move second child to first child (temp highp 4-component vector of float) +0:33 gl_Position: direct index for structure (out highp 4-component vector of float Position) +0:33 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 'p' (temp highp 4-component vector of float) +0:34 move second child to first child (temp highp float) +0:34 gl_PointSize: direct index for structure (out highp float PointSize) +0:34 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:34 Constant: +0:34 1 (const int) +0:34 Constant: +0:34 1 (const int) +0:34 'ps' (temp highp float) +0:35 move second child to first child (temp highp float) +0:35 Constant: +0:35 0.000000 +0:35 'cd' (temp highp float) +0:37 move second child to first child (temp highp float) +0:37 direct index (patch temp highp float TessLevelOuter) +0:37 'gl_TessLevelOuter' (patch out 4-element array of highp float TessLevelOuter) +0:37 Constant: +0:37 3 (const int) +0:37 Constant: +0:37 3.200000 +0:38 move second child to first child (temp highp float) +0:38 direct index (patch temp highp float TessLevelInner) +0:38 'gl_TessLevelInner' (patch out 2-element array of highp float TessLevelInner) +0:38 Constant: +0:38 1 (const int) +0:38 Constant: +0:38 1.300000 +0:40 Test condition and select (temp void) +0:40 Condition +0:40 Compare Greater Than (temp bool) +0:40 'a' (temp highp int) +0:40 Constant: +0:40 10 (const int) +0:40 true case +0:41 Barrier (global void) +0:40 false case +0:43 Barrier (global void) +0:45 Barrier (global void) +0:49 Loop with condition not tested first +0:49 Loop Condition +0:49 Compare Greater Than (temp bool) +0:49 'a' (temp highp int) +0:49 Constant: +0:49 10 (const int) +0:49 Loop Body +0:48 Sequence +0:48 Barrier (global void) +0:51 switch +0:51 condition +0:51 'a' (temp highp int) +0:51 body +0:51 Sequence +0:52 default: +0:? Sequence +0:53 Barrier (global void) +0:54 Branch: Break +0:56 Test condition and select (temp highp int) +0:56 Condition +0:56 Compare Less Than (temp bool) +0:56 'a' (temp highp int) +0:56 Constant: +0:56 12 (const int) +0:56 true case +0:56 'a' (temp highp int) +0:56 false case +0:56 Comma (temp highp int) +0:56 Barrier (global void) +0:56 'a' (temp highp int) +0:58 Sequence +0:58 Barrier (global void) +0:61 Branch: Return +0:63 Barrier (global void) +0:69 Function Definition: foo( (global void) +0:69 Function Parameters: +0:71 Sequence +0:71 gl_Position: direct index for structure (out highp 4-component vector of float Position) +0:71 direct index (temp block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:71 Constant: +0:71 4 (const int) +0:71 Constant: +0:71 0 (const int) +0:73 Barrier (global void) +0:92 Function Definition: foop( (global void) +0:92 Function Parameters: +0:? Sequence +0:95 move second child to first child (temp highp float) +0:95 'd' (temp highp float) +0:95 Constant: +0:95 0.000000 +0:? Linker Objects +0:? 'gl_out' (out 4-element array of block{out highp 4-component vector of float Position gl_Position, out highp float PointSize gl_PointSize}) +0:? 'outa' (global 4-element array of highp int) +0:? 'patchIn' (patch in highp 4-component vector of float) +0:? 'patchOut' (patch out highp 4-component vector of float) +0:? 'ina' (in highp 2-component vector of float) +0:? 'inb' (in 32-element array of highp 2-component vector of float) +0:? 'inc' (in 32-element array of highp 2-component vector of float) +0:? 'ind' (in 32-element array of highp 2-component vector of float) +0:? 'implA' (patch out 1-element array of highp float) +0:? 'ivla' (layout(location=3 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout(location=4 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout(location=4 ) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout(location=3 ) out 4-element array of highp 4-component vector of float) +0:? 'ovlb' (layout(location=4 ) out 4-element array of highp 4-component vector of float) +0:? 'ovlc' (layout(location=4 ) out 4-element array of highp 4-component vector of float) +0:? 'pinbi' (patch out block{out highp int a}) +0:? 'myColor2' (centroid out 4-element array of highp 3-component vector of float) +0:? 'centr' (centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' (sample out 4-element array of highp 4-component vector of float) +0:? 'badlay' (out 4-element array of highp float) +0:? 'misSized' (out 5-element array of highp float) +0:? 'okaySize' (out 4-element array of highp float) + diff --git a/Test/baseResults/310.tese.out b/Test/baseResults/310.tese.out new file mode 100644 index 00000000..76e5ea10 --- /dev/null +++ b/Test/baseResults/310.tese.out @@ -0,0 +1,276 @@ +310.tese +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:7: 'vertices' : there is no such layout identifier for this stage taking an assigned value +ERROR: 0:9: 'triangles' : cannot change previously set input primitive +ERROR: 0:10: 'isolines' : cannot change previously set input primitive +ERROR: 0:12: 'ccw' : cannot change previously set vertex order +ERROR: 0:16: 'equal_spacing' : cannot change previously set vertex spacing +ERROR: 0:17: 'fractional_even_spacing' : cannot change previously set vertex spacing +ERROR: 0:22: 'patch' : can only use on input in tessellation-evaluation shader +ERROR: 0:26: 'barrier' : no matching overloaded function found +ERROR: 0:38: 'gl_ClipDistance' : no such field in structure +ERROR: 0:38: 'expression' : left of '[' is not of type array, matrix, or vector +ERROR: 0:48: 'gl_ClipDistance' : undeclared identifier +ERROR: 0:48: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector +ERROR: 0:48: 'assign' : l-value required (can't modify a const) +ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:53: 'noperspective' : Reserved word. +ERROR: 0:53: 'noperspective' : not supported with this profile: es +ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch +ERROR: 0:54: 'sample' : Reserved word. +ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample) +ERROR: 0:58: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized +ERROR: 0:63: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use +ERROR: 0:68: 'quads' : cannot apply to 'out' +ERROR: 0:68: 'cw' : can only apply to 'in' +ERROR: 0:69: 'triangles' : cannot apply to 'out' +ERROR: 0:70: 'isolines' : cannot apply to 'out' +ERROR: 0:71: 'cw' : can only apply to 'in' +ERROR: 0:72: 'fractional_odd_spacing' : can only apply to 'in' +ERROR: 0:73: 'equal_spacing' : can only apply to 'in' +ERROR: 0:74: 'fractional_even_spacing' : can only apply to 'in' +ERROR: 0:75: 'point_mode' : can only apply to 'in' +ERROR: 0:77: 'in' : type must be an array: ina +ERROR: 0:79: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:82: 'in' : type must be an array: bla +ERROR: 0:90: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized +ERROR: 0:100: 'location' : overlapping use of location 24 +ERROR: 0:103: 'location' : overlapping use of location 24 +ERROR: 0:105: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 0:113: 'sample' : Reserved word. +ERROR: 39 compilation errors. No code generated. + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_shader +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:24 Function Definition: main( (global void) +0:24 Function Parameters: +0:26 Sequence +0:26 Constant: +0:26 0.000000 +0:28 Sequence +0:28 move second child to first child (temp highp int) +0:28 'a' (temp highp int) +0:28 Constant: +0:28 1512 (const int) +0:36 Sequence +0:36 move second child to first child (temp highp 4-component vector of float) +0:36 'p' (temp highp 4-component vector of float) +0:36 gl_Position: direct index for structure (in highp 4-component vector of float) +0:36 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:36 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child (temp highp float) +0:37 'ps' (temp highp float) +0:37 gl_PointSize: direct index for structure (in highp float) +0:37 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:37 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child (temp highp float) +0:38 'cd' (temp highp float) +0:38 Constant: +0:38 0.000000 +0:40 Sequence +0:40 move second child to first child (temp highp int) +0:40 'pvi' (temp highp int) +0:40 'gl_PatchVerticesIn' (in highp int PatchVertices) +0:41 Sequence +0:41 move second child to first child (temp highp int) +0:41 'pid' (temp highp int) +0:41 'gl_PrimitiveID' (in highp int PrimitiveID) +0:42 Sequence +0:42 move second child to first child (temp highp 3-component vector of float) +0:42 'tc' (temp highp 3-component vector of float) +0:42 'gl_TessCoord' (in highp 3-component vector of float TessCoord) +0:43 Sequence +0:43 move second child to first child (temp highp float) +0:43 'tlo' (temp highp float) +0:43 direct index (patch temp highp float TessLevelOuter) +0:43 'gl_TessLevelOuter' (patch in 4-element array of highp float TessLevelOuter) +0:43 Constant: +0:43 3 (const int) +0:44 Sequence +0:44 move second child to first child (temp highp float) +0:44 'tli' (temp highp float) +0:44 direct index (patch temp highp float TessLevelInner) +0:44 'gl_TessLevelInner' (patch in 2-element array of highp float TessLevelInner) +0:44 Constant: +0:44 1 (const int) +0:46 move second child to first child (temp highp 4-component vector of float) +0:46 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position) +0:46 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:46 Constant: +0:46 0 (const uint) +0:46 'p' (temp highp 4-component vector of float) +0:47 move second child to first child (temp highp float) +0:47 gl_PointSize: direct index for structure (gl_PointSize highp float PointSize) +0:47 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:47 Constant: +0:47 1 (const uint) +0:47 'ps' (temp highp float) +0:48 move second child to first child (temp highp float) +0:48 Constant: +0:48 0.000000 +0:48 'cd' (temp highp float) +0:? Linker Objects +0:? 'patchIn' (patch in highp 4-component vector of float) +0:? 'patchOut' (patch out highp 4-component vector of float) +0:? 'badp1' (smooth patch in highp 4-component vector of float) +0:? 'badp2' (flat patch in highp 4-component vector of float) +0:? 'badp3' (noperspective patch in highp 4-component vector of float) +0:? 'badp4' (patch sample in highp 3-component vector of float) +0:? 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position}) +0:? 'ina' (in highp 2-component vector of float) +0:? 'inb' (in 32-element array of highp 2-component vector of float) +0:? 'inc' (in 32-element array of highp 2-component vector of float) +0:? 'ind' (in 32-element array of highp 2-component vector of float) +0:? 'bla' (in block{in highp int f}) +0:? 'blb' (in 32-element array of block{in highp int f}) +0:? 'blc' (in 32-element array of block{in highp int f}) +0:? 'bld' (in 32-element array of block{in highp int f}) +0:? 'ivla' (layout(location=23 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout(location=24 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout(location=24 ) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout(location=23 ) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout(location=24 ) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' (patch in block{in highp int a}) +0:? 'myColor2' (centroid out highp 3-component vector of float) +0:? 'centr' (centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' (sample out highp 4-component vector of float) + + +Linked tessellation evaluation stage: + + +Shader version: 310 +Requested GL_ARB_separate_shader_objects +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +Requested GL_OES_shader_io_blocks +Requested GL_OES_tessellation_shader +input primitive = quads +vertex spacing = fractional_odd_spacing +triangle order = cw +using point mode +ERROR: node is still EOpNull! +0:24 Function Definition: main( (global void) +0:24 Function Parameters: +0:26 Sequence +0:26 Constant: +0:26 0.000000 +0:28 Sequence +0:28 move second child to first child (temp highp int) +0:28 'a' (temp highp int) +0:28 Constant: +0:28 1512 (const int) +0:36 Sequence +0:36 move second child to first child (temp highp 4-component vector of float) +0:36 'p' (temp highp 4-component vector of float) +0:36 gl_Position: direct index for structure (in highp 4-component vector of float) +0:36 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:36 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:36 Constant: +0:36 1 (const int) +0:36 Constant: +0:36 0 (const int) +0:37 Sequence +0:37 move second child to first child (temp highp float) +0:37 'ps' (temp highp float) +0:37 gl_PointSize: direct index for structure (in highp float) +0:37 direct index (temp block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:37 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position, in highp float gl_PointSize}) +0:37 Constant: +0:37 1 (const int) +0:37 Constant: +0:37 1 (const int) +0:38 Sequence +0:38 move second child to first child (temp highp float) +0:38 'cd' (temp highp float) +0:38 Constant: +0:38 0.000000 +0:40 Sequence +0:40 move second child to first child (temp highp int) +0:40 'pvi' (temp highp int) +0:40 'gl_PatchVerticesIn' (in highp int PatchVertices) +0:41 Sequence +0:41 move second child to first child (temp highp int) +0:41 'pid' (temp highp int) +0:41 'gl_PrimitiveID' (in highp int PrimitiveID) +0:42 Sequence +0:42 move second child to first child (temp highp 3-component vector of float) +0:42 'tc' (temp highp 3-component vector of float) +0:42 'gl_TessCoord' (in highp 3-component vector of float TessCoord) +0:43 Sequence +0:43 move second child to first child (temp highp float) +0:43 'tlo' (temp highp float) +0:43 direct index (patch temp highp float TessLevelOuter) +0:43 'gl_TessLevelOuter' (patch in 4-element array of highp float TessLevelOuter) +0:43 Constant: +0:43 3 (const int) +0:44 Sequence +0:44 move second child to first child (temp highp float) +0:44 'tli' (temp highp float) +0:44 direct index (patch temp highp float TessLevelInner) +0:44 'gl_TessLevelInner' (patch in 2-element array of highp float TessLevelInner) +0:44 Constant: +0:44 1 (const int) +0:46 move second child to first child (temp highp 4-component vector of float) +0:46 gl_Position: direct index for structure (gl_Position highp 4-component vector of float Position) +0:46 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:46 Constant: +0:46 0 (const uint) +0:46 'p' (temp highp 4-component vector of float) +0:47 move second child to first child (temp highp float) +0:47 gl_PointSize: direct index for structure (gl_PointSize highp float PointSize) +0:47 'anon@1' (out block{gl_Position highp 4-component vector of float Position gl_Position, gl_PointSize highp float PointSize gl_PointSize}) +0:47 Constant: +0:47 1 (const uint) +0:47 'ps' (temp highp float) +0:48 move second child to first child (temp highp float) +0:48 Constant: +0:48 0.000000 +0:48 'cd' (temp highp float) +0:? Linker Objects +0:? 'patchIn' (patch in highp 4-component vector of float) +0:? 'patchOut' (patch out highp 4-component vector of float) +0:? 'badp1' (smooth patch in highp 4-component vector of float) +0:? 'badp2' (flat patch in highp 4-component vector of float) +0:? 'badp3' (noperspective patch in highp 4-component vector of float) +0:? 'badp4' (patch sample in highp 3-component vector of float) +0:? 'gl_in' (in 32-element array of block{in highp 4-component vector of float gl_Position}) +0:? 'ina' (in highp 2-component vector of float) +0:? 'inb' (in 32-element array of highp 2-component vector of float) +0:? 'inc' (in 32-element array of highp 2-component vector of float) +0:? 'ind' (in 32-element array of highp 2-component vector of float) +0:? 'bla' (in block{in highp int f}) +0:? 'blb' (in 32-element array of block{in highp int f}) +0:? 'blc' (in 32-element array of block{in highp int f}) +0:? 'bld' (in 32-element array of block{in highp int f}) +0:? 'ivla' (layout(location=23 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlb' (layout(location=24 ) in 32-element array of highp 4-component vector of float) +0:? 'ivlc' (layout(location=24 ) in 32-element array of highp 4-component vector of float) +0:? 'ovla' (layout(location=23 ) out 2-element array of highp 4-component vector of float) +0:? 'ovlb' (layout(location=24 ) out 2-element array of highp 4-component vector of float) +0:? 'pinbi' (patch in block{in highp int a}) +0:? 'myColor2' (centroid out highp 3-component vector of float) +0:? 'centr' (centroid in 32-element array of highp 3-component vector of float) +0:? 'perSampleColor' (sample out highp 4-component vector of float) + diff --git a/Test/baseResults/310.vert.out b/Test/baseResults/310.vert.out index 901d3329..ff579124 100644 --- a/Test/baseResults/310.vert.out +++ b/Test/baseResults/310.vert.out @@ -17,7 +17,7 @@ ERROR: 0:83: 'vertex-shader struct output containing structure' : not supported ERROR: 0:85: 'std430 on a uniform block' : not supported with this profile: es 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:107: 'input block' : not supported in this stage: vertex 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' diff --git a/Test/baseResults/330.frag.out b/Test/baseResults/330.frag.out index 384066eb..c3bb92c5 100644 --- a/Test/baseResults/330.frag.out +++ b/Test/baseResults/330.frag.out @@ -32,7 +32,7 @@ ERROR: 0:125: 'index' : can only be used on an output ERROR: 0:126: 'index' : can only be used on an output ERROR: 0:126: 'location/component/index' : cannot declare a default, use a full declaration ERROR: 0:127: 'location/component/index' : cannot declare a default, use a full declaration -ERROR: 0:128: 'out' : cannot declare an output block in a fragment shader +ERROR: 0:128: 'output block' : not supported in this stage: fragment ERROR: 34 compilation errors. No code generated. diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index a673596e..d536a901 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -24,7 +24,7 @@ ERROR: 0:62: 'xxxxx' : illegal vector field selection ERROR: 0:63: 'xxy' : vector field selection out of range ERROR: 0:66: 'binding' : cannot declare a default, include a type or full declaration ERROR: 0:69: 'location/component/index' : cannot declare a default, use a full declaration -ERROR: 0:70: 'in' : cannot declare an input block in a vertex shader +ERROR: 0:70: 'input block' : not supported in this stage: vertex ERROR: 0:70: 'binding' : requires uniform or buffer storage qualifier ERROR: 0:71: 'binding' : binding is too large ERROR: 0:74: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index e63c1051..c3ef534f 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -1,7 +1,7 @@ 430.vert Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. ERROR: 0:3: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers -ERROR: 0:7: 'in' : cannot declare an input block in a vertex shader +ERROR: 0:7: 'input block' : not supported in this stage: vertex ERROR: 0:7: 'location qualifier on in/out block' : not supported for this version or the enabled extensions ERROR: 0:8: 'location qualifier on in/out block' : not supported for this version or the enabled extensions ERROR: 0:23: 'invariant' : can only apply to an output @@ -18,9 +18,9 @@ ERROR: 0:47: 'gl_ClipDistance array size' : must be less than gl_MaxClipDistance ERROR: 0:51: 'start' : undeclared identifier ERROR: 0:51: '' : constant expression required ERROR: 0:51: 'layout-id value' : scalar integer expression required -ERROR: 0:53: 'in' : cannot declare an input block in a vertex shader +ERROR: 0:53: 'input block' : not supported in this stage: vertex ERROR: 0:54: 'location on block member' : not supported for this version or the enabled extensions -ERROR: 0:57: 'in' : cannot declare an input block in a vertex shader +ERROR: 0:57: 'input block' : not supported in this stage: vertex ERROR: 0:58: 'location on block member' : not supported for this version or the enabled extensions ERROR: 0:59: 'location on block member' : not supported for this version or the enabled extensions ERROR: 0:62: 'uniform buffer-member align' : not supported for this version or the enabled extensions @@ -48,8 +48,8 @@ ERROR: 0:92: 'transform feedback qualifier' : not supported for this version or ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions ERROR: 0:93: 'transform feedback qualifier' : not supported for this version or the enabled extensions -ERROR: 0:117: 'in' : cannot declare an input block in a vertex shader -ERROR: 0:123: 'in' : cannot declare an input block in a vertex shader +ERROR: 0:117: 'input block' : not supported in this stage: vertex +ERROR: 0:123: 'input block' : not supported in this stage: vertex ERROR: 0:146: 'shared' : not supported in this stage: vertex ERROR: 0:150: 'barrier' : no matching overloaded function found ERROR: 0:154: 'memoryBarrierShared' : no matching overloaded function found diff --git a/Test/baseResults/440.frag.out b/Test/baseResults/440.frag.out index 40e489b8..fdc675f1 100644 --- a/Test/baseResults/440.frag.out +++ b/Test/baseResults/440.frag.out @@ -19,13 +19,13 @@ ERROR: 0:35: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:37: 'offset' : only applies to block members, not blocks ERROR: 0:38: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:38: 'offset' : only applies to block members, not blocks -ERROR: 0:39: 'out' : cannot declare an output block in a fragment shader +ERROR: 0:39: 'output block' : not supported in this stage: fragment ERROR: 0:39: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:39: 'offset' : only applies to block members, not blocks ERROR: 0:42: 'offset/align' : can only be used with std140 or std430 layout packing ERROR: 0:43: 'offset/align' : can only be used with std140 or std430 layout packing ERROR: 0:43: 'layout' : offset/align can only be used on a uniform or buffer -ERROR: 0:44: 'out' : cannot declare an output block in a fragment shader +ERROR: 0:44: 'output block' : not supported in this stage: fragment ERROR: 0:44: 'offset/align' : can only be used with std140 or std430 layout packing ERROR: 0:44: 'layout' : offset/align can only be used on a uniform or buffer ERROR: 0:46: 'offset' : cannot specify on a variable declaration diff --git a/Test/testlist b/Test/testlist index b77fd8cf..0e619a3c 100644 --- a/Test/testlist +++ b/Test/testlist @@ -40,6 +40,8 @@ comment.frag 310.vert 310.geom 310.frag +310.tesc +310.tese 310implicitSizeArrayError.vert 310AofA.vert 330.frag diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 95485c47..636b4425 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1054,7 +1054,7 @@ void TBuiltIns::initialize(int version, EProfile profile) // //============================================================================ bool esBarrier = (profile == EEsProfile && version >= 310); - if (profile != EEsProfile && version >= 150) + if (profile != EEsProfile && version >= 150 || esBarrier) stageBuiltins[EShLangTessControl].append( "void barrier();" ); @@ -2347,8 +2347,9 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); } - // geometry if (version >= 310) { + // geometry + snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryInputComponents = %d;", resources.maxGeometryInputComponents); s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputComponents = %d;", resources.maxGeometryOutputComponents); @@ -2367,6 +2368,46 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources.maxGeometryAtomicCounterBuffers); s.append(builtInConstant); + + // tessellation + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTextureImageUnits = %d;", resources.maxTessControlTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlUniformComponents = %d;", resources.maxTessControlUniformComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationTextureImageUnits = %d;", resources.maxTessEvaluationTextureImageUnits); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); + s.append(builtInConstant); + + // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices + if (language == EShLangTessControl || language == EShLangTessEvaluation) { + s.append( + "in gl_PerVertex {" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" + "} gl_in[gl_MaxPatchVertices];" + "\n"); + } } } else { @@ -2529,6 +2570,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); s.append(builtInConstant); + // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices if (language == EShLangTessControl || language == EShLangTessEvaluation) { s.append( "in gl_PerVertex {" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 48b82e6d..aab573c9 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2440,23 +2440,30 @@ void TParseContext::structArrayCheck(TSourceLoc /*loc*/, const TType& type) } } -void TParseContext::variableArrayUnsizedCheck(TSourceLoc loc, const TType& type, bool initializer) +void TParseContext::arrayUnsizedCheck(TSourceLoc loc, const TQualifier& qualifier, int size, 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) + if (parsingBuiltins || 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 (qualifier.storage == EvqVaryingIn) if (extensionsTurnedOn(Num_AEP_geometry_shader, AEP_geometry_shader)) return; break; case EShLangTessControl: - if (type.getQualifier().storage == EvqVaryingOut) + if ( qualifier.storage == EvqVaryingIn || + (qualifier.storage == EvqVaryingOut && ! qualifier.patch)) + if (extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) + return; + break; + case EShLangTessEvaluation: + if ((qualifier.storage == EvqVaryingIn && ! qualifier.patch) || + qualifier.storage == EvqVaryingOut) if (extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) return; break; @@ -2464,7 +2471,7 @@ void TParseContext::variableArrayUnsizedCheck(TSourceLoc loc, const TType& type, break; } - arraySizeRequiredCheck(loc, type.getArraySize()); + arraySizeRequiredCheck(loc, size); } void TParseContext::arrayDimError(TSourceLoc loc) @@ -4068,7 +4075,7 @@ TIntermNode* TParseContext::declareVariable(TSourceLoc loc, TString& identifier, if (arraySizes) type.setArraySizes(arraySizes); - variableArrayUnsizedCheck(loc, type, initializer != nullptr); + arrayUnsizedCheck(loc, type.getQualifier(), type.getArraySize(), initializer != nullptr); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol, newDeclaration); @@ -4525,7 +4532,9 @@ TIntermTyped* TParseContext::constructStruct(TIntermNode* node, const TType& typ // void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) { - blockStageIoCheck(loc, currentBlockQualifier.storage, arraySizes); + blockStageIoCheck(loc, currentBlockQualifier); + if (arraySizes) + arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes->getSize(), false); arrayDimCheck(loc, arraySizes, 0); // fix and check for member storage qualifiers and types that don't belong within a block @@ -4716,85 +4725,35 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr } // 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) +// with a particular stage. +void TParseContext::blockStageIoCheck(TSourceLoc loc, const TQualifier& qualifier) { - switch (storageQualifier) { + switch (qualifier.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"); - 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: + // It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader + // "Compute shaders do not permit user-defined input variables..." + requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask|EShLangFragmentMask), "input block"); + if (language == 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: - // ES 310 can have a block before shader_io is turned on, so skip this test for built-ins - if (! parsingBuiltins) - 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; - } + requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask), "output block"); + // ES 310 can have a block before shader_io is turned on, so skip this test for built-ins + if (language == EShLangVertex && ! parsingBuiltins) + profileRequires(loc, EEsProfile, 0, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block"); break; default: error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), ""); diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index ee9d892e..f27d5a56 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -127,7 +127,7 @@ public: bool arrayError(TSourceLoc, const TType&); void arraySizeRequiredCheck(TSourceLoc, int size); void structArrayCheck(TSourceLoc, const TType& structure); - void variableArrayUnsizedCheck(TSourceLoc, const TType&, bool initializer); + void arrayUnsizedCheck(TSourceLoc, const TQualifier&, int size, bool initializer); void arrayDimError(TSourceLoc); void arrayDimCheck(TSourceLoc, TArraySizes* sizes1, TArraySizes* sizes2); void arrayDimCheck(TSourceLoc, const TType*, TArraySizes*); @@ -181,7 +181,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 blockStageIoCheck(TSourceLoc, const TQualifier&); void fixBlockLocations(TSourceLoc, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockXfbOffsets(TQualifier&, TTypeList&); void fixBlockUniformOffsets(TQualifier&, TTypeList&); diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 83f16ce4..3c4975a4 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -723,10 +723,12 @@ int TScanContext::tokenizeIdentifier() return keyword; case PATCH: - if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionsTurnedOn(1, &GL_ARB_tessellation_shader)) - return es30ReservedFromGLSL(150); - else - return es30ReservedFromGLSL(400); + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.profile == EEsProfile && parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader)) || + (parseContext.profile != EEsProfile && parseContext.extensionsTurnedOn(1, &GL_ARB_tessellation_shader))) + return keyword; + + return es30ReservedFromGLSL(400); case SAMPLE: case SUBROUTINE: diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 7f9d5c9b..21777ae5 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -186,7 +186,7 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[GL_EXT_gpu_shader5] = EBhDisablePartial; extensionBehavior[GL_EXT_primitive_bounding_box] = EBhDisablePartial; extensionBehavior[GL_EXT_shader_io_blocks] = EBhDisable; - extensionBehavior[GL_EXT_tessellation_shader] = EBhDisablePartial; + extensionBehavior[GL_EXT_tessellation_shader] = EBhDisable; extensionBehavior[GL_EXT_tessellation_point_size] = EBhDisablePartial; extensionBehavior[GL_EXT_texture_buffer] = EBhDisablePartial; extensionBehavior[GL_EXT_texture_cube_map_array] = EBhDisablePartial; @@ -196,7 +196,7 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[GL_OES_gpu_shader5] = EBhDisablePartial; extensionBehavior[GL_OES_primitive_bounding_box] = EBhDisablePartial; extensionBehavior[GL_OES_shader_io_blocks] = EBhDisable; - extensionBehavior[GL_OES_tessellation_shader] = EBhDisablePartial; + extensionBehavior[GL_OES_tessellation_shader] = EBhDisable; extensionBehavior[GL_OES_texture_buffer] = EBhDisablePartial; extensionBehavior[GL_OES_texture_cube_map_array] = EBhDisablePartial; }