Files
ispc/tests/typecast-void-funcall-1.ispc
Matt Pharr ca5c65d032 Fix bugs where typecasting an expression to void would cause it to disappear.
This was obviously problematic in cases where the expression was a function
call or the like, with side effects.

Fixes issue #199.
2012-03-27 09:33:43 -07:00

18 lines
406 B
Plaintext

export uniform int width() { return programCount; }
float add(float a, float b, uniform float * uniform result) {
result[programIndex] = a+b;
return a+b;
}
export void f_f(uniform float RET[], uniform float aFOO[]) {
float a = aFOO[programIndex];
float b = 0.; b = a;
(void)add(a, b, RET);
}
export void result(uniform float RET[]) {
RET[programIndex] = 2 + 2*programIndex;
}