tests/shader_runner: Allow selecting the executor.

This commit is contained in:
Giovanni Mascellani
2025-03-06 21:40:14 +01:00
committed by Henri Verbeet
parent f05386e006
commit 5a898254b0
Notes: Henri Verbeet 2025-03-10 15:23:30 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Giovanni Mascellani (@giomasce)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1407

View File

@@ -69,6 +69,7 @@ static struct shader_test_options
{
const char *filename;
enum shader_model minimum_shader_model, maximum_shader_model;
const char *executor_filter;
} shader_test_options = {0};
#ifdef VKD3D_CROSSTEST
@@ -2088,6 +2089,15 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c
compiler_string = dxc_compiler ? "dxcompiler" : HLSL_COMPILER;
if (shader_test_options.executor_filter
&& strcmp(shader_test_options.executor_filter, caps->runner))
{
trace("Skipping compiling shaders with %s and executing with %s "
"because of the executor filter\n",
compiler_string, caps->runner);
return;
}
minimum_shader_model = max(caps->minimum_shader_model, shader_test_options.minimum_shader_model);
maximum_shader_model = min(caps->maximum_shader_model, shader_test_options.maximum_shader_model);
@@ -2629,6 +2639,8 @@ static inline void parse_shader_test_args(int argc, char **argv)
parse_shader_model(argv[++i], &shader_test_options.minimum_shader_model);
else if (!strcmp(argv[i], "--sm-max"))
parse_shader_model(argv[++i], &shader_test_options.maximum_shader_model);
else if (!strcmp(argv[i], "--filter-executor"))
shader_test_options.executor_filter = argv[++i];
else if (argv[i][0] != '-')
shader_test_options.filename = argv[i];
}
@@ -2649,6 +2661,9 @@ START_TEST(shader_runner)
model_strings[shader_test_options.maximum_shader_model]);
}
if (shader_test_options.executor_filter)
trace("Running shaders with executor %s\n", shader_test_options.executor_filter);
dxc = dxcompiler_create();
trace("Running HLSL compile tests.\n");