30 lines
946 B
Plaintext
30 lines
946 B
Plaintext
#include "../test_static.isph"
|
|
// Testing int8 implementation of varying * varying
|
|
void tests_int8(uniform float RET[]) {
|
|
varying int8 p_foo[programCount];
|
|
for (uniform int i = 0; i < programCount; ++i) {
|
|
p_foo[i] = i * programCount + programIndex + 2;
|
|
}
|
|
|
|
// This array stores the expected dereferenced values to compare
|
|
uniform int8 p_foo_res[programCount];
|
|
p_foo_res[programIndex] = programIndex * programCount + programIndex + 2;
|
|
|
|
varying int8 * uniform au = &p_foo[0];
|
|
|
|
// This ensures varying address is stored in av
|
|
varying int8 * varying av = au + programIndex;
|
|
// This will be varying value pointed by the varying address
|
|
varying int8 avDeref = *av;
|
|
if (avDeref != p_foo_res[programIndex])
|
|
RET[programIndex] = 1;
|
|
}
|
|
|
|
task void f_v(uniform float RET[]) {
|
|
RET[programIndex] = 0;
|
|
tests_int8(RET);
|
|
}
|
|
|
|
|
|
task void result(uniform float RET[]) { RET[programIndex] = 0; }
|