Cycles: fixes for OpenCL build after pass changes, patch by Daniel Genrich.

This commit is contained in:
Brecht Van Lommel 2012-01-26 15:37:33 +00:00
parent bcbe9ca5fc
commit de5d5ded7b
3 changed files with 7 additions and 5 deletions

@ -59,7 +59,7 @@ __device void kernel_film_tonemap(KernelGlobals *kg,
buffer += index*kernel_data.film.pass_stride;
/* map colors */
float4 irradiance = *(float4*)buffer;
float4 irradiance = *((__global float4*)buffer);
float4 float_result = film_map(kg, irradiance, sample);
uchar4 byte_result = film_float_to_byte(float_result);

@ -20,19 +20,19 @@ CCL_NAMESPACE_BEGIN
__device_inline void kernel_write_pass_float(__global float *buffer, int sample, float value)
{
float *buf = buffer;
__global float *buf = buffer;
*buf = (sample == 0)? value: *buf + value;
}
__device_inline void kernel_write_pass_float3(__global float *buffer, int sample, float3 value)
{
float3 *buf = (float3*)buffer;
__global float3 *buf = (__global float3*)buffer;
*buf = (sample == 0)? value: *buf + value;
}
__device_inline void kernel_write_pass_float4(__global float *buffer, int sample, float4 value)
{
float4 *buf = (float4*)buffer;
__global float4 *buf = (__global float4*)buffer;
*buf = (sample == 0)? value: *buf + value;
}

@ -220,7 +220,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
path_radiance_init(&L, kernel_data.film.use_light_pass);
#ifdef __EMISSION__
#if defined(__EMISSION__) || defined(__BACKGROUND__)
float ray_pdf = 0.0f;
#endif
PathState state;
@ -239,11 +239,13 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
if(kernel_data.background.transparent && (state.flag & PATH_RAY_CAMERA)) {
L_transparent += average(throughput);
}
#ifdef __BACKGROUND__
else {
/* sample background shader */
float3 L_background = indirect_background(kg, &ray, state.flag, ray_pdf);
path_radiance_accum_background(&L, throughput, L_background, state.bounce);
}
#endif
break;
}