Files
ispc/tests/short-circuit-15.ispc
Matt Pharr fdb4eaf437 Fix bug in &&/|| short-circuiting.
Use full mask, not internal mask when checking "any lanes running"
before evaluating expressions.

Added some more tests to try to cover this case.
2012-02-01 08:17:25 -08:00

30 lines
639 B
Plaintext

export uniform int width() { return programCount; }
uniform int * uniform ptr;
uniform int crash() {
return *ptr;
}
float foo(uniform float a[]) {
int index = (programIndex & 1);
if (a[index] == 2 && crash())
return 1234;
else
return 1;
}
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float a = aFOO[programIndex];
float a0 = aFOO[0], a1 = aFOO[1];
if ((programIndex & 1) == 0)
RET[programIndex] = foo(aFOO);
else
RET[programIndex] = 2;
}
export void result(uniform float RET[]) {
RET[programIndex] = (programIndex & 1) ? 2 : 1;
}