Implement compute device selector
This commit is contained in:
@@ -11,7 +11,8 @@ class Context:
|
||||
'scenes',
|
||||
'scenes_dir',
|
||||
'configure_script',
|
||||
'image_output_dir')
|
||||
'image_output_dir',
|
||||
'single_compute_scene')
|
||||
|
||||
def __init__(self):
|
||||
# Full path to blender binary.
|
||||
@@ -31,6 +32,9 @@ class Context:
|
||||
# Directory where render result images will be saved.
|
||||
# Empty means no results are saved.
|
||||
self.image_output_dir = ""
|
||||
# There is only one file for each of compute device types, which will
|
||||
# do some post-load setup for compute device and tile size.
|
||||
self.single_compute_scene = False
|
||||
|
||||
def listAllScenes(self, directory):
|
||||
import os
|
||||
@@ -83,7 +87,9 @@ class Context:
|
||||
return True
|
||||
|
||||
def getDeviceFileSuffix(self):
|
||||
if self.device_type == 'CPU':
|
||||
if self.single_compute_scene:
|
||||
return ""
|
||||
elif self.device_type == 'CPU':
|
||||
return '_cpu'
|
||||
elif self.device_type in ('CUDA', 'OPENCL', 'GPU'):
|
||||
return '_gpu'
|
||||
|
Reference in New Issue
Block a user