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

@@ -14,6 +14,8 @@
* limitations under the License.
*/
#include "util_hash.h"
CCL_NAMESPACE_BEGIN
ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg,
@@ -28,6 +30,10 @@ ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg,
int num_samples = kernel_data.integrator.aa_samples;
if(sample == 0) {
*rng_state = hash_int_2d(x, y);
}
path_rng_init(kg, rng_state, sample, num_samples, rng, x, y, &filter_u, &filter_v);
/* sample camera ray */