Cycles: Initialize the RNG state from the kernel instead of the host

This allows to save a memory copy, which will be particularly useful for network rendering.

Reviewers: sergey, brecht, dingto, juicyfruit, maiself

Differential Revision: https://developer.blender.org/D2323
This commit is contained in:
Lukas Stockner
2016-10-30 00:56:39 +02:00
parent 26bf230920
commit 4e68f48227
4 changed files with 11 additions and 10 deletions

View File

@@ -135,15 +135,7 @@ void RenderBuffers::reset(Device *device, BufferParams& params_)
/* allocate rng state */
rng_state.resize(params.width, params.height);
uint *init_state = rng_state.resize(params.width, params.height);
int x, y, width = params.width, height = params.height;
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);
}
bool RenderBuffers::copy_from_device()