ispc now supports goto, but only under uniform control flow--i.e. it must be possible for the compiler to statically determine that all program instances will follow the goto. An error is issued at compile time if a goto is used when this is not the case.
18 lines
354 B
Plaintext
18 lines
354 B
Plaintext
|
|
export uniform int width() { return programCount; }
|
|
|
|
|
|
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
|
float a = aFOO[programIndex];
|
|
float b = 0.; b = a;
|
|
RET[programIndex] = a+b;
|
|
goto skip;
|
|
RET[programIndex] = 0;
|
|
skip:
|
|
;
|
|
}
|
|
|
|
export void result(uniform float RET[]) {
|
|
RET[programIndex] = 2 + 2*programIndex;
|
|
}
|