Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (21 sloc) 0.739 kb
3cb0115 Add routines to standard library to do efficient AOS/SOA conversions.
Matt Pharr authored
1
2 export uniform int width() { return programCount; }
3
4 export void f_v(uniform float RET[]) {
5 #define width 3
d866536 Fix a number of tests to work correctly with 32/64-wide targets.
Matt Pharr authored
6 #define maxProgramCount 64
7 assert(programCount <= maxProgramCount);
8
3cb0115 Add routines to standard library to do efficient AOS/SOA conversions.
Matt Pharr authored
9 //CO const uniform int width = 3;
10 //CO const uniform int maxProgramCount = 16;
11 uniform float a[width*maxProgramCount], r[width*maxProgramCount];
12 for (uniform int i = 0; i < width*maxProgramCount; ++i)
13 a[i] = i;
14
15 float x=-1, y=-1, z=-1;
186d022 Fix AoS/SoA stdlib functions to match documentation
Matt Pharr authored
16 aos_to_soa3(a, &x, &y, &z);
3cb0115 Add routines to standard library to do efficient AOS/SOA conversions.
Matt Pharr authored
17
18 int errs = 0;
19 if (x != width * programIndex) ++errs;
20 if (y != 1 + width * programIndex) ++errs;
21 if (z != 2 + width * programIndex) ++errs;
22
23 RET[programIndex] = errs;
24 }
25
26 export void result(uniform float RET[]) {
27 RET[programIndex] = 0;
28 }
29
Something went wrong with that request. Please try again.