diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r-- | intern/cycles/kernel/kernel_random.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index ecf80b817d4..b5f824d5cce 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -102,10 +102,10 @@ __device uint sobol_lookup(const uint m, const uint frame, const uint ex, const return index; } -__device_inline float path_rng(KernelGlobals *kg, RNG rng, int sample, int dimension) +__device_inline float path_rng(KernelGlobals *kg, RNG *rng, int sample, int dimension) { #ifdef __SOBOL_FULL_SCREEN__ - uint result = sobol_dimension(kg, rng, dimension); + uint result = sobol_dimension(kg, *rng, dimension); float r = (float)result * (1.0f/(float)0xFFFFFFFF); return r; #else @@ -117,20 +117,20 @@ __device_inline float path_rng(KernelGlobals *kg, RNG rng, int sample, int dimen float shift; if(dimension & 1) - shift = (rng >> 16)*(1.0f/(float)0xFFFF); + shift = (*rng >> 16)*(1.0f/(float)0xFFFF); else - shift = (rng & 0xFFFF)*(1.0f/(float)0xFFFF); + shift = (*rng & 0xFFFF)*(1.0f/(float)0xFFFF); return r + shift - floorf(r + shift); #endif } -__device_inline float path_rng_1D(KernelGlobals *kg, RNG rng, int sample, int num_samples, int dimension) +__device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension) { #ifdef __CMJ__ if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) { /* correlated multi-jittered */ - int p = rng + dimension; + int p = *rng + dimension; return cmj_sample_1D(sample, num_samples, p); } #endif @@ -139,12 +139,12 @@ __device_inline float path_rng_1D(KernelGlobals *kg, RNG rng, int sample, int nu return path_rng(kg, rng, sample, dimension); } -__device_inline float2 path_rng_2D(KernelGlobals *kg, RNG rng, int sample, int num_samples, int dimension) +__device_inline float2 path_rng_2D(KernelGlobals *kg, RNG *rng, int sample, int num_samples, int dimension) { #ifdef __CMJ__ if(kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_CMJ) { /* correlated multi-jittered */ - int p = rng + dimension; + int p = *rng + dimension; return cmj_sample_2D(sample, num_samples, p); } #endif @@ -184,7 +184,7 @@ __device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state, *fy = 0.5f; } else { - float2 fxy = path_rng_2D(kg, *rng, sample, num_samples, PRNG_FILTER_U); + float2 fxy = path_rng_2D(kg, rng, sample, num_samples, PRNG_FILTER_U); *fx = fxy.x; *fy = fxy.y; |