Fix: Vulkan compositor tests do not run
This commit fixes a issue where GPU compositor tests would always run with the default GPU backend, Metal for macOS, and OpenGL for other operating systems. Now tests correctly run on the defined GPU backend, allowing Vulkan GPU compositor tests to correctly run with the Vulkan GPU backend. Pull Request: https://projects.blender.org/blender/blender/pulls/141447
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-FileCopyrightText: 2015-2022 Blender Authors
|
||||
# SPDX-FileCopyrightText: 2015-2025 Blender Authors
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
@@ -20,7 +20,7 @@ def get_compositor_device_setter_script(execution_device):
|
||||
return f"import bpy; bpy.data.scenes[0].render.compositor_device = '{execution_device}'"
|
||||
|
||||
|
||||
def get_arguments(filepath, output_filepath, execution_device):
|
||||
def get_arguments(filepath, output_filepath, backend):
|
||||
arguments = [
|
||||
"--background",
|
||||
"--factory-startup",
|
||||
@@ -28,6 +28,11 @@ def get_arguments(filepath, output_filepath, execution_device):
|
||||
"--debug-memory",
|
||||
"--debug-exit-on-error"]
|
||||
|
||||
execution_device = "CPU"
|
||||
if backend != "CPU":
|
||||
execution_device = "GPU"
|
||||
arguments.extend(["--gpu-backend", backend])
|
||||
|
||||
arguments.extend([
|
||||
filepath,
|
||||
"-P", os.path.realpath(__file__),
|
||||
@@ -56,8 +61,8 @@ def main():
|
||||
args = parser.parse_args()
|
||||
|
||||
from modules import render_report
|
||||
execution_device = "GPU" if args.gpu_backend else "CPU"
|
||||
report_title = f"Compositor {execution_device}"
|
||||
backend = args.gpu_backend if args.gpu_backend else "CPU"
|
||||
report_title = f"Compositor {backend.upper()}"
|
||||
report = render_report.Report(report_title, args.outdir, args.oiiotool)
|
||||
report.set_pixelated(True)
|
||||
report.set_reference_dir("compositor_renders")
|
||||
@@ -73,7 +78,7 @@ def main():
|
||||
report.set_fail_threshold(0.06)
|
||||
report.set_fail_percent(2)
|
||||
|
||||
def arguments_callback(filepath, output_filepath): return get_arguments(filepath, output_filepath, execution_device)
|
||||
def arguments_callback(filepath, output_filepath): return get_arguments(filepath, output_filepath, backend)
|
||||
ok = report.run(args.testdir, args.blender, arguments_callback, batch=args.batch)
|
||||
|
||||
sys.exit(not ok)
|
||||
|
||||
Reference in New Issue
Block a user