diff --git a/tests/performance/api/device.py b/tests/performance/api/device.py index 01197accb87..10b0388e02b 100644 --- a/tests/performance/api/device.py +++ b/tests/performance/api/device.py @@ -42,6 +42,8 @@ def get_gpu_device(args: None) -> list: result.append({'type': device.type, 'name': device.name, 'index': index}) if device.type in {"HIP", "METAL", "ONEAPI"}: result.append({'type': f"{device.type}-RT", 'name': device.name, 'index': index}) + if device.type in {"OPTIX"}: + result.append({'type': f"{device.type}-OSL", 'name': device.name, 'index': index}) index += 1 return result @@ -59,7 +61,8 @@ class TestMachine: def __init__(self, env, need_gpus: bool): operating_system = platform.system() - self.devices = [TestDevice('CPU', 'CPU', get_cpu_name(), operating_system)] + self.devices = [TestDevice('CPU', 'CPU', get_cpu_name(), operating_system), + TestDevice('CPU-OSL', 'CPU-OSL', get_cpu_name(), operating_system)] self.has_gpus = need_gpus if need_gpus and env.blender_executable: diff --git a/tests/performance/tests/cycles.py b/tests/performance/tests/cycles.py index a8310649c86..f4da661e3dd 100644 --- a/tests/performance/tests/cycles.py +++ b/tests/performance/tests/cycles.py @@ -8,12 +8,18 @@ import api def _run(args): import bpy - device_type, suffix = (args['device_type'].split("-") + [""])[:2] - use_hwrt = (suffix == "RT") - device_index = args['device_index'] + device_info = args['device_type'].split("-") + device_type = device_info[0] - if suffix not in {"", "RT"}: - raise SystemExit(f"Unknown device type suffix {suffix}") + device_suffixes = device_info[1:] + use_hwrt = "RT" in device_suffixes + use_osl = "OSL" in device_suffixes + + for suffix in device_suffixes: + if suffix not in {"RT", "OSL"}: + raise SystemExit(f"Unknown device type suffix {suffix}") + + device_index = args['device_index'] scene = bpy.context.scene scene.render.engine = 'CYCLES' @@ -31,6 +37,9 @@ def _run(args): scene.cycles.samples = 16384 scene.cycles.time_limit = 10.0 + if use_osl: + scene.cycles.shading_system = True + if scene.cycles.device == 'GPU': # Enable specified GPU in preferences. prefs = bpy.context.preferences