Cycles UI:

* Added selector for CUDA/OpenCL.
This commit is contained in:
Thomas Dinges 2011-09-01 18:45:50 +00:00
parent cf9d1e23c8
commit af7171524a
4 changed files with 16 additions and 3 deletions

@ -18,7 +18,11 @@
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"),

@ -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")

@ -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")

@ -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();