Cycles UI:
authorThomas Dinges <blender@dingto.org>
Thu, 1 Sep 2011 18:45:50 +0000 (18:45 +0000)
committerThomas Dinges <blender@dingto.org>
Thu, 1 Sep 2011 18:45:50 +0000 (18:45 +0000)
* Added selector for CUDA/OpenCL.

intern/cycles/blender/addon/enums.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_sync.cpp

index 4b30f606de21a1672e5a0dfcbdbf88e14eaa7418..0ae97184e65da9be1c8de19564c4b284bb78fa39 100644 (file)
 
 devices = (
 ("CPU", "CPU", "Processor"),
-("GPU", "GPU", "Graphics card (NVidia only)"))
+("GPU", "GPU", "Graphics card"))
+
+gpu_type = (
+("CUDA", "CUDA", "NVidia only"),
+("OPENCL", "OpenCL", ""))
 
 shading_systems = (
 ("GPU_COMPATIBLE", "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
index ca38520d28f7962673d28b97e46db5fbec2242f9..5d90223032f84a0faf9ef36ea685bd97d992e94b 100644 (file)
@@ -28,6 +28,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
 
         cls.device = EnumProperty(name="Device", description="Device to use for rendering",
             items=enums.devices, default="CPU")
+            
+        cls.gpu_type = EnumProperty(name="GPU Type", description="Processing system to use on the GPU",
+            items=enums.gpu_type, default="CUDA")
 
         cls.shading_system = EnumProperty(name="Shading System", description="Shading system to use for rendering",
             items=enums.shading_systems, default="GPU_COMPATIBLE")
index 001aacea3eb07f4e811a49c3e4f00665fc3cfc19..ca6800e7fa0285c393b854762e1513eeb125aa6a 100644 (file)
@@ -522,8 +522,10 @@ def draw_device(self, context):
     if scene.render.engine == "CYCLES":
         cscene = scene.cycles
 
-        if 'cuda' in engine.available_devices():
+        if ('cuda' or 'opencl') in engine.available_devices():
             layout.prop(cscene, "device")
+            if cscene.device == 'GPU':
+                layout.prop(cscene, "gpu_type", expand=True)
         if cscene.device == 'CPU' and engine.with_osl():
             layout.prop(cscene, "shading_system")
 
index 40ec4838dad4b9b260e75f34d051003ce4096462..0c447c0512e57d4a4cae31289d88650bf66afe9e 100644 (file)
@@ -202,10 +202,14 @@ bool BlenderSync::get_session_pause(BL::Scene b_scene, bool background)
 SessionParams BlenderSync::get_session_params(BL::Scene b_scene, bool background)
 {
        SessionParams params;
+       DeviceType dtype;
        PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
 
        /* device type */
-       DeviceType dtype = (RNA_enum_get(&cscene, "device") == 1)? DEVICE_CUDA: DEVICE_CPU;
+       if ((RNA_enum_get(&cscene, "device")) == 0)
+               dtype = DEVICE_CPU;
+       else 
+               dtype = ((RNA_enum_get(&cscene, "gpu_type")) == 0)? DEVICE_CUDA: DEVICE_OPENCL;
 
        params.device_type = DEVICE_CPU;
        vector<DeviceType> types = Device::available_types();