From d23f478863eeefe26c67a8799e27d0596401fa6e Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 10 Jan 2016 21:50:44 +0100 Subject: [PATCH] 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. --- intern/cycles/blender/addon/ui.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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