Type convert arrays in select expressions to pointers to the first element.
Fixes issue #345.
This commit is contained in:
18
tests/select-array-ptr-typeconv.ispc
Normal file
18
tests/select-array-ptr-typeconv.ispc
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
uniform float a[1234];
|
||||
|
||||
float * uniform func(uniform bool x) {
|
||||
return x ? a : NULL;
|
||||
}
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
a[programIndex] = aFOO[programIndex];
|
||||
float * uniform ptr = func(aFOO[0] == 1);
|
||||
RET[programIndex] = ptr[programIndex];
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1 + programIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user