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
This commit is contained in:
Brecht Van Lommel
2025-10-15 16:16:30 +02:00
parent 74b7d663e1
commit dbfab80943
4 changed files with 20 additions and 26 deletions

View File

@@ -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'):

View File

@@ -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',

View File

@@ -60,6 +60,7 @@ BLOCKLIST_METAL = [
]
def setup():
import bpy
import addon_utils