Remove TIntermediate's dependency on infoSink, simplify folding of constant aggregates, and infoSink use in constant folding.

Added a few deep aggregate constant folding testing cases.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22912 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-09-03 22:14:59 +00:00
parent fca7534044
commit 807b8e3b82
11 changed files with 79 additions and 173 deletions

View File

@@ -5,7 +5,9 @@ ERROR: 0:18: '' : constant expression required
ERROR: 0:18: '' : array size must be a constant integer expression
ERROR: 0:19: '' : constant expression required
ERROR: 0:19: '' : array size must be a constant integer expression
ERROR: 7 compilation errors. No code generated.
ERROR: 0:27: '=' : assigning non-constant to 'const structure'
ERROR: 0:33: '=' : assigning non-constant to 'const structure'
ERROR: 9 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:10 Function Definition: main( (void)

View File

@@ -129,6 +129,14 @@
0:69 0.028000
0:69 0.500000
0:69 1.000000
0:78 Function Definition: foo( (void)
0:78 Function Parameters:
0:? Sequence
0:81 move second child to first child (float)
0:81 direct index (float)
0:81 'a' (3-element array of float)
0:81 0 (const int)
0:81 7.000000
0:? Linker Objects
0:? 'inv' (smooth in 4-component vector of float)
0:? 'FragColor' (out 4-component vector of float)

View File

@@ -20,3 +20,14 @@ void main()
vec4 g[int(sin(0.3)) + 1]; // okay
}
const struct S {
vec3 v3;
ivec2 iv2;
} s = S(vec3(3.0), ivec2(3, constInt + uniformInt)); // ERROR, non-const y componenent
const struct S2 {
vec3 v3;
ivec2 iv2;
mat2x4 m;
} s2 = S2(vec3(3.0), ivec2(3, constInt), mat2x4(1.0, 2.0, 3.0, inVar.x, 5.0, 6.0, 7.0, 8.0)); // ERROR, non-constant matrix

View File

@@ -68,3 +68,15 @@ void main()
out2 = step(0.5, vec2(0.2, 0.6)); // 0.0, 1.0
out11 = smoothstep(50.0, 60.0, vec4(40.0, 51.0, 55.0, 70.0)); // 0.0, 0.028, 0.5, 1.0
}
const struct S {
vec3 v3;
ivec2 iv2;
mat2x4 m;
} s = S(vec3(3.0), ivec2(3, a + b), mat2x4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0));
void foo()
{
float a[s.iv2.y]; // 3 element array
a[0] = s.m[1].z; // 7.0
}