diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_jitter.h')
-rw-r--r-- | intern/cycles/kernel/kernel_jitter.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_jitter.h b/intern/cycles/kernel/kernel_jitter.h index d8b4db498c8..18666b51c0c 100644 --- a/intern/cycles/kernel/kernel_jitter.h +++ b/intern/cycles/kernel/kernel_jitter.h @@ -137,6 +137,8 @@ __device_inline float cmj_randfloat(uint i, uint p) #ifdef __CMJ__ __device float cmj_sample_1D(int s, int N, int p) { + kernel_assert(s < N); + uint x = cmj_permute(s, N, p * 0x68bc21eb); float jx = cmj_randfloat(s, p * 0x967a889b); @@ -146,6 +148,8 @@ __device float cmj_sample_1D(int s, int N, int p) __device void cmj_sample_2D(int s, int N, int p, float *fx, float *fy) { + kernel_assert(s < N); + int m = float_to_int(sqrtf(N)); int n = (N + m - 1)/m; float invN = 1.0f/N; |