diff options
author | Thomas Dinges <blender@dingto.org> | 2016-01-10 23:50:44 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-01-10 23:52:39 +0300 |
commit | d23f478863eeefe26c67a8799e27d0596401fa6e (patch) | |
tree | 70225e4e0d7e904f29c33ea0fa074436944c203f /intern | |
parent | 82049cbe7e6003cf9941008a155af4ec08504009 (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 495b2f21f7b..5f3406ec8a4 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 |