From dbfab809434a843abe2ba3aae3940117216af383 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 15 Oct 2025 16:16:30 +0200 Subject: [PATCH] Tests: Move GPU vendor query function to module, remove dead code for EEVEE The implementation of this was broken and not actually used for the EEVEE tests, as there is currently no separate reference directory for AMD. Move it to the render report module so it can be reused by different tests. Pull Request: https://projects.blender.org/blender/blender/pulls/148148 --- tests/python/eevee_render_tests.py | 26 -------------------------- tests/python/{ => modules}/gpu_info.py | 0 tests/python/modules/render_report.py | 19 +++++++++++++++++++ tests/python/storm_render_tests.py | 1 + 4 files changed, 20 insertions(+), 26 deletions(-) rename tests/python/{ => modules}/gpu_info.py (100%) diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py index 9d36bd809e3..b0bc97a3688 100644 --- a/tests/python/eevee_render_tests.py +++ b/tests/python/eevee_render_tests.py @@ -170,26 +170,6 @@ if inside_blender: sys.exit(1) -def get_gpu_device_type(blender): - # TODO: This always fails. - command = [ - blender, - "--background", - "--factory-startup", - "--python", - str(pathlib.Path(__file__).parent / "gpu_info.py") - ] - try: - completed_process = subprocess.run(command, stdout=subprocess.PIPE) - for line in completed_process.stdout.read_text(): - if line.startswith("GPU_DEVICE_TYPE:"): - vendor = line.split(':')[1] - return vendor - except Exception: - return None - return None - - def get_arguments(filepath, output_filepath, gpu_backend): arguments = [ "--background", @@ -230,11 +210,6 @@ def main(): parser = create_argparse() args = parser.parse_args() - gpu_device_type = get_gpu_device_type(args.blender) - reference_override_dir = None - if gpu_device_type == "AMD": - reference_override_dir = "eevee_renders/amd" - blocklist = BLOCKLIST if args.gpu_backend == "metal": blocklist += BLOCKLIST_METAL @@ -249,7 +224,6 @@ def main(): report.set_pixelated(True) report.set_reference_dir("eevee_renders") - report.set_reference_override_dir(reference_override_dir) test_dir_name = Path(args.testdir).name if test_dir_name.startswith('image_mapping'): diff --git a/tests/python/gpu_info.py b/tests/python/modules/gpu_info.py similarity index 100% rename from tests/python/gpu_info.py rename to tests/python/modules/gpu_info.py diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index 4d888c9371a..2a163bd49a9 100644 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -174,6 +174,25 @@ def diff_output(test, oiiotool, fail_threshold, fail_percent, verbose, update): return test +def get_gpu_device_vendor(blender): + command = [ + blender, + "--background", + "--factory-startup", + "--python", + str(pathlib.Path(__file__).parent / "gpu_info.py") + ] + try: + completed_process = subprocess.run(command, stdout=subprocess.PIPE, universal_newlines=True) + for line in completed_process.stdout.splitlines(): + if line.startswith("GPU_DEVICE_TYPE:"): + vendor = line.split(':')[1].upper() + return vendor + except Exception: + return None + return None + + class Report: __slots__ = ( 'title', diff --git a/tests/python/storm_render_tests.py b/tests/python/storm_render_tests.py index d27c40cb94f..af17d3d9397 100644 --- a/tests/python/storm_render_tests.py +++ b/tests/python/storm_render_tests.py @@ -60,6 +60,7 @@ BLOCKLIST_METAL = [ ] + def setup(): import bpy import addon_utils