--- /dev/null
+#version 310 es
+
+// Check name mangling of functions with parameters that are multi-dimensional arrays.
+
+#define NX 2
+#define NY 3
+#define NZ 4
+void f(bool a, float b, uint[4] c, int[NY][NX] d) {
+}
+
+void main() {
+ int[NY][NX] d;
+ f(false, 12.1, uint[NZ](uint(0),uint(1),uint(1),uint(2)), d);
+}
ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none\r
ERROR: 0:40: 'constructor' : array constructor needs one argument per array element \r
ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none\r
-ERROR: 0:40: '=' : cannot convert from 'const float' to 'temp 2-element array of float'\r
+ERROR: 0:40: '=' : cannot convert from 'const float' to 'temp 2-element array of 3-element array of float'\r
ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none\r
ERROR: 0:41: 'constructor' : array constructor needs one argument per array element \r
ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none\r
-ERROR: 0:41: '=' : cannot convert from 'const float' to 'temp 2-element array of float'\r
+ERROR: 0:41: '=' : cannot convert from 'const float' to 'temp 2-element array of 3-element array of float'\r
ERROR: 0:50: 'arrays of arrays' : not supported with this profile: none\r
ERROR: 0:51: 'arrays of arrays' : not supported with this profile: none\r
ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none\r
0:? 'sc' (out lowp 3-component vector of float)\r
0:? 'sf' (out lowp float)\r
0:? 'arrayedSampler' (uniform 5-element array of lowp sampler2D)\r
-0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of block{layout(column_major shared ) uniform 2-element array of mediump int a, layout(column_major shared ) uniform 2-element array of mediump int b, layout(column_major shared ) uniform 2-element array of mediump int c})\r
+0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of 3-element array of block{layout(column_major shared ) uniform 2-element array of mediump int a, layout(column_major shared ) uniform 2-element array of 3-element array of mediump int b, layout(column_major shared ) uniform 2-element array of 3-element array of mediump int c})\r
0:? 'colors' (out 4-element array of lowp 4-component vector of float)\r
0:? 'st1' (uniform structure{global mediump int i, global lowp sampler2D s})\r
0:? 'st2' (uniform structure{global mediump int i, global lowp sampler2D s})\r
0:? 'sc' (out lowp 3-component vector of float)\r
0:? 'sf' (out lowp float)\r
0:? 'arrayedSampler' (uniform 5-element array of lowp sampler2D)\r
-0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of block{layout(column_major shared ) uniform 2-element array of mediump int a, layout(column_major shared ) uniform 2-element array of mediump int b, layout(column_major shared ) uniform 2-element array of mediump int c})\r
+0:? 'multiInst' (layout(column_major shared ) uniform 2-element array of 3-element array of block{layout(column_major shared ) uniform 2-element array of mediump int a, layout(column_major shared ) uniform 2-element array of 3-element array of mediump int b, layout(column_major shared ) uniform 2-element array of 3-element array of mediump int c})\r
0:? 'colors' (out 4-element array of lowp 4-component vector of float)\r
0:? 'st1' (uniform structure{global mediump int i, global lowp sampler2D s})\r
0:? 'st2' (uniform structure{global mediump int i, global lowp sampler2D s})\r
0:? 'inb' (smooth in bool)\r
0:? 'ino' (smooth in highp sampler2D)\r
0:? 'ina' (smooth in 4-element array of mediump float)\r
-0:? 'inaa' (smooth in 4-element array of mediump float)\r
+0:? 'inaa' (smooth in 4-element array of 2-element array of mediump float)\r
0:? 'ins' (smooth in structure{global mediump float f})\r
0:? 'inasa' (smooth in 4-element array of structure{global mediump float f})\r
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})\r
0:? 'inb' (smooth in bool)\r
0:? 'ino' (smooth in highp sampler2D)\r
0:? 'ina' (smooth in 4-element array of mediump float)\r
-0:? 'inaa' (smooth in 4-element array of mediump float)\r
+0:? 'inaa' (smooth in 4-element array of 2-element array of mediump float)\r
0:? 'ins' (smooth in structure{global mediump float f})\r
0:? 'inasa' (smooth in 4-element array of structure{global mediump float f})\r
0:? 'insa' (smooth in 4-element array of structure{global mediump float f})\r
0:? 'outb' (smooth out bool)\r
0:? 'outo' (smooth out highp sampler2D)\r
0:? 'outa' (smooth out 4-element array of highp float)\r
-0:? 'outaa' (smooth out 4-element array of highp float)\r
+0:? 'outaa' (smooth out 4-element array of 2-element array of highp float)\r
0:? 'outs' (smooth out structure{global highp float f})\r
0:? 'outasa' (smooth out 4-element array of structure{global highp float f})\r
0:? 'outsa' (smooth out 4-element array of structure{global highp float f})\r
0:? 'outb' (smooth out bool)\r
0:? 'outo' (smooth out highp sampler2D)\r
0:? 'outa' (smooth out 4-element array of highp float)\r
-0:? 'outaa' (smooth out 4-element array of highp float)\r
+0:? 'outaa' (smooth out 4-element array of 2-element array of highp float)\r
0:? 'outs' (smooth out structure{global highp float f})\r
0:? 'outasa' (smooth out 4-element array of structure{global highp float f})\r
0:? 'outsa' (smooth out 4-element array of structure{global highp float f})\r
--- /dev/null
+310mangle.vert\r
+Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.\r
+\r
+Shader version: 310\r
+0:? Sequence\r
+0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; (global void)\r
+0:8 Function Parameters: \r
+0:8 'a' (in bool)\r
+0:8 'b' (in highp float)\r
+0:8 'c' (in 4-element array of highp uint)\r
+0:8 'd' (in 3-element array of 2-element array of highp int)\r
+0:11 Function Definition: main( (global void)\r
+0:11 Function Parameters: \r
+0:? Sequence\r
+0:13 Function Call: f(b1;f1;u1[4];i1[3][2]; (global void)\r
+0:13 Constant:\r
+0:13 false (const bool)\r
+0:13 Constant:\r
+0:13 12.100000\r
+0:13 Constant:\r
+0:13 0 (const uint)\r
+0:13 1 (const uint)\r
+0:13 1 (const uint)\r
+0:13 2 (const uint)\r
+0:13 'd' (temp 3-element array of 2-element array of highp int)\r
+0:? Linker Objects\r
+0:? 'gl_VertexID' (gl_VertexId highp int)\r
+0:? 'gl_InstanceID' (gl_InstanceId highp int)\r
+\r
+\r
+Linked vertex stage:\r
+\r
+\r
+Shader version: 310\r
+0:? Sequence\r
+0:8 Function Definition: f(b1;f1;u1[4];i1[3][2]; (global void)\r
+0:8 Function Parameters: \r
+0:8 'a' (in bool)\r
+0:8 'b' (in highp float)\r
+0:8 'c' (in 4-element array of highp uint)\r
+0:8 'd' (in 3-element array of 2-element array of highp int)\r
+0:11 Function Definition: main( (global void)\r
+0:11 Function Parameters: \r
+0:? Sequence\r
+0:13 Function Call: f(b1;f1;u1[4];i1[3][2]; (global void)\r
+0:13 Constant:\r
+0:13 false (const bool)\r
+0:13 Constant:\r
+0:13 12.100000\r
+0:13 Constant:\r
+0:13 0 (const uint)\r
+0:13 1 (const uint)\r
+0:13 1 (const uint)\r
+0:13 2 (const uint)\r
+0:13 'd' (temp 3-element array of 2-element array of highp int)\r
+0:? Linker Objects\r
+0:? 'gl_VertexID' (gl_VertexId highp int)\r
+0:? 'gl_InstanceID' (gl_InstanceId highp int)\r
+\r
0:? 'outb' (smooth out bool)\r
0:? 'outo' (smooth out sampler2D)\r
0:? 'outa' (smooth out 4-element array of float)\r
-0:? 'outaa' (smooth out 4-element array of float)\r
+0:? 'outaa' (smooth out 4-element array of 2-element array of float)\r
0:? 'outs' (smooth out structure{global float f})\r
0:? 'outasa' (smooth out 4-element array of structure{global float f})\r
0:? 'outsa' (smooth out 4-element array of structure{global float f})\r
0:? 'outb' (smooth out bool)\r
0:? 'outo' (smooth out sampler2D)\r
0:? 'outa' (smooth out 4-element array of float)\r
-0:? 'outaa' (smooth out 4-element array of float)\r
+0:? 'outaa' (smooth out 4-element array of 2-element array of float)\r
0:? 'outs' (smooth out structure{global float f})\r
0:? 'outasa' (smooth out 4-element array of structure{global float f})\r
0:? 'outsa' (smooth out 4-element array of structure{global float f})\r
ERROR: 0:118: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth\r
ERROR: 0:121: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth\r
ERROR: 0:150: 'constructor' : constructing from a non-dereferenced array \r
-ERROR: 0:150: '=' : cannot convert from 'const float' to 'temp 3-element array of 4-component vector of float'\r
+ERROR: 0:150: '=' : cannot convert from 'const float' to 'temp 3-element array of 2-element array of 4-component vector of float'\r
ERROR: 0:152: 'constructor' : cannot convert parameter 1 from 'const 2-element array of 4-component vector of float' to 'temp 4-component vector of float'\r
ERROR: 0:172: 'x' : undeclared identifier \r
ERROR: 0:172: '[]' : scalar integer expression required \r
310.vert
310.frag
310implicitSizeArrayError.vert
+310AofA.vert
330.frag
330comp.frag
constErrors.frag
p += snprintf(p, end - p, "writeonly ");
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
if (arraySizes) {
- if (arraySizes->sizes.front() == 0)
+ if (arraySizes->sizes.front() == 0) {
p += snprintf(p, end - p, "implicitly-sized array of ");
- else
- p += snprintf(p, end - p, "%d-element array of ", arraySizes->sizes.front());
+ } else {
+ for(int i = 0; i < (int)arraySizes->sizes.size() ; ++i) {
+// p += snprintf(p, end - p, "%s%d", (i == 0 ? "" : "x"), arraySizes->sizes[numDimensions-1-i]);
+ p += snprintf(p, end - p, "%d-element array of ", arraySizes->sizes[i]);
+ }
+ }
}
if (qualifier.precision != EpqNone)
p += snprintf(p, end - p, "%s ", getPrecisionQualifierString());
// compute
if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 430)) {
snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
- resources.maxComputeWorkGroupCountY,
- resources.maxComputeWorkGroupCountZ);
+ resources.maxComputeWorkGroupCountY,
+ resources.maxComputeWorkGroupCountZ);
s.append(builtInConstant);
snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
- resources.maxComputeWorkGroupSizeY,
- resources.maxComputeWorkGroupSizeZ);
+ resources.maxComputeWorkGroupSizeY,
+ resources.maxComputeWorkGroupSizeZ);
s.append(builtInConstant);
snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
if (arraySizes) {
const int maxSize = 11;
char buf[maxSize];
- snprintf(buf, maxSize, "%d", arraySizes->sizes.front());
- mangledName += '[';
- mangledName += buf;
- mangledName += ']';
+ for (int i = 0; i < (int)arraySizes->sizes.size(); ++i) {
+ snprintf(buf, maxSize, "%d", arraySizes->sizes[i]);
+ mangledName += '[';
+ mangledName += buf;
+ mangledName += ']';
+ }
}
}