From 9312269d09fd4d8333e48f49def9a0e7bb57f9ad Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 11 Sep 2015 15:25:38 -0600 Subject: [PATCH] Front-end Arrays of arrays: Add ES-specific checks and tests. AoA should be quite close to done now. --- Test/310.comp | 2 + Test/310.frag | 2 + Test/310AofA.vert | 101 +++ Test/430.comp | 2 +- Test/baseResults/300.frag.out | 3 +- Test/baseResults/300.vert.out | 2 +- Test/baseResults/310.comp.out | 4 +- Test/baseResults/310.frag.out | 5 +- Test/baseResults/310AofA.vert.out | 592 +++++++++++++++++- .../310implicitSizeArrayError.vert.out | 2 +- Test/baseResults/430.comp.out | 3 +- glslang/Include/arrays.h | 1 + glslang/Include/revision.h | 2 +- glslang/MachineIndependent/ParseHelper.cpp | 36 +- glslang/MachineIndependent/ParseHelper.h | 4 +- glslang/MachineIndependent/glslang.y | 14 +- 16 files changed, 742 insertions(+), 33 deletions(-) diff --git a/Test/310.comp b/Test/310.comp index 4c2cfd71f..d6b2c97d8 100644 --- a/Test/310.comp +++ b/Test/310.comp @@ -236,3 +236,5 @@ float t__; // ERROR, no __ until revision 310 // ERROR, no __ until revision 310 #define __D + +shared vec4 arr[2][3][4]; diff --git a/Test/310.frag b/Test/310.frag index 116a0a733..78f13f60b 100644 --- a/Test/310.frag +++ b/Test/310.frag @@ -427,3 +427,5 @@ layout(blend_support_hsl_luminosity) struct badS {int i;}; // ERROR, only on layout(blend_support_hsl_luminosity) void blendFoo() { } // ERROR, only on standalone void blendFoo(layout(blend_support_hsl_luminosity) vec3 v) { } // ERROR, only on standalone layout(blend_support_flizbit) out; // ERROR, no flizbit + +out vec4 outAA[2][2]; // ERROR diff --git a/Test/310AofA.vert b/Test/310AofA.vert index eb68d8937..a196388de 100644 --- a/Test/310AofA.vert +++ b/Test/310AofA.vert @@ -12,3 +12,104 @@ void main() { int[NY][NX] d; f(false, 12.1, uint[NZ](uint(0),uint(1),uint(1),uint(2)), d); } + +buffer b { + float u[]; // ERROR + vec4 v[]; +} name[3]; + +uniform ub { + float u; + vec4 v[]; // ERROR +} uname[3]; + +buffer b2 { + float u; + vec4 v[][]; // ERROR +} name2[3]; + +buffer b3 { + float u; + vec4 v[][7]; +} name3[3]; + +// General arrays of arrays + +float[4][5][6] many[1][2][3]; + +float gu[][7]; // ERROR, size required +float g4[4][7]; +float g5[5][7]; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + float[](a[0], a[1], r, a[3]); // ERROR, too few dims + float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims + return float[4][7](a[0], a[1], r, a[3]); + return float[][](a[0], a[1], r, a[3]); + return float[][7](a[0], a[1], a[2], a[3]); +} + +void bar(float[5][7]) {} + +void foo2() +{ + { + float gu[3][4][2]; + + gu[2][4][1] = 4.0; // ERROR, overflow + } + vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + + g4 = foo(g5); + g5 = g4; // ERROR, wrong types + gu = g4; // ERROR, not yet sized + + foo(gu); // ERROR, not yet sized + bar(g5); + + if (foo(g5) == g4) + ; + if (foo(g5) == g5) // ERROR, different types + ; + + float u[5][7]; + u[5][2] = 5.0; // ERROR + foo(u); + + vec4 badAss[3]; + name[1].v[-1]; // ERROR + name[1].v[1] = vec4(4.3); + name[1].v = badAss; // ERROR, bad assignemnt + + name3[0].v[1].length(); // 7 + name3[0].v.length(); // run time +} + +struct badS { + int sa[]; // ERROR + int a[][]; // ERROR + int b[][2]; // ERROR + int c[2][]; // ERROR + int d[][4]; // ERROR +}; + +in float inArray[2][3]; // ERROR +out float outArray[2][3]; // ERROR + +uniform ubaa { + int a; +} ubaaname[2][3]; // ERROR diff --git a/Test/430.comp b/Test/430.comp index 663fddeca..0929432ba 100644 --- a/Test/430.comp +++ b/Test/430.comp @@ -20,7 +20,7 @@ buffer ShaderStorageBlock buffer InvalidShaderStorageBlock { - float values[]; // ERROR + float values[]; int value; } invalid; diff --git a/Test/baseResults/300.frag.out b/Test/baseResults/300.frag.out index b175028ee..a21667e61 100644 --- a/Test/baseResults/300.frag.out +++ b/Test/baseResults/300.frag.out @@ -26,6 +26,7 @@ ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled ERROR: 0:102: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:103: 'arrays of arrays' : not supported for this version or the enabled extensions ERROR: 0:100: 'arrays of arrays' : not supported for this version or the enabled extensions +ERROR: 0:100: 'array-of-array of block' : not supported with this profile: es ERROR: 0:111: 'variable indexing fragment shader ouput array' : not supported with this profile: es ERROR: 0:119: '==' : can't use with samplers or structs containing samplers ERROR: 0:120: '!=' : can't use with samplers or structs containing samplers @@ -42,7 +43,7 @@ ERROR: 0:157: 'invariant' : can only apply to an output ERROR: 0:158: 'invariant' : can only apply to an output ERROR: 0:160: 'imageBuffer' : Reserved word. ERROR: 0:160: '' : syntax error -ERROR: 43 compilation errors. No code generated. +ERROR: 44 compilation errors. No code generated. Shader version: 300 diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out index cb861f6c3..d3d7cba35 100644 --- a/Test/baseResults/300.vert.out +++ b/Test/baseResults/300.vert.out @@ -17,7 +17,7 @@ ERROR: 0:56: '#error' : GL_ES is set ERROR: 0:62: '' : array size required ERROR: 0:63: '' : array size required ERROR: 0:64: '' : array size required -ERROR: 0:65: 'implicitly-sized array in a block' : not supported with this profile: es +ERROR: 0:65: '' : array size required ERROR: 0:67: '' : array size required ERROR: 0:76: 'invariant' : cannot change qualification after use ERROR: 0:78: 'invariant' : can only apply to an output diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index 645b2ccdf..f3775e37a 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -2,7 +2,7 @@ Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. ERROR: 0:4: 'local_size' : cannot change previously set size ERROR: 0:5: 'local_size' : too large; see gl_MaxComputeWorkGroupSize -ERROR: 0:23: 'values' : only the last member of a buffer block can be run-time sized +ERROR: 0:23: '' : array size required ERROR: 0:39: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:39: 'location qualifier on input' : not supported in this stage: compute ERROR: 0:40: 'in' : global storage input qualifier cannot be used in a compute shader @@ -502,6 +502,7 @@ ERROR: node is still EOpNull! 0:? 'inbi' (in block{in highp int a}) 0:? 'outbi' (out block{out highp int a}) 0:? 't__' (global highp float) +0:? 'arr' (shared 2-element array of 3-element array of 4-element array of highp 4-component vector of float) Linked compute stage: @@ -928,4 +929,5 @@ ERROR: node is still EOpNull! 0:? 'inbi' (in block{in highp int a}) 0:? 'outbi' (out block{out highp int a}) 0:? 't__' (global highp float) +0:? 'arr' (shared 2-element array of 3-element array of 4-element array of highp 4-component vector of float) diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out index 910cd9c55..9769eb6ad 100644 --- a/Test/baseResults/310.frag.out +++ b/Test/baseResults/310.frag.out @@ -129,7 +129,8 @@ ERROR: 0:426: 'blend equation' : can only apply to a standalone qualifier ERROR: 0:427: 'blend equation' : can only apply to a standalone qualifier ERROR: 0:428: 'blend equation' : can only apply to a standalone qualifier ERROR: 0:429: 'blend_support' : unknown blend equation -ERROR: 121 compilation errors. No code generated. +ERROR: 0:431: 'fragment-shader array-of-array output' : not supported with this profile: es +ERROR: 122 compilation errors. No code generated. Shader version: 310 @@ -1006,6 +1007,7 @@ ERROR: node is still EOpNull! 0:? 'colorfsi' (flat sample in mediump 4-component vector of float) 0:? 'sampInArray' (smooth sample in 4-element array of mediump 3-component vector of float) 0:? 'badout' (out mediump 4-component vector of float) +0:? 'outAA' (out 2-element array of 2-element array of mediump 4-component vector of float) Linked fragment stage: @@ -1886,4 +1888,5 @@ ERROR: node is still EOpNull! 0:? 'colorfsi' (flat sample in mediump 4-component vector of float) 0:? 'sampInArray' (smooth sample in 4-element array of mediump 3-component vector of float) 0:? 'badout' (out mediump 4-component vector of float) +0:? 'outAA' (out 2-element array of 2-element array of mediump 4-component vector of float) diff --git a/Test/baseResults/310AofA.vert.out b/Test/baseResults/310AofA.vert.out index 63598fcf1..476646ca2 100644 --- a/Test/baseResults/310AofA.vert.out +++ b/Test/baseResults/310AofA.vert.out @@ -1,8 +1,32 @@ 310AofA.vert Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:17: '' : array size required +ERROR: 0:23: '' : array size required +ERROR: 0:28: '[]' : only outermost dimension of an array of arrays can be implicitly sized +ERROR: 0:40: '' : array size required +ERROR: 0:48: 'constructor' : constructing non-array constituent from array argument +ERROR: 0:49: 'constructior' : array constructor argument not correct type to construct array element +ERROR: 0:62: '[' : array index out of range '4' +ERROR: 0:78: 'assign' : cannot convert from 'global 4-element array of 7-element array of highp float' to 'global 5-element array of 7-element array of highp float' +ERROR: 0:79: 'assign' : cannot convert from 'global 4-element array of 7-element array of highp float' to 'global implicitly-sized array of 7-element array of highp float' +ERROR: 0:81: 'foo' : no matching overloaded function found +ERROR: 0:86: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type 'global 4-element array of 7-element array of highp float' and a right operand of type 'global 5-element array of 7-element array of highp float' (or there is no acceptable conversion) +ERROR: 0:90: '[' : array index out of range '5' +ERROR: 0:94: '[' : index out of range '-1' +ERROR: 0:96: 'assign' : cannot convert from 'temp 3-element array of highp 4-component vector of float' to 'layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float' +ERROR: 0:103: '' : array size required +ERROR: 0:104: '' : array size required +ERROR: 0:105: '' : array size required +ERROR: 0:106: '' : array size required +ERROR: 0:107: '' : array size required +ERROR: 0:110: 'vertex input arrays' : not supported with this profile: es +ERROR: 0:111: 'vertex-shader array-of-array output' : not supported with this profile: es +ERROR: 0:113: 'array-of-array of block' : not supported with this profile: es +ERROR: 22 compilation errors. No code generated. + Shader version: 310 -0:? Sequence +ERROR: node is still EOpNull! 0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; (global void) 0:8 Function Parameters: 0:8 'a' (in bool) @@ -23,7 +47,289 @@ Shader version: 310 0:13 1 (const uint) 0:13 2 (const uint) 0:13 'd' (temp 3-element array of 2-element array of highp int) +0:44 Function Definition: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:44 Function Parameters: +0:44 'a' (in 5-element array of 7-element array of highp float) +0:? Sequence +0:47 move second child to first child (temp 7-element array of highp float) +0:47 'r' (temp 7-element array of highp float) +0:47 direct index (temp 7-element array of highp float) +0:47 'a' (in 5-element array of 7-element array of highp float) +0:47 Constant: +0:47 2 (const int) +0:48 Constant: +0:48 0.000000 +0:49 Constant: +0:49 0.000000 +0:50 Branch: Return with expression +0:50 Construct float (temp 4-element array of 7-element array of float) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 0 (const int) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 1 (const int) +0:50 'r' (temp 7-element array of highp float) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 3 (const int) +0:51 Branch: Return with expression +0:51 Construct float (temp 4-element array of 7-element array of float) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 0 (const int) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 1 (const int) +0:51 'r' (temp 7-element array of highp float) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 3 (const int) +0:52 Branch: Return with expression +0:52 Construct float (temp 4-element array of 7-element array of float) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 0 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 1 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 2 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 3 (const int) +0:55 Function Definition: bar(f1[5][7]; (global void) +0:55 Function Parameters: +0:55 '' (in 5-element array of 7-element array of highp float) +0:57 Function Definition: foo2( (global void) +0:57 Function Parameters: +0:? Sequence +0:? Sequence +0:62 move second child to first child (temp highp float) +0:62 direct index (temp highp float) +0:62 direct index (temp 2-element array of highp float) +0:62 direct index (temp 4-element array of 2-element array of highp float) +0:62 'gu' (temp 3-element array of 4-element array of 2-element array of highp float) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 4 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 4.000000 +0:64 Sequence +0:64 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:64 'ca4' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:66 Constant: +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:67 Sequence +0:67 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:67 'caim' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:69 Constant: +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:70 Sequence +0:70 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:70 'caim2' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:72 Constant: +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:73 Sequence +0:73 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:73 'caim3' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:75 Constant: +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:77 move second child to first child (temp 4-element array of 7-element array of highp float) +0:77 'g4' (global 4-element array of 7-element array of highp float) +0:77 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:77 'g5' (global 5-element array of 7-element array of highp float) +0:78 'g5' (global 5-element array of 7-element array of highp float) +0:79 'gu' (global implicitly-sized array of 7-element array of highp float) +0:81 Constant: +0:81 0.000000 +0:82 Function Call: bar(f1[5][7]; (global void) +0:82 'g5' (global 5-element array of 7-element array of highp float) +0:84 Test condition and select (temp void) +0:84 Condition +0:84 Compare Equal (temp bool) +0:84 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:84 'g5' (global 5-element array of 7-element array of highp float) +0:84 'g4' (global 4-element array of 7-element array of highp float) +0:84 true case is null +0:86 Test condition and select (temp void) +0:86 Condition +0:86 Constant: +0:86 false (const bool) +0:86 true case is null +0:90 move second child to first child (temp highp float) +0:90 direct index (temp highp float) +0:90 direct index (temp 7-element array of highp float) +0:90 'u' (temp 5-element array of 7-element array of highp float) +0:90 Constant: +0:90 5 (const int) +0:90 Constant: +0:90 2 (const int) +0:90 Constant: +0:90 5.000000 +0:91 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:91 'u' (temp 5-element array of 7-element array of highp float) +0:94 direct index (layout(column_major shared ) temp highp 4-component vector of float) +0:94 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:94 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:94 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 -1 (const int) +0:95 move second child to first child (temp highp 4-component vector of float) +0:95 direct index (layout(column_major shared ) temp highp 4-component vector of float) +0:95 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:95 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:95 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:96 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:96 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:96 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:96 Constant: +0:96 1 (const int) +0:96 Constant: +0:96 1 (const int) +0:98 Constant: +0:98 7 (const int) +0:99 array length (temp highp int) +0:99 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float) +0:99 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:99 'name3' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) 0:? Linker Objects +0:? 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:? 'uname' (layout(column_major shared ) uniform 3-element array of block{layout(column_major shared ) uniform highp float u, layout(column_major shared ) uniform implicitly-sized array of highp 4-component vector of float v}) +0:? 'name2' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of implicitly-sized array of highp 4-component vector of float v}) +0:? 'name3' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:? 'many' (global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) +0:? 'gu' (global implicitly-sized array of 7-element array of highp float) +0:? 'g4' (global 4-element array of 7-element array of highp float) +0:? 'g5' (global 5-element array of 7-element array of highp float) +0:? 'inArray' (in 2-element array of 3-element array of highp float) +0:? 'outArray' (smooth out 2-element array of 3-element array of highp float) +0:? 'ubaaname' (layout(column_major shared ) uniform 2-element array of 3-element array of block{layout(column_major shared ) uniform highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) @@ -32,7 +338,7 @@ Linked vertex stage: Shader version: 310 -0:? Sequence +ERROR: node is still EOpNull! 0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; (global void) 0:8 Function Parameters: 0:8 'a' (in bool) @@ -53,7 +359,289 @@ Shader version: 310 0:13 1 (const uint) 0:13 2 (const uint) 0:13 'd' (temp 3-element array of 2-element array of highp int) +0:44 Function Definition: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:44 Function Parameters: +0:44 'a' (in 5-element array of 7-element array of highp float) +0:? Sequence +0:47 move second child to first child (temp 7-element array of highp float) +0:47 'r' (temp 7-element array of highp float) +0:47 direct index (temp 7-element array of highp float) +0:47 'a' (in 5-element array of 7-element array of highp float) +0:47 Constant: +0:47 2 (const int) +0:48 Constant: +0:48 0.000000 +0:49 Constant: +0:49 0.000000 +0:50 Branch: Return with expression +0:50 Construct float (temp 4-element array of 7-element array of float) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 0 (const int) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 1 (const int) +0:50 'r' (temp 7-element array of highp float) +0:50 direct index (temp 7-element array of highp float) +0:50 'a' (in 5-element array of 7-element array of highp float) +0:50 Constant: +0:50 3 (const int) +0:51 Branch: Return with expression +0:51 Construct float (temp 4-element array of 7-element array of float) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 0 (const int) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 1 (const int) +0:51 'r' (temp 7-element array of highp float) +0:51 direct index (temp 7-element array of highp float) +0:51 'a' (in 5-element array of 7-element array of highp float) +0:51 Constant: +0:51 3 (const int) +0:52 Branch: Return with expression +0:52 Construct float (temp 4-element array of 7-element array of float) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 0 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 1 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 2 (const int) +0:52 direct index (temp 7-element array of highp float) +0:52 'a' (in 5-element array of 7-element array of highp float) +0:52 Constant: +0:52 3 (const int) +0:55 Function Definition: bar(f1[5][7]; (global void) +0:55 Function Parameters: +0:55 '' (in 5-element array of 7-element array of highp float) +0:57 Function Definition: foo2( (global void) +0:57 Function Parameters: +0:? Sequence +0:? Sequence +0:62 move second child to first child (temp highp float) +0:62 direct index (temp highp float) +0:62 direct index (temp 2-element array of highp float) +0:62 direct index (temp 4-element array of 2-element array of highp float) +0:62 'gu' (temp 3-element array of 4-element array of 2-element array of highp float) +0:62 Constant: +0:62 2 (const int) +0:62 Constant: +0:62 4 (const int) +0:62 Constant: +0:62 1 (const int) +0:62 Constant: +0:62 4.000000 +0:64 Sequence +0:64 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:64 'ca4' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:66 Constant: +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 0.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:66 1.000000 +0:67 Sequence +0:67 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:67 'caim' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:69 Constant: +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 4.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:69 2.000000 +0:70 Sequence +0:70 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:70 'caim2' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:72 Constant: +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 4.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:72 2.000000 +0:73 Sequence +0:73 move second child to first child (temp 3-element array of 2-element array of highp 4-component vector of float) +0:73 'caim3' (temp 3-element array of 2-element array of highp 4-component vector of float) +0:75 Constant: +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 4.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:75 2.000000 +0:77 move second child to first child (temp 4-element array of 7-element array of highp float) +0:77 'g4' (global 4-element array of 7-element array of highp float) +0:77 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:77 'g5' (global 5-element array of 7-element array of highp float) +0:78 'g5' (global 5-element array of 7-element array of highp float) +0:79 'gu' (global 1-element array of 7-element array of highp float) +0:81 Constant: +0:81 0.000000 +0:82 Function Call: bar(f1[5][7]; (global void) +0:82 'g5' (global 5-element array of 7-element array of highp float) +0:84 Test condition and select (temp void) +0:84 Condition +0:84 Compare Equal (temp bool) +0:84 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:84 'g5' (global 5-element array of 7-element array of highp float) +0:84 'g4' (global 4-element array of 7-element array of highp float) +0:84 true case is null +0:86 Test condition and select (temp void) +0:86 Condition +0:86 Constant: +0:86 false (const bool) +0:86 true case is null +0:90 move second child to first child (temp highp float) +0:90 direct index (temp highp float) +0:90 direct index (temp 7-element array of highp float) +0:90 'u' (temp 5-element array of 7-element array of highp float) +0:90 Constant: +0:90 5 (const int) +0:90 Constant: +0:90 2 (const int) +0:90 Constant: +0:90 5.000000 +0:91 Function Call: foo(f1[5][7]; (global 4-element array of 7-element array of highp float) +0:91 'u' (temp 5-element array of 7-element array of highp float) +0:94 direct index (layout(column_major shared ) temp highp 4-component vector of float) +0:94 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:94 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:94 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 1 (const int) +0:94 Constant: +0:94 -1 (const int) +0:95 move second child to first child (temp highp 4-component vector of float) +0:95 direct index (layout(column_major shared ) temp highp 4-component vector of float) +0:95 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:95 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:95 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 1 (const int) +0:95 Constant: +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:95 4.300000 +0:96 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float) +0:96 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:96 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:96 Constant: +0:96 1 (const int) +0:96 Constant: +0:96 1 (const int) +0:98 Constant: +0:98 7 (const int) +0:99 array length (temp highp int) +0:99 v: direct index for structure (layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float) +0:99 direct index (layout(column_major shared ) temp block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:99 'name3' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:99 Constant: +0:99 0 (const int) +0:99 Constant: +0:99 1 (const int) 0:? Linker Objects +0:? 'name' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer implicitly-sized array of highp float u, layout(column_major shared ) buffer implicitly-sized array of highp 4-component vector of float v}) +0:? 'uname' (layout(column_major shared ) uniform 3-element array of block{layout(column_major shared ) uniform highp float u, layout(column_major shared ) uniform 1-element array of highp 4-component vector of float v}) +0:? 'name2' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of implicitly-sized array of highp 4-component vector of float v}) +0:? 'name3' (layout(column_major shared ) buffer 3-element array of block{layout(column_major shared ) buffer highp float u, layout(column_major shared ) buffer implicitly-sized array of 7-element array of highp 4-component vector of float v}) +0:? 'many' (global 1-element array of 2-element array of 3-element array of 4-element array of 5-element array of 6-element array of highp float) +0:? 'gu' (global 1-element array of 7-element array of highp float) +0:? 'g4' (global 4-element array of 7-element array of highp float) +0:? 'g5' (global 5-element array of 7-element array of highp float) +0:? 'inArray' (in 2-element array of 3-element array of highp float) +0:? 'outArray' (smooth out 2-element array of 3-element array of highp float) +0:? 'ubaaname' (layout(column_major shared ) uniform 2-element array of 3-element array of block{layout(column_major shared ) uniform highp int a}) 0:? 'gl_VertexID' (gl_VertexId highp int VertexId) 0:? 'gl_InstanceID' (gl_InstanceId highp int InstanceId) diff --git a/Test/baseResults/310implicitSizeArrayError.vert.out b/Test/baseResults/310implicitSizeArrayError.vert.out index 958b668f1..a3b98f333 100644 --- a/Test/baseResults/310implicitSizeArrayError.vert.out +++ b/Test/baseResults/310implicitSizeArrayError.vert.out @@ -1,6 +1,6 @@ 310implicitSizeArrayError.vert Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:3: 'implicitly-sized array in a block' : not supported with this profile: es +ERROR: 0:3: '' : array size required ERROR: 1 compilation errors. No code generated. diff --git a/Test/baseResults/430.comp.out b/Test/baseResults/430.comp.out index 29f0f87bd..538caa0a0 100644 --- a/Test/baseResults/430.comp.out +++ b/Test/baseResults/430.comp.out @@ -2,7 +2,6 @@ Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. ERROR: 0:4: 'local_size' : cannot change previously set size ERROR: 0:5: 'local_size' : too large; see gl_MaxComputeWorkGroupSize -ERROR: 0:23: 'values' : only the last member of a buffer block can be run-time sized ERROR: 0:43: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:43: 'location qualifier on input' : not supported in this stage: compute ERROR: 0:44: 'in' : global storage input qualifier cannot be used in a compute shader @@ -17,7 +16,7 @@ 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: 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. +ERROR: 16 compilation errors. No code generated. Shader version: 430 diff --git a/glslang/Include/arrays.h b/glslang/Include/arrays.h index cc2cdab27..1d8ec4353 100644 --- a/glslang/Include/arrays.h +++ b/glslang/Include/arrays.h @@ -224,6 +224,7 @@ struct TArraySizes { return false; } + bool isImplicit() const { return getOuterSize() == UnsizedArraySize || isInnerImplicit(); } void addOuterSizes(const TArraySizes& s) { sizes.push_front(s.sizes); } void dereference() { sizes.pop_front(); } void copyDereferenced(const TArraySizes& rhs) diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 37a027a40..abb7f139d 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "3.0.747" +#define GLSLANG_REVISION "3.0.748" #define GLSLANG_DATE "11-Sep-2015" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index e0f13fbfb..4ab1c9f00 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2738,16 +2738,20 @@ bool TParseContext::arrayError(const TSourceLoc& loc, const TType& type) else if (type.isStruct()) requireProfile(loc, ~EEsProfile, "fragment-shader array-of-struct input"); } + if (type.getQualifier().storage == EvqVaryingOut && language == EShLangFragment) { + if (type.isArrayOfArrays()) + requireProfile(loc, ~EEsProfile, "fragment-shader array-of-array output"); + } return false; } // -// Require array to have size +// Require array to be completely sized // -void TParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, int size) +void TParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) { - if (size == UnsizedArraySize) + if (arraySizes.isImplicit()) error(loc, "array size required", "", ""); } @@ -2756,12 +2760,12 @@ void TParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& typ 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()) - arraySizeRequiredCheck(structure[m].loc, 0); + if (member.isArray()) + arraySizeRequiredCheck(structure[m].loc, *member.getArraySizes()); } } -void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer) +void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& qualifier, const TArraySizes* arraySizes, bool initializer, bool lastMember) { assert(arraySizes); @@ -2783,6 +2787,12 @@ void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& q // for ES, if size isn't coming from an initializer, it has to be explicitly declared now, // with very few exceptions + + // last member of ssbo block exception: + if (qualifier.storage == EvqBuffer && lastMember) + return; + + // implicitly-sized io exceptions: switch (language) { case EShLangGeometry: if (qualifier.storage == EvqVaryingIn) @@ -2805,7 +2815,7 @@ void TParseContext::arrayUnsizedCheck(const TSourceLoc& loc, const TQualifier& q break; } - arraySizeRequiredCheck(loc, arraySizes->getOuterSize()); + arraySizeRequiredCheck(loc, *arraySizes); } void TParseContext::arrayOfArrayVersionCheck(const TSourceLoc& loc) @@ -4463,7 +4473,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden arrayDimMerge(type, arraySizes); // Check that implicit sizing is only where allowed. - arrayUnsizedCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr); + arrayUnsizedCheck(loc, type.getQualifier(), &type.getArraySizes(), initializer != nullptr, false); if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type)) declareArray(loc, identifier, type, symbol, newDeclaration); @@ -4947,8 +4957,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con blockStageIoCheck(loc, currentBlockQualifier); blockQualifierCheck(loc, currentBlockQualifier); if (arraySizes) { - arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes, false); + arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes, false, false); arrayDimCheck(loc, arraySizes, 0); + if (arraySizes->getNumDims() > 1) + requireProfile(loc, ~EEsProfile, "array-of-array of block"); } // fix and check for member storage qualifiers and types that don't belong within a block @@ -4962,10 +4974,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con memberQualifier.storage = currentBlockQualifier.storage; if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary())) error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), ""); - if (memberType.isRuntimeSizedArray() && member < typeList.size() - 1) - error(memberLoc, "only the last member of a buffer block can be run-time sized", memberType.getFieldName().c_str(), ""); - if (memberType.isImplicitlySizedArray()) - requireProfile(memberLoc, ~EEsProfile, "implicitly-sized array in a block"); + if (memberType.isArray()) + arrayUnsizedCheck(memberLoc, currentBlockQualifier, &memberType.getArraySizes(), false, member == typeList.size() - 1); if (memberQualifier.hasOffset()) { requireProfile(memberLoc, ~EEsProfile, "offset on block member"); profileRequires(memberLoc, ~EEsProfile, 440, E_GL_ARB_enhanced_layouts, "offset on block member"); diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 17a5b3fdd..771a43e28 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -137,9 +137,9 @@ public: void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, int& size); bool arrayQualifierError(const TSourceLoc&, const TQualifier&); bool arrayError(const TSourceLoc&, const TType&); - void arraySizeRequiredCheck(const TSourceLoc&, int size); + void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); void structArrayCheck(const TSourceLoc&, const TType& structure); - void arrayUnsizedCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer); + void arrayUnsizedCheck(const TSourceLoc&, const TQualifier&, const TArraySizes*, bool initializer, bool lastMember); void arrayOfArrayVersionCheck(const TSourceLoc&); void arrayDimCheck(const TSourceLoc&, const TArraySizes* sizes1, const TArraySizes* sizes2); void arrayDimCheck(const TSourceLoc&, const TType*, const TArraySizes*); diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 0c8775772..e7eb32027 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -798,7 +798,7 @@ function_header GetStorageQualifierString($1.qualifier.storage), ""); } if ($1.arraySizes) - parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); // Add the function as a prototype after parsing it (we do not support recursion) TFunction *function; @@ -814,7 +814,7 @@ parameter_declarator if ($1.arraySizes) { parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } if ($1.basicType == EbtVoid) { parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), ""); @@ -829,11 +829,11 @@ parameter_declarator if ($1.arraySizes) { parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } parseContext.arrayDimCheck($2.loc, $1.arraySizes, $3.arraySizes); - parseContext.arraySizeRequiredCheck($3.loc, $3.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes); parseContext.reservedErrorCheck($2.loc, *$2.string); $1.arraySizes = $3.arraySizes; @@ -893,7 +893,7 @@ parameter_type_specifier TParameter param = { 0, new TType($1) }; $$.param = param; if ($1.arraySizes) - parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } ; @@ -1962,7 +1962,7 @@ struct_declaration parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type"); if (parseContext.profile == EEsProfile) - parseContext.arraySizeRequiredCheck($1.loc, $1.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes); } $$ = $2; @@ -1981,7 +1981,7 @@ struct_declaration parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type"); if (parseContext.profile == EEsProfile) - parseContext.arraySizeRequiredCheck($2.loc, $2.arraySizes->getOuterSize()); + parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes); } $$ = $3;