From cfa8b762e20dce2e59aff5dffed872a9e3631f3c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 19 Aug 2017 04:11:25 +0200 Subject: Code cleanup: move rng into path state. Also pass by value and don't write back now that it is just a hash for seeding and no longer an LCG state. Together this makes CUDA a tiny bit faster in my tests, but mainly simplifies code. --- intern/cycles/kernel/kernel_types.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'intern/cycles/kernel/kernel_types.h') diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index f1b82eee352..58371c56267 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -242,10 +242,6 @@ CCL_NAMESPACE_BEGIN # undef __DENOISING_FEATURES__ #endif -/* Random Numbers */ - -typedef uint RNG; - /* Shader Evaluation */ typedef enum ShaderEvalType { @@ -1023,6 +1019,7 @@ typedef struct PathState { int flag; /* random number generator state */ + uint rng_hash; /* per pixel hash */ int rng_offset; /* dimension offset */ int sample; /* path sample number */ int num_samples; /* total number of times this path will be sampled */ @@ -1048,7 +1045,7 @@ typedef struct PathState { /* volume rendering */ #ifdef __VOLUME__ int volume_bounce; - RNG rng_congruential; + uint rng_congruential; VolumeStack volume_stack[VOLUME_STACK_SIZE]; #endif } PathState; -- cgit v1.2.3