Files
ispc/tests/switch-3.ispc
Matt Pharr b67446d998 Add support for "switch" statements.
Switches with both uniform and varying "switch" expressions are
supported.  Switch statements with varying expressions and very
large numbers of labels may not perform well; some issues to be
filed shortly will track opportunities for improving these.
2012-01-11 09:16:31 -08:00

19 lines
369 B
Plaintext

export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
int a = aFOO[programIndex];
switch (b) {
case 5:
RET[programIndex] = 0;
break;
default:
RET[programIndex] = -1;
}
}
export void result(uniform float RET[]) {
RET[programIndex] = 0;
}