Files
ispc/tests/foreach-mask-1.ispc
Matt Pharr 34d81fa522 Fix bugs in tests.
These two tests were walking past the end of the aFOO[] array, which
in turn was leading to failures with the generic-16/c++ output path.
2012-04-19 10:33:33 -07:00

24 lines
607 B
Plaintext

export uniform int width() { return programCount; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
uniform float val[programCount+3];
for (uniform int i = 0; i < programCount+3; ++i)
val[i] = 0;
// make sure we reset the func mask in the foreach loop...
if ((int)aFOO[programIndex] & 1)
foreach (i = 0 ... programCount+3) {
int ic = min(i, programCount-1);
val[i] += aFOO[ic] - 1 + i-ic;
}
RET[programIndex] = val[3+programIndex];
}
export void result(uniform float RET[]) {
RET[programIndex] = programIndex+3;
}