Handle more instruction types when flattening offset vectors.
Generalize the lScalarizeVector() utility routine (used in determining when we can change gathers/scatters into vector loads/stores, respectively) to handle vector shuffles and vector loads. This fixes issue #79, which provided a case where a gather was being performed even though a vector load was possible.
This commit is contained in:
17
tests/shuffle-flatten.ispc
Normal file
17
tests/shuffle-flatten.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
int tmp1 = shuffle(programIndex, 0, programIndex);
|
||||
|
||||
RET[programIndex] = 10;
|
||||
if (programIndex < 1) {
|
||||
uniform int foo = extract(tmp1, 0);
|
||||
RET[programIndex] = aFOO[foo + programIndex];
|
||||
}
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 10;
|
||||
RET[0] = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user