[Bf-extensions-cvs] [71daaea] master: Fix T50001: auto tile size addon broken after Cycles GPU device changes.

Brecht Van Lommel noreply at git.blender.org
Thu Nov 17 02:28:26 CET 2016


Commit: 71daaea8cd689acdcc958a8c711a5b64156165f3
Author: Brecht Van Lommel
Date:   Thu Nov 17 02:24:39 2016 +0100
Branches: master
https://developer.blender.org/rBA71daaea8cd689acdcc958a8c711a5b64156165f3

Fix T50001: auto tile size addon broken after Cycles GPU device changes.

Note the previous code to compute the number of GPU devices was wrong,
the number after MULTI_* did not indicate the number of devices.

===================================================================

M	render_auto_tile_size.py

===================================================================

diff --git a/render_auto_tile_size.py b/render_auto_tile_size.py
index 8aef71d..3625c0e 100644
--- a/render_auto_tile_size.py
+++ b/render_auto_tile_size.py
@@ -146,7 +146,9 @@ def ats_poll(context):
 
 
 def engine_is_gpu(engine, device, userpref):
-    return engine == 'CYCLES' and device == 'GPU' and userpref.system.compute_device_type != 'NONE'
+    if engine == 'CYCLES' and device == 'GPU':
+        return userpref.addons['cycles'].preferences.has_active_device()
+    return False
 
 
 def get_tilesize_prop(engine, device, userpref):
@@ -206,11 +208,7 @@ def get_threads(context, device):
     userpref = context.user_preferences
 
     if engine_is_gpu(engine, device, userpref):
-        gpu_device_str = userpref.system.compute_device
-        if 'MULTI' in gpu_device_str:
-            threads = int(gpu_device_str.split('_')[-1])
-        else:
-            threads = 1
+        threads = userpref.addons['cycles'].preferences.get_num_gpu_devices()
     else:
         threads = render.threads



More information about the Bf-extensions-cvs mailing list