From 2445743002fa3d207692613cf09113e2f667a41a Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 18 Jan 2023 13:53:51 +0100 Subject: [PATCH] tests: Run d3d9 and d3d12 tests on non-cross builds too. On cross builds, shaders are compiled with d3dcompiler_47.dll and run with d3dN.dll. On non-cross builds, shaders are compiled with vkd3d-shader and run with d3dN.dll (on Windows) or Vulkan and vkd3d (on Linux). --- Makefile.am | 2 ++ tests/shader_runner.c | 2 +- tests/shader_runner_d3d11.c | 7 +++++-- tests/shader_runner_d3d9.c | 4 ++++ tests/shader_runner_vulkan.c | 4 ++++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index e248ae54..22b516b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -333,6 +333,8 @@ tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@ tests_shader_runner_LDADD = $(LDADD) @DL_LIBS@ tests_shader_runner_SOURCES = \ tests/shader_runner.c \ + tests/shader_runner_d3d9.c \ + tests/shader_runner_d3d11.c \ tests/shader_runner_d3d12.c \ tests/shader_runner_vulkan.c tests_vkd3d_api_LDADD = libvkd3d.la @DL_LIBS@ diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 8e0ecc1a..0f205bfe 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -1060,7 +1060,7 @@ out: START_TEST(shader_runner) { -#ifdef VKD3D_CROSSTEST +#ifdef _WIN32 run_shader_tests_d3d9(argc, argv); run_shader_tests_d3d11(argc, argv); #else diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index d2b4807c..ba9e3179 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -18,8 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifdef _WIN32 + #define COBJMACROS #define CONST_VTABLE +#define INITGUID #define VKD3D_TEST_NO_DEFS #include #define __vkd3d_d3dcommon_h__ @@ -29,8 +32,6 @@ #include "shader_runner.h" #include "vkd3d_test.h" -const GUID IID_IDXGIDevice = {0x54ec77fa, 0x1377, 0x44e6, {0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c}}; - static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory); static HRESULT (WINAPI *pD3D11CreateDevice)(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, @@ -711,3 +712,5 @@ void run_shader_tests_d3d11(int argc, char **argv) FreeLibrary(d3d11_module); FreeLibrary(dxgi_module); } + +#endif diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index e425da1b..fbeee8f9 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifdef _WIN32 + #define COBJMACROS #define CONST_VTABLE #define VKD3D_TEST_NO_DEFS @@ -533,3 +535,5 @@ void run_shader_tests_d3d9(int argc, char **argv) } FreeLibrary(d3d9_module); } + +#endif diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index 39dbd787..74d3f09a 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef _WIN32 + #define VK_NO_PROTOTYPES #define VKD3D_TEST_NO_DEFS #include "config.h" @@ -1285,3 +1287,5 @@ void run_shader_tests_vulkan(int argc, char **argv) cleanup_vulkan_runner(&runner); } + +#endif