Files
ispc/tests/ref-as-temporary.ispc
Matt Pharr ca7cc4744e Fix bug with taking references of temporaries.
Previously, the compiler would crash if e.g. the program passed a
temporary value to a function taking a const reference.  This change
fixes ReferenceExpr::GetValue() to handle this case and allocate
temporary storage for the temporary so that the pointer to that
storage can be used for the reference value.
2012-04-12 06:08:19 -07:00

15 lines
291 B
Plaintext

export uniform int width() { return programCount; }
int func(const int &a) { return a+1; }
int bar() { return 0; }
export void f_f(uniform float RET[], uniform float aFOO[]) {
RET[programIndex] = func(bar());
}
export void result(uniform float RET[]) {
RET[programIndex] = 1;
}