[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43731] trunk/blender/intern/cycles/kernel : Cycles: fixes for OpenCL build after pass changes, patch by Daniel Genrich.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Jan 26 16:37:34 CET 2012


Revision: 43731
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43731
Author:   blendix
Date:     2012-01-26 15:37:33 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
Cycles: fixes for OpenCL build after pass changes, patch by Daniel Genrich.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/kernel_film.h
    trunk/blender/intern/cycles/kernel/kernel_passes.h
    trunk/blender/intern/cycles/kernel/kernel_path.h

Modified: trunk/blender/intern/cycles/kernel/kernel_film.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_film.h	2012-01-26 15:33:16 UTC (rev 43730)
+++ trunk/blender/intern/cycles/kernel/kernel_film.h	2012-01-26 15:37:33 UTC (rev 43731)
@@ -59,7 +59,7 @@
 	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);
 

Modified: trunk/blender/intern/cycles/kernel/kernel_passes.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_passes.h	2012-01-26 15:33:16 UTC (rev 43730)
+++ trunk/blender/intern/cycles/kernel/kernel_passes.h	2012-01-26 15:37:33 UTC (rev 43731)
@@ -20,19 +20,19 @@
 
 __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;
 }
 

Modified: trunk/blender/intern/cycles/kernel/kernel_path.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_path.h	2012-01-26 15:33:16 UTC (rev 43730)
+++ trunk/blender/intern/cycles/kernel/kernel_path.h	2012-01-26 15:37:33 UTC (rev 43731)
@@ -220,7 +220,7 @@
 
 	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 @@
 			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;
 		}



More information about the Bf-blender-cvs mailing list