Add support for enums.

This commit is contained in:
Matt Pharr
2011-07-17 16:43:05 +02:00
parent 17e5c8b7c2
commit f0f876c3ec
23 changed files with 1031 additions and 251 deletions

27
tests/enum-7.ispc Normal file
View File

@@ -0,0 +1,27 @@
enum Foo {
ZERO,
ONE,
TWO,
TEN = 10,
ELEVEN
};
enum Bar {
FIFTY = 50,
THOUSAND = 1000
};
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float a = aFOO[programIndex];
uniform Foo f = ONE;
Foo vf = f;
++vf;
RET[programIndex] = (int)vf;
}
export void result(uniform float RET[]) {
RET[programIndex] = 2;
}