diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-21 16:34:34 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-21 16:34:34 +0400 |
commit | e1f79351d67c1a25c18ddf4943b8e10b034b0e2f (patch) | |
tree | e11e740ad51e8593fbbb4871997c4ef7b435362a | |
parent | 2df82a2a2be909e0a1208ed2fe41637f24436414 (diff) |
Fix #35804: NVidia OpenCL render issue after sampler changes, workaround what looks like a compiler bug.
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 16 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_random.h | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index b895d1fcf52..6e1843df50d 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -249,7 +249,11 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample, #endif PathState state; int rng_offset = PRNG_BASE_NUM; +#ifdef __CMJ__ int num_samples = kernel_data.integrator.aa_samples; +#else + int num_samples = 0; +#endif path_state_init(&state); @@ -765,7 +769,11 @@ __device_noinline void kernel_path_non_progressive_lighting(KernelGlobals *kg, R float min_ray_pdf, float ray_pdf, PathState state, int rng_offset, PathRadiance *L, __global float *buffer) { +#ifdef __CMJ__ int aa_samples = kernel_data.integrator.aa_samples; +#else + int aa_samples = 0; +#endif #ifdef __AO__ /* ambient occlusion */ @@ -964,7 +972,11 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam float ray_pdf = 0.0f; PathState state; int rng_offset = PRNG_BASE_NUM; +#ifdef __CMJ__ int aa_samples = kernel_data.integrator.aa_samples; +#else + int aa_samples = 0; +#endif path_state_init(&state); @@ -1141,7 +1153,11 @@ __device void kernel_path_trace(KernelGlobals *kg, float filter_u; float filter_v; +#ifdef __CMJ__ int num_samples = kernel_data.integrator.aa_samples; +#else + int num_samples = 0; +#endif path_rng_init(kg, rng_state, sample, num_samples, &rng, x, y, &filter_u, &filter_v); diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index 20fc1fe2253..6292adff6a5 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -125,9 +125,9 @@ __device_inline float path_rng_1D(KernelGlobals *kg, RNG *rng, int sample, int n float shift; if(dimension & 1) - shift = (*rng >> 16)/((float)0xFFFF); + shift = (*rng >> 16) * (1.0f/(float)0xFFFF); else - shift = (*rng & 0xFFFF)/((float)0xFFFF); + shift = (*rng & 0xFFFF) * (1.0f/(float)0xFFFF); return r + shift - floorf(r + shift); #endif |