Cycles: Cleanup: Swap order of the RNG-state-initializing for-loops

Swap the for-loops in the RenderBuffer reset code to follow the convention
of looping over y in the outer loop.
The improved cache performance won't really be noticable here, but it's nicer
if it follows the usual style.
This commit is contained in:
Lukas Stockner 2016-05-08 01:22:28 +02:00
parent e5b4e6b0a3
commit 1955754934
1 changed files with 3 additions and 3 deletions

View File

@ -138,9 +138,9 @@ void RenderBuffers::reset(Device *device, BufferParams& params_)
uint *init_state = rng_state.resize(params.width, params.height);
int x, y, width = params.width, height = params.height;
for(x = 0; x < width; x++)
for(y = 0; y < height; y++)
init_state[x + y*width] = hash_int_2d(params.full_x+x, params.full_y+y);
for(y = 0; y < height; y++)
for(x = 0; x < width; x++)
init_state[y*width + x] = hash_int_2d(params.full_x+x, params.full_y+y);
device->mem_alloc(rng_state, MEM_READ_WRITE);
device->mem_copy_to(rng_state);