diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 0bf5e09f..80d5dfe7 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -1711,61 +1711,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())) + if (dxc_compiler) { - trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); - run_shader_tests_d3d12(dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); IDxcCompiler3_Release(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 16343947..a17fa485 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -179,5 +179,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 1a62b20c..1e22d44e 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -32,6 +32,12 @@ #include "shader_runner.h" #include "vkd3d_test.h" +#ifdef VKD3D_CROSSTEST +static const char HLSL_COMPILER[] = "d3dcompiler47.dll"; +#else +static const char HLSL_COMPILER[] = "vkd3d-shader"; +#endif + static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory); static HRESULT (WINAPI *pD3D11CreateDevice)(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, @@ -757,6 +763,8 @@ void run_shader_tests_d3d11(void) struct d3d11_shader_runner runner; HMODULE dxgi_module, d3d11_module; + trace("Compiling SM4-SM5 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 d6b80d9e..c151b85b 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -25,6 +25,14 @@ #include "shader_runner.h" #include "dxcompiler.h" +#ifdef VKD3D_CROSSTEST +static const char HLSL_COMPILER[] = "d3dcompiler47.dll"; +static const char SHADER_RUNNER[] = "d3d12.dll"; +#else +static const char HLSL_COMPILER[] = "vkd3d-shader"; +static const char SHADER_RUNNER[] = "vkd3d"; +#endif + struct d3d12_resource { struct resource r; @@ -586,8 +594,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 +634,17 @@ 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("Compiling SM4-SM5 shaders with %s and executing with %s\n", HLSL_COMPILER, SHADER_RUNNER); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (dxc_compiler) + { 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 SM6 shaders with dxcompiler and executing with %s\n", SHADER_RUNNER); + 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 0b33c1c5..3440e89c 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -27,6 +27,12 @@ #include "shader_runner.h" #include "vkd3d_test.h" +#ifdef VKD3D_CROSSTEST +static const char HLSL_COMPILER[] = "d3dcompiler47.dll"; +#else +static const char HLSL_COMPILER[] = "vkd3d-shader"; +#endif + struct d3d9_resource { struct resource r; @@ -534,6 +540,8 @@ void run_shader_tests_d3d9(void) struct d3d9_shader_runner runner; HMODULE d3d9_module; + trace("Compiling SM2-SM3 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 9a3dd710..a898d021 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-SM5 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 bb6b3a30..d435a5d3 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 SM2-SM5 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);