scalar values (that ispc used to smear across the array/struct
elements). Now, initializers in variable declarations must be
{ }-delimited lists, with one element per struct member or array
element, respectively.
There were a few problems with the previous implementation of the
functionality to initialize from scalars. First, the expression
would be evaluated once per value initialized, so if it had side-effects,
the wrong thing would happen. Next, for large multidimensional arrays,
the generated code would be a long series of move instructions, rather
than loops (and this in turn made LLVM take a long time.)
While both of these problems are fixable, it's a non-trivial
amount of re-plumbing for a questionable feature anyway.
Fixes issue #50.
16 lines
367 B
Plaintext
16 lines
367 B
Plaintext
|
|
export uniform int width() { return programCount; }
|
|
|
|
export void f_fu(uniform float ret[], uniform float aa[], uniform float b) {
|
|
uniform int foo[10];
|
|
for (uniform int i = 0; i < 10; ++i)
|
|
foo[i] = 10;
|
|
int bb = b;
|
|
foo[bb] = 0;
|
|
ret[programIndex] = foo[4] + foo[5];
|
|
}
|
|
|
|
export void result(uniform float ret[]) {
|
|
ret[programIndex] = 10;
|
|
}
|