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.
This commit is contained in:
Thomas Dinges 2016-01-10 21:50:44 +01:00
parent 82049cbe7e
commit d23f478863

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