Now, if rate qualifiers aren't used to specify otherwise, varying pointers point to uniform types by default. As before, uniform pointers point to varying types by default. float *foo; // varying pointer to uniform float float * uniform foo; // uniform pointer to varying float These defaults seem to require the least amount of explicit uniform/varying qualifiers for most common cases, though TBD if it would be easier to have a single rule that e.g. the pointed-to type is always uniform by default.
23 lines
513 B
Plaintext
23 lines
513 B
Plaintext
|
|
typedef int<4> int4;
|
|
|
|
export uniform int width() { return programCount; }
|
|
|
|
void inc(varying int4 * uniform v) {
|
|
int4 delta = { 1, 1, 1, 1 };
|
|
(*v) += delta;
|
|
}
|
|
|
|
export void f_fu(uniform float ret[], uniform float aa[], uniform float b) {
|
|
float a = aa[programIndex];
|
|
int4 v0 = { b, 2*b, 3*b, 2 };
|
|
inc(&v0);
|
|
if (programIndex & 1) inc(&v0);
|
|
ret[programIndex] = v0.z;
|
|
}
|
|
|
|
export void result(uniform float ret[]) {
|
|
ret[programIndex] = 16;
|
|
if (programIndex & 1) ++ret[programIndex];
|
|
}
|