[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57523] branches/soc-2013-dingto/intern/ cycles: Cycles / GPU:

Thomas Dinges blender at dingto.org
Mon Jun 17 17:56:29 CEST 2013


Revision: 57523
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57523
Author:   dingto
Date:     2013-06-17 15:56:28 +0000 (Mon, 17 Jun 2013)
Log Message:
-----------
Cycles / GPU:
* Enable the Non-Progressive integrator on GPU (CUDA) for testing.

In order to compile the CUDA kernel with it, you need at least 6GB of system memory and CUDA Toolkit 5.0 or 5.5.
It should also work with CUDA Toolkit 4.2, but in this case you should have 12GB of RAM. 

In case any problems arise, just change line 65 of kernel_types.h to disable Non-Progressive again. 
-- #define __NON_PROGRESSIVE__
++ //#define __NON_PROGRESSIVE__

Modified Paths:
--------------
    branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py
    branches/soc-2013-dingto/intern/cycles/blender/blender_sync.cpp
    branches/soc-2013-dingto/intern/cycles/kernel/kernel_shader.h
    branches/soc-2013-dingto/intern/cycles/kernel/kernel_types.h

Modified: branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py	2013-06-17 15:32:33 UTC (rev 57522)
+++ branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py	2013-06-17 15:56:28 UTC (rev 57523)
@@ -51,20 +51,17 @@
 
         scene = context.scene
         cscene = scene.cycles
-        device_type = context.user_preferences.system.compute_device_type
 
         split = layout.split()
 
         col = split.column()
-        sub = col.column()
-        sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
-        sub.prop(cscene, "progressive")
+        col.prop(cscene, "progressive")
 
         sub = col.column(align=True)
         sub.prop(cscene, "seed")
         sub.prop(cscene, "sample_clamp")
 
-        if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
+        if cscene.progressive:
             col = split.column()
             col.label(text="Samples:")
             sub = col.column(align=True)
@@ -610,7 +607,6 @@
         lamp = context.lamp
         clamp = lamp.cycles
         cscene = context.scene.cycles
-        device_type = context.user_preferences.system.compute_device_type
 
         layout.prop(lamp, "type", expand=True)
 
@@ -629,7 +625,7 @@
                 sub.prop(lamp, "size", text="Size X")
                 sub.prop(lamp, "size_y", text="Size Y")
 
-        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
+        if not cscene.progressive:
             col.prop(clamp, "samples")
 
         col = split.column()
@@ -817,7 +813,6 @@
         world = context.world
         cworld = world.cycles
         cscene = context.scene.cycles
-        device_type = context.user_preferences.system.compute_device_type
 
         col = layout.column()
 
@@ -825,7 +820,7 @@
         sub = col.row(align=True)
         sub.active = cworld.sample_as_light
         sub.prop(cworld, "sample_map_resolution")
-        if not cscene.progressive and (device_type == 'NONE' or cscene.device == 'CPU'):
+        if not cscene.progressive:
             sub.prop(cworld, "samples")
 
 

Modified: branches/soc-2013-dingto/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/soc-2013-dingto/intern/cycles/blender/blender_sync.cpp	2013-06-17 15:32:33 UTC (rev 57522)
+++ branches/soc-2013-dingto/intern/cycles/blender/blender_sync.cpp	2013-06-17 15:56:28 UTC (rev 57523)
@@ -385,7 +385,7 @@
 	params.background = background;
 
 	/* samples */
-	if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU) {
+	if(get_boolean(cscene, "progressive") == 0) {
 		if(background) {
 			params.samples = get_int(cscene, "aa_samples");
 		}

Modified: branches/soc-2013-dingto/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/soc-2013-dingto/intern/cycles/kernel/kernel_shader.h	2013-06-17 15:32:33 UTC (rev 57522)
+++ branches/soc-2013-dingto/intern/cycles/kernel/kernel_shader.h	2013-06-17 15:56:28 UTC (rev 57523)
@@ -916,8 +916,15 @@
 				sci->sample_weight += scj->sample_weight;
 
 				int size = sd->num_closure - (j+1);
-				if(size > 0)
+				if(size > 0) {
+#ifdef __KERNEL_GPU__
+					for(int k = 0; k < size; k++) {
+						scj[k] = scj[k+1];
+					}
+#else
 					memmove(scj, scj+1, size*sizeof(ShaderClosure));
+#endif
+				}
 
 				sd->num_closure--;
 				j--;

Modified: branches/soc-2013-dingto/intern/cycles/kernel/kernel_types.h
===================================================================
--- branches/soc-2013-dingto/intern/cycles/kernel/kernel_types.h	2013-06-17 15:32:33 UTC (rev 57522)
+++ branches/soc-2013-dingto/intern/cycles/kernel/kernel_types.h	2013-06-17 15:56:28 UTC (rev 57523)
@@ -62,6 +62,7 @@
 #define __KERNEL_SHADING__
 #if __CUDA_ARCH__ >= 200
 #define __KERNEL_ADV_SHADING__
+#define __NON_PROGRESSIVE__
 #endif
 #endif
 




More information about the Bf-blender-cvs mailing list