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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-09-27 01:39:53 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-04 22:11:14 +0300
commite3e16cecc4f080edbbd14e4bf1cfc580c5957d62 (patch)
tree5b9da903526442acb10b48d2ccee5686a00a1017 /intern/cycles/kernel/kernel_random.h
parent5b7d6ea54b2fc35b8b12c667f5bf9a1c9c46d5c2 (diff)
Code refactor: remove rng_state buffer and compute hash on the fly.
A little faster on some benchmark scenes, a little slower on others, seems about performance neutral on average and saves a little memory.
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r--intern/cycles/kernel/kernel_random.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h
index 11798d87cb5..e7a6134b8eb 100644
--- a/intern/cycles/kernel/kernel_random.h
+++ b/intern/cycles/kernel/kernel_random.h
@@ -15,6 +15,7 @@
*/
#include "kernel/kernel_jitter.h"
+#include "util/util_hash.h"
CCL_NAMESPACE_BEGIN
@@ -115,14 +116,13 @@ ccl_device_forceinline void path_rng_2D(KernelGlobals *kg,
}
ccl_device_inline void path_rng_init(KernelGlobals *kg,
- ccl_global uint *rng_state,
int sample, int num_samples,
uint *rng_hash,
int x, int y,
float *fx, float *fy)
{
/* load state */
- *rng_hash = *rng_state;
+ *rng_hash = hash_int_2d(x, y);
*rng_hash ^= kernel_data.integrator.seed;
#ifdef __DEBUG_CORRELATION__