From: Francisco Casas fcasas@codeweavers.com
If the runners require multiple calls to run_shader_tests() for different shader model ranges, these are moved inside the sole runner call.
For the same reason, the trace() messages are also moved inside the runner calls. --- tests/shader_runner.c | 35 ++++++++++++----------------------- tests/shader_runner.h | 9 +++++++-- tests/shader_runner_d3d11.c | 2 ++ tests/shader_runner_d3d12.c | 15 ++++++++++----- tests/shader_runner_d3d9.c | 2 ++ tests/shader_runner_gl.c | 2 ++ tests/shader_runner_vulkan.c | 1 + 7 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 821e2c956..8aab66e44 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -1715,61 +1715,50 @@ START_TEST(shader_runner) #if defined(VKD3D_CROSSTEST) trace("Running tests from a Windows cross build\n");
- trace("Compiling shaders with d3dcompiler_47.dll and executing with d3d9.dll\n"); run_shader_tests_d3d9();
- trace("Compiling shaders with d3dcompiler_47.dll and executing with d3d11.dll\n"); run_shader_tests_d3d11();
- trace("Compiling shaders with d3dcompiler_47.dll and executing with d3d12.dll\n"); - run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + run_shader_tests_d3d12(NULL);
print_dll_version("d3dcompiler_47.dll"); print_dll_version("dxgi.dll"); print_dll_version("d3d9.dll"); print_dll_version("d3d11.dll"); print_dll_version("d3d12.dll"); + #elif defined(_WIN32) trace("Running tests from a Windows non-cross build\n");
- trace("Compiling shaders with vkd3d-shader and executing with d3d9.dll\n"); run_shader_tests_d3d9();
- trace("Compiling shaders with vkd3d-shader and executing with d3d11.dll\n"); run_shader_tests_d3d11();
- trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + dxc_compiler = dxcompiler_create(); + run_shader_tests_d3d12(dxc_compiler);
- if ((dxc_compiler = dxcompiler_create())) - { - trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); - run_shader_tests_d3d12(dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); + if (dxc_compiler) IDxcCompiler3_Release(dxc_compiler); - print_dll_version(SONAME_LIBDXCOMPILER); - }
+ if (dxc_compiler) + print_dll_version(SONAME_LIBDXCOMPILER); print_dll_version("d3d9.dll"); print_dll_version("d3d11.dll"); + #else trace("Running tests from a Unix build\n");
# ifdef HAVE_OPENGL - trace("Compiling shaders with vkd3d-shader and executing with OpenGL\n"); run_shader_tests_gl(); # endif
- trace("Compiling shaders with vkd3d-shader and executing with Vulkan\n"); run_shader_tests_vulkan();
- trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + dxc_compiler = dxcompiler_create(); + run_shader_tests_d3d12(dxc_compiler);
- if ((dxc_compiler = dxcompiler_create())) - { - trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); - run_shader_tests_d3d12(dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); + if (dxc_compiler) IDxcCompiler3_Release(dxc_compiler); - } + #endif } diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 163439477..a66559957 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -28,6 +28,12 @@ #define RENDER_TARGET_WIDTH 640 #define RENDER_TARGET_HEIGHT 480
+#ifdef VKD3D_CROSSTEST +# define HLSL_COMPILER "d3dcompiler_47.dll" +#else +# define HLSL_COMPILER "vkd3d-shader" +#endif + enum shader_model { SHADER_MODEL_2_0, @@ -179,5 +185,4 @@ void run_shader_tests_d3d11(void); void run_shader_tests_gl(void); void run_shader_tests_vulkan(void); #endif -void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader_model, - enum shader_model maximum_shader_model); +void run_shader_tests_d3d12(void *dxc_compiler); diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index 1a62b20cd..62b94e906 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -757,6 +757,8 @@ void run_shader_tests_d3d11(void) struct d3d11_shader_runner runner; HMODULE dxgi_module, d3d11_module;
+ trace("Compiling SM4 shaders with %s and executing with d3d11.dll\n", HLSL_COMPILER); + d3d11_module = LoadLibraryA("d3d11.dll"); dxgi_module = LoadLibraryA("dxgi.dll"); if (d3d11_module && dxgi_module) diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index d6b80d9ea..f1c4d9ff2 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -586,8 +586,7 @@ static const struct shader_runner_ops d3d12_runner_ops = .release_readback = d3d12_runner_release_readback, };
-void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader_model, - enum shader_model maximum_shader_model) +void run_shader_tests_d3d12(void *dxc_compiler) { static const struct test_context_desc desc = { @@ -627,10 +626,16 @@ void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_D3D12_OPTIONS1, &runner.options1, sizeof(runner.options1)); ok(hr == S_OK, "Failed to check feature options1 support, hr %#x.\n", hr); - if (maximum_shader_model >= SHADER_MODEL_6_0) - trace("Int64ShaderOps: %u.\n", runner.options1.Int64ShaderOps); + trace("Int64ShaderOps: %u.\n", runner.options1.Int64ShaderOps);
- run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, minimum_shader_model, maximum_shader_model); + trace("Compiling SM4 shaders with %s and executing with d3d12.dll\n", HLSL_COMPILER); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (dxc_compiler) + { + trace("Compiling SM6 shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); + }
ID3D12GraphicsCommandList_Release(runner.compute_list); ID3D12CommandAllocator_Release(runner.compute_allocator); diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index 0b33c1c53..f4982fafa 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -534,6 +534,8 @@ void run_shader_tests_d3d9(void) struct d3d9_shader_runner runner; HMODULE d3d9_module;
+ trace("Compiling SM1 shaders with %s and executing with d3d9.dll\n", HLSL_COMPILER); + d3d9_module = LoadLibraryA("d3d9.dll"); if (d3d9_module) { diff --git a/tests/shader_runner_gl.c b/tests/shader_runner_gl.c index 9a3dd7104..48a19a420 100644 --- a/tests/shader_runner_gl.c +++ b/tests/shader_runner_gl.c @@ -996,6 +996,8 @@ void run_shader_tests_gl(void) vkd3d_test_name = "shader_runner_gl"; if (!gl_runner_init(&runner)) goto done; + + trace("Compiling SM4 shaders with vkd3d-shader and executing with OpenGL\n"); run_shader_tests(&runner.r, &gl_runner_ops, NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); gl_runner_cleanup(&runner); done: diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index bb6b3a30a..06a654058 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -1420,6 +1420,7 @@ void run_shader_tests_vulkan(void) if (!init_vulkan_runner(&runner)) return;
+ trace("Compiling shaders with vkd3d-shader and executing with Vulkan\n"); run_shader_tests(&runner.r, &vulkan_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_5_1);
cleanup_vulkan_runner(&runner);