Add C-style curly-brace initializers.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23565 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -1,6 +1,78 @@
|
||||
#version 420 core
|
||||
|
||||
const mat2x2 a = mat2( vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) );
|
||||
mat2x2 b = { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) };
|
||||
const mat2x2 c = { { 1.0, 0.0, }, { 0.0, 1.0 } };
|
||||
|
||||
float a2[2] = { 3.4, 4.2, 5.0 }; // illegal
|
||||
vec2 b2 = { 1.0, 2.0, 3.0 }; // illegal
|
||||
mat3x3 c2 = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal
|
||||
mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting
|
||||
|
||||
struct {
|
||||
float a;
|
||||
int b;
|
||||
} e = { 1.2, 2, };
|
||||
|
||||
struct {
|
||||
float a;
|
||||
int b;
|
||||
} e2 = { 1, 3 }; // legal, first initializer is converted
|
||||
|
||||
struct {
|
||||
float a;
|
||||
int b;
|
||||
} e3 = { 1.2, 2, 3 }; // illegal
|
||||
|
||||
int a3 = true; // illegal
|
||||
vec4 b3[2] = { vec4(0.0), 1.0 }; // illegal
|
||||
vec4 b4[2] = vec4[2](vec4(0.0), mat2x2(1.0)); // illegal
|
||||
mat4x2 c3 = { vec3(0.0), vec3(1.0) }; // illegal
|
||||
|
||||
struct S1 {
|
||||
vec4 a;
|
||||
vec4 b;
|
||||
};
|
||||
|
||||
struct {
|
||||
float s;
|
||||
float t;
|
||||
} d2[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal
|
||||
|
||||
float b5[] = { 3.4, 4.2, 5.0, 5.2, 1.1 };
|
||||
|
||||
struct S3 {
|
||||
float f;
|
||||
mat2x3 m23;
|
||||
};
|
||||
|
||||
struct S4 {
|
||||
uvec2 uv2;
|
||||
S3 s[2];
|
||||
};
|
||||
|
||||
const S4 constructed = S4(uvec2(1, 2),
|
||||
S3[2](S3(3.0, mat2x3(4.0)),
|
||||
S3(5.0, mat2x3(6.0))));
|
||||
|
||||
const S4 curlybad1 = { {1, 2},
|
||||
{ {3, {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } }, // ERROR, the mat2x3 isn't isolated
|
||||
{5.0, {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } };
|
||||
|
||||
const S4 curlyInit = { {1, 2},
|
||||
{ {3, { {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } } },
|
||||
{5.0, { {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } } };
|
||||
|
||||
float vc1, vc2, vc3;
|
||||
vec3 av3 = vec3(vc1, vc2, vc3);
|
||||
vec3 bv3 = { vc1, vc2, vc3 };
|
||||
|
||||
void main()
|
||||
{
|
||||
memoryBarrier();
|
||||
|
||||
if (constructed == curlybad1)
|
||||
;
|
||||
if (constructed == curlyInit)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
ERROR: 0:3: '{ } style initializers' : not supported with this profile: es
|
||||
ERROR: 0:3: 'initializer' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:3: '=' : cannot convert from 'const int' to '3-element array of mediump int'
|
||||
ERROR: 0:7: 'attribute' : not supported in this stage: fragment
|
||||
ERROR: 0:7: 'float' : type requires declaration of default precision qualifier
|
||||
ERROR: 0:9: '=' : cannot convert from 'const int' to 'mediump float'
|
||||
@@ -21,9 +20,16 @@ ERROR: 0:38: 'array comparison' : not supported for this version or the enabled
|
||||
ERROR: 0:40: 'switch' : Reserved word.
|
||||
ERROR: 0:40: 'switch statements' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:45: '' : array size required
|
||||
ERROR: 23 compilation errors. No code generated.
|
||||
ERROR: 22 compilation errors. No code generated.
|
||||
|
||||
ERROR: node is still EOpNull!
|
||||
0:3 Sequence
|
||||
0:3 move second child to first child (3-element array of mediump int)
|
||||
0:3 'a' (3-element array of mediump int)
|
||||
0:3 Constant:
|
||||
0:3 2 (const int)
|
||||
0:3 3 (const int)
|
||||
0:3 4 (const int)
|
||||
0:17 Function Definition: main( (void)
|
||||
0:17 Function Parameters:
|
||||
0:19 Sequence
|
||||
|
||||
@@ -1,8 +1,160 @@
|
||||
Warning, version 420 is not yet complete; some version-specific features are present, but many are missing.
|
||||
0:? Sequence
|
||||
0:3 Function Definition: main( (void)
|
||||
0:3 Function Parameters:
|
||||
0:5 Sequence
|
||||
0:5 MemoryBarrier (void)
|
||||
0:? Linker Objects
|
||||
ERROR: 0:7: '=' : cannot convert from '3-element array of float' to '2-element array of float'
|
||||
ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): 2-component vector of float
|
||||
ERROR: 0:9: 'initializer list' : wrong number of matrix columns: 3X3 matrix of float
|
||||
ERROR: 0:10: 'initializer list' : wrong number of matrix columns: 2X2 matrix of float
|
||||
ERROR: 0:25: 'initializer list' : wrong number of structure members
|
||||
ERROR: 0:27: '=' : cannot convert from 'const bool' to 'int'
|
||||
ERROR: 0:28: 'constructor' : cannot convert parameter 2 from 'const float' to '4-component vector of float'
|
||||
ERROR: 0:29: 'constructor' : cannot convert parameter 2 from 'const 2X2 matrix of float' to 'const 4-component vector of float'
|
||||
ERROR: 0:29: 'const 2-element array of 4-component vector of float' : cannot construct with these arguments
|
||||
ERROR: 0:30: 'initializer list' : wrong number of matrix columns: 4X2 matrix of float
|
||||
ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'float' to 'structure'
|
||||
ERROR: 0:58: 'initializer list' : wrong number of structure members
|
||||
ERROR: 12 compilation errors. No code generated.
|
||||
|
||||
ERROR: node is still EOpNull!
|
||||
0:4 Sequence
|
||||
0:4 move second child to first child (2X2 matrix of float)
|
||||
0:4 'b' (2X2 matrix of float)
|
||||
0:4 Constant:
|
||||
0:4 1.000000
|
||||
0:4 0.000000
|
||||
0:4 0.000000
|
||||
0:4 1.000000
|
||||
0:15 Sequence
|
||||
0:15 move second child to first child (structure)
|
||||
0:15 'e' (structure)
|
||||
0:15 Constant:
|
||||
0:15 1.200000
|
||||
0:15 2 (const int)
|
||||
0:20 Sequence
|
||||
0:20 move second child to first child (structure)
|
||||
0:20 'e2' (structure)
|
||||
0:20 Constant:
|
||||
0:20 1.000000
|
||||
0:20 3 (const int)
|
||||
0:29 Sequence
|
||||
0:29 move second child to first child (2-element array of 4-component vector of float)
|
||||
0:29 'b4' (2-element array of 4-component vector of float)
|
||||
0:29 Construct vec4 (const 2-element array of 4-component vector of float)
|
||||
0:42 Sequence
|
||||
0:42 move second child to first child (5-element array of float)
|
||||
0:42 'b5' (5-element array of float)
|
||||
0:42 Constant:
|
||||
0:42 3.400000
|
||||
0:42 4.200000
|
||||
0:42 5.000000
|
||||
0:42 5.200000
|
||||
0:42 1.100000
|
||||
0:67 Sequence
|
||||
0:67 move second child to first child (3-component vector of float)
|
||||
0:67 'av3' (3-component vector of float)
|
||||
0:67 Construct vec3 (3-component vector of float)
|
||||
0:67 'vc1' (float)
|
||||
0:67 'vc2' (float)
|
||||
0:67 'vc3' (float)
|
||||
0:68 Sequence
|
||||
0:68 move second child to first child (3-component vector of float)
|
||||
0:68 'bv3' (3-component vector of float)
|
||||
0:68 Construct vec3 (3-component vector of float)
|
||||
0:68 'vc1' (float)
|
||||
0:68 'vc2' (float)
|
||||
0:68 'vc3' (float)
|
||||
0:70 Function Definition: main( (void)
|
||||
0:70 Function Parameters:
|
||||
0:72 Sequence
|
||||
0:72 MemoryBarrier (void)
|
||||
0:74 Test condition and select (void)
|
||||
0:74 Condition
|
||||
0:74 Compare Equal (bool)
|
||||
0:74 Constant:
|
||||
0:74 1 (const uint)
|
||||
0:74 2 (const uint)
|
||||
0:74 3.000000
|
||||
0:74 4.000000
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 4.000000
|
||||
0:74 0.000000
|
||||
0:74 5.000000
|
||||
0:74 6.000000
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 6.000000
|
||||
0:74 0.000000
|
||||
0:74 'curlybad1' (structure)
|
||||
0:74 true case is null
|
||||
0:76 Test condition and select (void)
|
||||
0:76 Condition
|
||||
0:76 Constant:
|
||||
0:76 true (const bool)
|
||||
0:76 true case is null
|
||||
0:? Linker Objects
|
||||
0:? 'a' (const 2X2 matrix of float)
|
||||
0:? 1.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 1.000000
|
||||
0:? 'b' (2X2 matrix of float)
|
||||
0:? 'c' (const 2X2 matrix of float)
|
||||
0:? 1.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 1.000000
|
||||
0:? 'a2' (2-element array of float)
|
||||
0:? 'b2' (2-component vector of float)
|
||||
0:? 'c2' (3X3 matrix of float)
|
||||
0:? 'd' (2X2 matrix of float)
|
||||
0:? 'e' (structure)
|
||||
0:? 'e2' (structure)
|
||||
0:? 'e3' (structure)
|
||||
0:? 'a3' (int)
|
||||
0:? 'b3' (2-element array of 4-component vector of float)
|
||||
0:? 'b4' (2-element array of 4-component vector of float)
|
||||
0:? 'c3' (4X2 matrix of float)
|
||||
0:? 'd2' (unsized array of structure)
|
||||
0:? 'b5' (5-element array of float)
|
||||
0:? 'constructed' (const structure)
|
||||
0:? 1 (const uint)
|
||||
0:? 2 (const uint)
|
||||
0:? 3.000000
|
||||
0:? 4.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 4.000000
|
||||
0:? 0.000000
|
||||
0:? 5.000000
|
||||
0:? 6.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 6.000000
|
||||
0:? 0.000000
|
||||
0:? 'curlybad1' (structure)
|
||||
0:? 'curlyInit' (const structure)
|
||||
0:? 1 (const uint)
|
||||
0:? 2 (const uint)
|
||||
0:? 3.000000
|
||||
0:? 4.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 4.000000
|
||||
0:? 0.000000
|
||||
0:? 5.000000
|
||||
0:? 6.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 0.000000
|
||||
0:? 6.000000
|
||||
0:? 0.000000
|
||||
0:? 'vc1' (float)
|
||||
0:? 'vc2' (float)
|
||||
0:? 'vc3' (float)
|
||||
0:? 'av3' (3-component vector of float)
|
||||
0:? 'bv3' (3-component vector of float)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ ERROR: 0:115: 'depth_greater' : unrecognized layout identifier
|
||||
ERROR: 0:118: 'depth_less' : unrecognized layout identifier
|
||||
ERROR: 0:121: 'depth_unchanged' : unrecognized layout identifier
|
||||
ERROR: 0:150: 'constructor' : constructing from a non-dereferenced array
|
||||
ERROR: 0:152: '=' : cannot convert from 'const 2-element array of 4-component vector of float' to '3-element array of 4-component vector of float'
|
||||
ERROR: 0:152: 'constructor' : cannot convert parameter 1 from 'const 2-element array of 4-component vector of float' to '4-component vector of float'
|
||||
ERROR: 0:172: 'x' : undeclared identifier
|
||||
ERROR: 0:172: '[]' : scalar integer expression required
|
||||
ERROR: 0:172: 'length' : illegal vector field selection
|
||||
@@ -202,6 +202,12 @@ ERROR: node is still EOpNull!
|
||||
0:175 0.000000
|
||||
0:178 Constant:
|
||||
0:178 0.000000
|
||||
0:193 Sequence
|
||||
0:193 move second child to first child (structure)
|
||||
0:193 'e' (structure)
|
||||
0:193 Constant:
|
||||
0:193 1.200000
|
||||
0:193 2 (const int)
|
||||
0:216 Sequence
|
||||
0:216 Sequence
|
||||
0:216 move second child to first child (5-element array of float)
|
||||
@@ -212,10 +218,23 @@ ERROR: node is still EOpNull!
|
||||
0:216 5.000000
|
||||
0:216 5.200000
|
||||
0:216 1.100000
|
||||
0:217 Sequence
|
||||
0:217 move second child to first child (5-element array of float)
|
||||
0:217 'b' (5-element array of float)
|
||||
0:217 Constant:
|
||||
0:217 3.400000
|
||||
0:217 4.200000
|
||||
0:217 5.000000
|
||||
0:217 5.200000
|
||||
0:217 1.100000
|
||||
0:218 Sequence
|
||||
0:218 move second child to first child (5-element array of float)
|
||||
0:218 'c' (5-element array of float)
|
||||
0:218 'a' (5-element array of float)
|
||||
0:219 Sequence
|
||||
0:219 move second child to first child (5-element array of float)
|
||||
0:219 'd' (5-element array of float)
|
||||
0:219 'b' (5-element array of float)
|
||||
0:? Linker Objects
|
||||
0:? 'a' (int)
|
||||
0:? 'b' (int)
|
||||
|
||||
@@ -231,7 +231,19 @@ ERROR: node is still EOpNull!
|
||||
0:188 'g' (float)
|
||||
0:188 Constant:
|
||||
0:188 2.000000
|
||||
0:? Sequence
|
||||
0:191 Sequence
|
||||
0:191 Sequence
|
||||
0:191 move second child to first child (2-element array of 4-component vector of float)
|
||||
0:191 'b' (2-element array of 4-component vector of float)
|
||||
0:191 Constant:
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:191 1.000000
|
||||
0:192 Construct vec4 (3-element array of 4-component vector of float)
|
||||
0:193 Construct vec4 (3-element array of 4-component vector of float)
|
||||
0:194 Construct vec4 (3-element array of 4-component vector of float)
|
||||
|
||||
Reference in New Issue
Block a user