This way, we match C/C++ in that casting a bool to an int gives either the value zero or the value one. There is a new stdlib function int sign_extend(bool) that does sign extension for cases where that's desired.
15 lines
297 B
Plaintext
15 lines
297 B
Plaintext
|
|
export uniform int width() { return programCount; }
|
|
|
|
|
|
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
|
float a = aFOO[programIndex];
|
|
bool b = (a == 1.);
|
|
RET[programIndex] = (int)b;
|
|
}
|
|
|
|
export void result(uniform float RET[]) {
|
|
RET[programIndex] = 0;
|
|
RET[0] = 1;
|
|
}
|