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.
This commit is contained in:
2017-09-27 00:39:53 +02:00
parent 5b7d6ea54b
commit e3e16cecc4
25 changed files with 21 additions and 93 deletions

View File

@@ -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__