15
tests/new-delete-1.ispc
Normal file
15
tests/new-delete-1.ispc
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
float * uniform buf = uniform new float[programCount];
|
||||
for (uniform int i = 0; i < programCount; ++i)
|
||||
buf[i] = i;
|
||||
RET[programIndex] = buf[a-1];
|
||||
delete buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = programIndex;
|
||||
}
|
||||
15
tests/new-delete-2.ispc
Normal file
15
tests/new-delete-2.ispc
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
uniform float * uniform buf = uniform new uniform float[programCount];
|
||||
for (uniform int i = 0; i < programCount; ++i)
|
||||
buf[i] = i;
|
||||
RET[programIndex] = buf[a-1];
|
||||
delete buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = programIndex;
|
||||
}
|
||||
17
tests/new-delete-3.ispc
Normal file
17
tests/new-delete-3.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
float * uniform buf = uniform new float[programCount+1];
|
||||
for (uniform int i = 0; i < programCount+1; ++i) {
|
||||
buf[i] = i+a;
|
||||
}
|
||||
RET[programIndex] = buf[a];
|
||||
delete buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 2 + 2*programIndex;
|
||||
}
|
||||
14
tests/new-delete-4.ispc
Normal file
14
tests/new-delete-4.ispc
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
float * uniform buf = uniform new float(2*b);
|
||||
RET[programIndex] = buf[0];
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 10;
|
||||
}
|
||||
17
tests/new-delete-5.ispc
Normal file
17
tests/new-delete-5.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
struct Point {
|
||||
uniform float x, y, z;
|
||||
};
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
varying Point * uniform buf = uniform new varying Point(a, b, 1234.);
|
||||
RET[programIndex] = buf->y;
|
||||
delete buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 5;
|
||||
}
|
||||
17
tests/new-delete-6.ispc
Normal file
17
tests/new-delete-6.ispc
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
struct Point {
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
float a = aFOO[programIndex];
|
||||
Point * varying buf = new Point(0., b, a);
|
||||
RET[programIndex] = buf->z;
|
||||
delete buf;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1+programIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user