mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Tests: Sequencer GPU render tests
Current sequencer render tests always run on the CPU. With addition of compositor based transitions and modifiers, they could be running on the GPU (and more of that whole pipeline will be able to use the GPU soon). Add ability to run these tests on the GPU, gated behind the same WITH_GPU_COMPOSITOR_TESTS build option (on the buildbot that is `+test_gpu_compositor`) Pull Request: https://projects.blender.org/blender/blender/pulls/156704
This commit is contained in:
parent
3a70cd3146
commit
2209ed9433
3 changed files with 63 additions and 11 deletions
|
|
@ -1428,19 +1428,19 @@ if(TEST_SRC_DIR_EXISTS)
|
|||
|
||||
foreach(render_test ${render_tests})
|
||||
add_render_test(
|
||||
sequencer_render_${render_test}
|
||||
sequencer_cpu_${render_test}
|
||||
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
|
||||
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
|
||||
--outdir "${TEST_OUT_DIR}/sequence_editing"
|
||||
--outdir "${TEST_OUT_DIR}/sequencer_cpu"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(video_output_test ${video_output_tests})
|
||||
add_render_test(
|
||||
sequencer_render_${video_output_test}
|
||||
sequencer_cpu_${video_output_test}
|
||||
${CMAKE_CURRENT_LIST_DIR}/sequencer_video_output_tests.py
|
||||
--testdir "${TEST_SRC_DIR}/sequence_editing/${video_output_test}"
|
||||
--outdir "${TEST_OUT_DIR}/sequence_editing"
|
||||
--outdir "${TEST_OUT_DIR}/sequencer_cpu"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
|
|
@ -1456,6 +1456,42 @@ if(TEST_SRC_DIR_EXISTS)
|
|||
${TEST_SRC_DIR}/sequence_editing/vse_load_meta_stack.blend
|
||||
--python ${TEST_PYTHON_DIR}/sequencer_load_meta_stack.py
|
||||
)
|
||||
|
||||
if(WITH_GPU_COMPOSITOR_TESTS)
|
||||
if(WITH_OPENGL_BACKEND)
|
||||
foreach(render_test ${render_tests})
|
||||
add_render_test(
|
||||
sequencer_opengl_${render_test}
|
||||
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
|
||||
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
|
||||
--outdir "${TEST_OUT_DIR}/sequencer_opengl"
|
||||
--gpu-backend opengl
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(WITH_METAL_BACKEND)
|
||||
foreach(render_test ${render_tests})
|
||||
add_render_test(
|
||||
sequencer_metal_${render_test}
|
||||
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
|
||||
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
|
||||
--outdir "${TEST_OUT_DIR}/sequencer_metal"
|
||||
--gpu-backend metal
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
|
||||
foreach(render_test ${render_tests})
|
||||
add_render_test(
|
||||
sequencer_vulkan_${render_test}
|
||||
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
|
||||
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
|
||||
--outdir "${TEST_OUT_DIR}/sequencer_vulkan"
|
||||
--gpu-backend vulkan
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-FileCopyrightText: 2015-2022 Blender Authors
|
||||
# SPDX-FileCopyrightText: 2015-2026 Blender Authors
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
|
|
@ -17,7 +17,11 @@ BLOCKLIST = [
|
|||
]
|
||||
|
||||
|
||||
def get_arguments(filepath, output_filepath):
|
||||
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, backend):
|
||||
dirname = os.path.dirname(filepath)
|
||||
basedir = os.path.dirname(dirname)
|
||||
|
||||
|
|
@ -26,12 +30,20 @@ def get_arguments(filepath, output_filepath):
|
|||
"--factory-startup",
|
||||
"--enable-autoexec",
|
||||
"--debug-memory",
|
||||
"--debug-exit-on-error",
|
||||
"--debug-exit-on-error"]
|
||||
|
||||
execution_device = "CPU"
|
||||
if backend != "CPU":
|
||||
execution_device = "GPU"
|
||||
args.extend(["--gpu-backend", backend])
|
||||
|
||||
args.extend([
|
||||
filepath,
|
||||
"--python-expr", get_compositor_device_setter_script(execution_device),
|
||||
"-o", output_filepath,
|
||||
"-F", "PNG",
|
||||
"-f", "1",
|
||||
]
|
||||
])
|
||||
|
||||
return args
|
||||
|
||||
|
|
@ -45,6 +57,7 @@ def create_argparse():
|
|||
parser.add_argument("--outdir", required=True)
|
||||
parser.add_argument("--oiiotool", required=True)
|
||||
parser.add_argument("--batch", default=False, action="store_true")
|
||||
parser.add_argument('--gpu-backend')
|
||||
return parser
|
||||
|
||||
|
||||
|
|
@ -53,14 +66,17 @@ def main():
|
|||
args = parser.parse_args()
|
||||
|
||||
from modules import render_report
|
||||
report = render_report.Report("Sequencer", args.outdir, args.oiiotool, blocklist=BLOCKLIST)
|
||||
backend = args.gpu_backend if args.gpu_backend else "CPU"
|
||||
report_title = f"Sequencer {backend.upper()}"
|
||||
report = render_report.Report(report_title, args.outdir, args.oiiotool, blocklist=BLOCKLIST)
|
||||
report.set_pixelated(True)
|
||||
# Default error tolerances are quite large, lower them.
|
||||
report.set_fail_threshold(2.0 / 255.0)
|
||||
report.set_fail_percent(0.01)
|
||||
report.set_reference_dir("reference")
|
||||
|
||||
ok = report.run(args.testdir, args.blender, get_arguments, batch=args.batch)
|
||||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ def main():
|
|||
parser = create_argparse()
|
||||
args = parser.parse_args()
|
||||
|
||||
report = VideoOutputReport("Sequencer", args.outdir, args.oiiotool)
|
||||
report = VideoOutputReport("Sequencer CPU", args.outdir, args.oiiotool)
|
||||
report.set_pixelated(True)
|
||||
report.set_fail_threshold(10.0 / 255.0)
|
||||
report.set_fail_percent(1.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue