Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-09 20:37:04 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-09 20:37:04 +0400
commit13b3b425f8ed2fdedd15b828c1c7b3559f2a2b66 (patch)
treef858d592e2137e55be4d18d0d615adcc7babc82b /intern/cycles/kernel/kernel_random.h
parent0123c7d2be0036435192318a2a3fa7949bc3d5f7 (diff)
Fix #35665: cycles CUDA crash after recent changes. This works around a compiler
bug in CUDA 4.2 (solved in 5.5) with typedef'd function parameters.
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r--intern/cycles/kernel/kernel_random.h18
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;