Add switch/case/default statements, using a switch node that contains a sequence of case/default nodes and top-level nodes of the code chunks in between them.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21131 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-04-12 03:57:02 +00:00
parent 8e5425745f
commit 0576126005
10 changed files with 244 additions and 23 deletions

64
Test/switch.frag Normal file
View File

@@ -0,0 +1,64 @@
#version 300 es
uniform int c, d;
in float x;
void main()
{
float f;
int a[2];
switch(f) { // ERROR
}
switch(a) { // ERROR
}
switch(c)
{
}
switch(c)
{
case 2: // ERROR, not enough stuff
}
switch(c)
{
f = sin(x); // ERRROR
case 2: // ERROR, not enough stuff
f = cos(x);
break;
}
switch (c) {
case 1:
f = sin(x);
break;
case 2:
f = cos(x);
break;
default:
f = tan(x);
}
switch (c) {
case 1:
f = sin(x);
break;
case 2:
switch (d) {
case 1:
f = x * x * x;
break;
case 2:
f = x * x;
break;
}
break;
default:
f = tan(x);
}
break; // ERROR
}