16
tests/foreach-active-1.ispc
Normal file
16
tests/foreach-active-1.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
uniform int count = 0;
|
||||
if (programIndex & 1)
|
||||
foreach_active (i)
|
||||
++count;
|
||||
RET[programIndex] = count;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = programCount / 2;
|
||||
}
|
||||
16
tests/foreach-active-2.ispc
Normal file
16
tests/foreach-active-2.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
uniform int count = 0;
|
||||
if (programIndex & 1)
|
||||
foreach_active (i)
|
||||
++a;
|
||||
RET[programIndex] = a;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = (1 + programIndex) + ((programIndex & 1) ? 1 : 0);
|
||||
}
|
||||
16
tests/foreach-active-3.ispc
Normal file
16
tests/foreach-active-3.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
RET[programIndex] = a;
|
||||
|
||||
if (programIndex & 1)
|
||||
foreach_active (i)
|
||||
++RET[i];
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = (1 + programIndex) + ((programIndex & 1) ? 1 : 0);
|
||||
}
|
||||
21
tests/foreach-active-4.ispc
Normal file
21
tests/foreach-active-4.ispc
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
RET[programIndex] = a;
|
||||
|
||||
if (programIndex & 1) {
|
||||
foreach_active (i) {
|
||||
if (i == 1)
|
||||
continue;
|
||||
++RET[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = (1 + programIndex) + ((programIndex & 1) ? 1 : 0);
|
||||
--RET[1];
|
||||
}
|
||||
22
tests/foreach-active-5.ispc
Normal file
22
tests/foreach-active-5.ispc
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float a = aFOO[programIndex];
|
||||
RET[programIndex] = a;
|
||||
|
||||
if (programIndex & 1) {
|
||||
foreach_active (i) {
|
||||
if (i & 1)
|
||||
continue;
|
||||
|
||||
int * uniform null = 0;
|
||||
*null = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = (1 + programIndex);
|
||||
}
|
||||
Reference in New Issue
Block a user