Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2016-10-30 01:56:39 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2016-10-30 13:51:20 +0300
commit4e68f48227e228fbf75736005ceed4cf1cb55215 (patch)
tree5bc3cf3e92d1b63714055cabd3d73eb971d1bcaa /intern/cycles/kernel/kernel_path_common.h
parent26bf230920cb9ca0aa9626430169967f9e120482 (diff)
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
Diffstat (limited to 'intern/cycles/kernel/kernel_path_common.h')
-rw-r--r--intern/cycles/kernel/kernel_path_common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_path_common.h b/intern/cycles/kernel/kernel_path_common.h
index 1912dfa16ed..13597eab287 100644
--- a/intern/cycles/kernel/kernel_path_common.h
+++ b/intern/cycles/kernel/kernel_path_common.h
@@ -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 */