[Bf-blender-cvs] [d23f478] master: Cycles: Add utility funcs to UI code, to check GPU usage.
Thomas Dinges
noreply at git.blender.org
Sun Jan 10 21:53:19 CET 2016
Commit: d23f478863eeefe26c67a8799e27d0596401fa6e
Author: Thomas Dinges
Date: Sun Jan 10 21:50:44 2016 +0100
Branches: master
https://developer.blender.org/rBd23f478863eeefe26c67a8799e27d0596401fa6e
Cycles: Add utility funcs to UI code, to check GPU usage.
Can be useful sometimes, and we already have this for CPU. Required for
some further work here.
===================================================================
M intern/cycles/blender/addon/ui.py
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 495b2f2..5f3406ec 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -60,6 +60,20 @@ def use_cpu(context):
return (device_type == 'NONE' or cscene.device == 'CPU')
+def use_opencl(context):
+ cscene = context.scene.cycles
+ device_type = context.user_preferences.system.compute_device_type
+
+ return (device_type == 'OPENCL' and cscene.device == 'GPU')
+
+
+def use_cuda(context):
+ cscene = context.scene.cycles
+ device_type = context.user_preferences.system.compute_device_type
+
+ return (device_type == 'CUDA' and cscene.device == 'GPU')
+
+
def use_branched_path(context):
cscene = context.scene.cycles
device_type = context.user_preferences.system.compute_device_type
More information about the Bf-blender-cvs
mailing list