Update seed_rng() in stdlib to take a varying seed.
Previously, we were trying to take a uniform seed and then shuffle that around to initialize the state for each of the program instances. This was becoming increasingly untenable and brittle. Now a varying seed is expected and used.
This commit is contained in:
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
|
||||
|
||||
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
||||
RNGState state;
|
||||
seed_rng(&state, 1);
|
||||
seed_rng(&state, programIndex);
|
||||
int count[32];
|
||||
for (uniform int i = 0; i < 32; ++i)
|
||||
count[i] = (b == 5.) ? 0 : 1;
|
||||
|
||||
@@ -3,7 +3,7 @@ export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
RNGState state;
|
||||
seed_rng(&state, 1);
|
||||
seed_rng(&state, programIndex);
|
||||
float sum = 0;
|
||||
uniform int iters = 40000;
|
||||
for (unsigned int i = 0; i < iters; ++i)
|
||||
|
||||
Reference in New Issue
Block a user