Types: Fix #1290: Rationalize and correct "mixed" style array dimensioning.
There a couple functional problems, which when reduced down also led to some good simplifications and rationalization. So, this commit: - corrects "mixed" functionality: int[A] f[B] -> f[B][A] - correct multi-identifier decls: int[A] f[B], g[C] -> f and g are independently sized. - increases symmetry between different places in the code that do this - makes fewer ways to do the same thing; several methods are just gone now - makes more clear when something is copied or shared
This commit is contained in:
@@ -19,6 +19,7 @@ ERROR: 0:34: 'a4' : redefinition
|
||||
ERROR: 0:35: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:36: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:38: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:39: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none
|
||||
@@ -78,7 +79,7 @@ ERROR: 0:192: 'assign' : l-value required (can't modify a const)
|
||||
ERROR: 0:195: 'gl_ModelViewMatrix' : identifiers starting with "gl_" are reserved
|
||||
ERROR: 0:200: 'token pasting (##)' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:203: 'token pasting (##)' : not supported for this version or the enabled extensions
|
||||
ERROR: 79 compilation errors. No code generated.
|
||||
ERROR: 80 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 120
|
||||
|
||||
@@ -26,6 +26,7 @@ ERROR: 0:101: '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: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: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 output array' : not supported with this profile: es
|
||||
@@ -44,7 +45,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, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON
|
||||
ERROR: 45 compilation errors. No code generated.
|
||||
ERROR: 46 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 300
|
||||
@@ -392,7 +393,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'sc' ( out lowp 3-component vector of float)
|
||||
0:? 'sf' ( out lowp float)
|
||||
0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D)
|
||||
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})
|
||||
0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 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})
|
||||
0:? 'colors' ( out 4-element array of lowp 4-component vector of float)
|
||||
0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s})
|
||||
0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s})
|
||||
@@ -623,7 +624,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'sc' ( out lowp 3-component vector of float)
|
||||
0:? 'sf' ( out lowp float)
|
||||
0:? 'arrayedSampler' ( uniform 5-element array of lowp sampler2D)
|
||||
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})
|
||||
0:? 'multiInst' (layout( column_major shared) uniform 2-element array of 3-element array of block{layout( column_major shared) uniform 3-element array of 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})
|
||||
0:? 'colors' ( out 4-element array of lowp 4-component vector of float)
|
||||
0:? 'st1' ( uniform structure{ global mediump int i, global lowp sampler2D s})
|
||||
0:? 'st2' ( uniform structure{ global mediump int i, global lowp sampler2D s})
|
||||
|
||||
68
Test/baseResults/mixedArrayDecls.frag.out
Executable file
68
Test/baseResults/mixedArrayDecls.frag.out
Executable file
@@ -0,0 +1,68 @@
|
||||
mixedArrayDecls.frag
|
||||
ERROR: 0:30: '' : syntax error, unexpected LEFT_PAREN, expecting COMMA or SEMICOLON
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 450
|
||||
ERROR: node is still EOpNull!
|
||||
0:16 Function Definition: foo(i1[14][15][6]; ( global 14-element array of 15-element array of 6-element array of int)
|
||||
0:16 Function Parameters:
|
||||
0:16 'p' ( in 14-element array of 15-element array of 6-element array of int)
|
||||
0:16 Sequence
|
||||
0:16 Branch: Return with expression
|
||||
0:16 'p' ( in 14-element array of 15-element array of 6-element array of int)
|
||||
0:18 Function Definition: main( ( global void)
|
||||
0:18 Function Parameters:
|
||||
0:20 Sequence
|
||||
0:20 direct index ( temp 14-element array of int)
|
||||
0:20 'g' ( global unsized 4-element array of 14-element array of int)
|
||||
0:20 Constant:
|
||||
0:20 3 (const int)
|
||||
0:21 direct index ( temp 14-element array of int)
|
||||
0:21 'h' ( global unsized 3-element array of 14-element array of int)
|
||||
0:21 Constant:
|
||||
0:21 2 (const int)
|
||||
0:24 Function Definition: bar( ( global 4-element array of 3-element array of 2-element array of float)
|
||||
0:24 Function Parameters:
|
||||
0:? Sequence
|
||||
0:24 Branch: Return with expression
|
||||
0:24 'a' ( temp 4-element array of 3-element array of 2-element array of float)
|
||||
0:? Linker Objects
|
||||
0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b})
|
||||
0:? 'c' ( global 4-element array of 5-element array of int)
|
||||
0:? 'd' ( global 8-element array of 5-element array of int)
|
||||
0:? 'e' ( global 11-element array of 9-element array of int)
|
||||
0:? 'f' ( global 13-element array of 9-element array of int)
|
||||
0:? 'g' ( global unsized 4-element array of 14-element array of int)
|
||||
0:? 'h' ( global unsized 3-element array of 14-element array of int)
|
||||
0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f})
|
||||
0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
ERROR: node is still EOpNull!
|
||||
0:18 Function Definition: main( ( global void)
|
||||
0:18 Function Parameters:
|
||||
0:20 Sequence
|
||||
0:20 direct index ( temp 14-element array of int)
|
||||
0:20 'g' ( global 4-element array of 14-element array of int)
|
||||
0:20 Constant:
|
||||
0:20 3 (const int)
|
||||
0:21 direct index ( temp 14-element array of int)
|
||||
0:21 'h' ( global 3-element array of 14-element array of int)
|
||||
0:21 Constant:
|
||||
0:21 2 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 's' ( global structure{ global 2-element array of 3-element array of int a, global 5-element array of 3-element array of int b})
|
||||
0:? 'c' ( global 4-element array of 5-element array of int)
|
||||
0:? 'd' ( global 8-element array of 5-element array of int)
|
||||
0:? 'e' ( global 11-element array of 9-element array of int)
|
||||
0:? 'f' ( global 13-element array of 9-element array of int)
|
||||
0:? 'g' ( global 4-element array of 14-element array of int)
|
||||
0:? 'h' ( global 3-element array of 14-element array of int)
|
||||
0:? 'inbinst' ( in 4-element array of 5-element array of 6-element array of block{ in 8-element array of 9-element array of 7-element array of float f})
|
||||
0:? 'barm' ( global 4-element array of 3-element array of 2-element array of float)
|
||||
|
||||
30
Test/mixedArrayDecls.frag
Normal file
30
Test/mixedArrayDecls.frag
Normal file
@@ -0,0 +1,30 @@
|
||||
#version 450
|
||||
|
||||
struct S {
|
||||
int[3] a[2], b[5];
|
||||
};
|
||||
|
||||
S s;
|
||||
|
||||
int[5] c[4], d[8];
|
||||
int[9] e[], f[];
|
||||
int e[11][9];
|
||||
int f[13][9];
|
||||
|
||||
int[14] g[], h[];
|
||||
|
||||
int [14][15][6] foo(int[6] p[14][15]) { return p; }
|
||||
|
||||
void main()
|
||||
{
|
||||
g[3];
|
||||
h[2];
|
||||
}
|
||||
|
||||
float[4][3][2] bar() { float[3][2] a[4]; return a; }
|
||||
|
||||
in inbname {
|
||||
float[7] f[8][9];
|
||||
} inbinst[4][5][6];
|
||||
|
||||
float[3][2] barm[4]() { float[3][2] a[4]; return a; } // ERROR
|
||||
Reference in New Issue
Block a user