Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d12/Makefile.in | 7 +- dlls/d3d12/d3d12_main.c | 27 -------- dlls/dxgi/Makefile.in | 6 +- dlls/dxgi/adapter.c | 3 - dlls/dxgi/device.c | 3 - dlls/dxgi/dxgi_main.c | 3 - dlls/dxgi/factory.c | 3 - dlls/dxgi/output.c | 3 - dlls/dxgi/surface.c | 3 - dlls/dxgi/swapchain.c | 138 ---------------------------------------- dlls/dxgi/utils.c | 3 - 11 files changed, 4 insertions(+), 195 deletions(-)
diff --git a/dlls/d3d12/Makefile.in b/dlls/d3d12/Makefile.in index 64930ac442e..8e41d46040c 100644 --- a/dlls/d3d12/Makefile.in +++ b/dlls/d3d12/Makefile.in @@ -1,10 +1,7 @@ MODULE = d3d12.dll IMPORTLIB = d3d12 -IMPORTS = dxgi dxguid gdi32 user32 uuid win32u -EXTRALIBS = $(VKD3D_LIBS) -EXTRAINCL = $(VKD3D_CFLAGS) - -EXTRADLLFLAGS = -mcygwin +IMPORTS = $(VKD3D_PE_LIBS) dxgi dxguid uuid +EXTRAINCL = $(VKD3D_PE_CFLAGS)
C_SRCS = \ d3d12_main.c diff --git a/dlls/d3d12/d3d12_main.c b/dlls/d3d12/d3d12_main.c index 388de0b56c2..1c913023c41 100644 --- a/dlls/d3d12/d3d12_main.c +++ b/dlls/d3d12/d3d12_main.c @@ -17,16 +17,10 @@ * */
-#include "config.h" -#include "wine/port.h" - #define COBJMACROS #define VK_NO_PROTOTYPES #define VKD3D_NO_VULKAN_H #define VKD3D_NO_WIN32_TYPES -#ifndef USE_WIN32_VULKAN -#define WINE_VK_HOST -#endif
#include "wine/debug.h" #include "wine/heap.h" @@ -45,8 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d12); WINE_DECLARE_DEBUG_CHANNEL(winediag);
-#ifdef USE_WIN32_VULKAN - static HMODULE vulkan_module;
/* FIXME: We should unload vulkan-1.dll. */ @@ -68,25 +60,6 @@ static PFN_vkGetInstanceProcAddr load_vulkan(void) return NULL; }
-#else - -static PFN_vkGetInstanceProcAddr load_vulkan(void) -{ - const struct vulkan_funcs *vk_funcs; - HDC hdc; - - hdc = GetDC(0); - vk_funcs = __wine_get_vulkan_driver(hdc, WINE_VULKAN_DRIVER_VERSION); - ReleaseDC(0, hdc); - - if (vk_funcs) - return (PFN_vkGetInstanceProcAddr)vk_funcs->p_vkGetInstanceProcAddr; - - return NULL; -} - -#endif /* USE_WIN32_VULKAN */ - HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug) { TRACE("iid %s, debug %p.\n", debugstr_guid(iid), debug); diff --git a/dlls/dxgi/Makefile.in b/dlls/dxgi/Makefile.in index 3a28d0462de..52e130c3080 100644 --- a/dlls/dxgi/Makefile.in +++ b/dlls/dxgi/Makefile.in @@ -1,9 +1,7 @@ MODULE = dxgi.dll IMPORTLIB = dxgi -IMPORTS = gdi32 dxguid uuid wined3d user32 win32u -EXTRAINCL = $(VKD3D_CFLAGS) - -EXTRADLLFLAGS = -mcygwin +IMPORTS = $(VKD3D_PE_LIBS) gdi32 dxguid uuid wined3d user32 win32u +EXTRAINCL = $(VKD3D_PE_CFLAGS)
C_SRCS = \ adapter.c \ diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index 72f1a2df6b1..644f7e889ec 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index 07773052582..7dcc081ee0a 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index 83c3f3734a7..3a69e1d55c2 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #define DXGI_INIT_GUID #include "dxgi_private.h"
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 4c3e3cf0f34..27340d59157 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); diff --git a/dlls/dxgi/output.c b/dlls/dxgi/output.c index f341388766c..585f5ae5b82 100644 --- a/dlls/dxgi/output.c +++ b/dlls/dxgi/output.c @@ -16,9 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); diff --git a/dlls/dxgi/surface.c b/dlls/dxgi/surface.c index ad2c0d7ff1e..dd069524fbc 100644 --- a/dlls/dxgi/surface.c +++ b/dlls/dxgi/surface.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 5df483f2615..7362f4f61ee 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -17,23 +17,14 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
-#ifdef SONAME_LIBVKD3D #define VK_NO_PROTOTYPES -#define VKD3D_NO_PROTOTYPES #define VKD3D_NO_VULKAN_H #define VKD3D_NO_WIN32_TYPES -#ifndef USE_WIN32_VULKAN -#define WINE_VK_HOST -#endif #include "wine/vulkan.h" #include "wine/vulkan_driver.h" #include <vkd3d.h> -#endif
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -928,20 +919,6 @@ cleanup: return hr; }
-#ifdef SONAME_LIBVKD3D - -#ifdef USE_WIN32_VULKAN - -static void *load_library(const char *name) -{ - return LoadLibraryA(name); -} - -static void *get_library_proc(void *handle, const char *name) -{ - return (void *)GetProcAddress(handle, name); -} - static void close_library(void *handle) { if (handle) @@ -954,56 +931,6 @@ static PFN_vkGetInstanceProcAddr load_vulkan(void **vulkan_handle) return (void *)GetProcAddress(*vulkan_handle, "vkGetInstanceProcAddr"); }
-#else - -static void *load_library(const char *name) -{ - return dlopen(name, RTLD_NOW); -} - -static void *get_library_proc(void *handle, const char *name) -{ - return dlsym(handle, name); -} - -static void close_library(void *handle) -{ - if (handle) - dlclose(handle); -} - -static PFN_vkGetInstanceProcAddr load_vulkan(void **vulkan_handle) -{ - const struct vulkan_funcs *vk_funcs; - HDC hdc; - - *vulkan_handle = NULL; - - hdc = GetDC(0); - vk_funcs = __wine_get_vulkan_driver(hdc, WINE_VULKAN_DRIVER_VERSION); - ReleaseDC(0, hdc); - - if (vk_funcs) - return (PFN_vkGetInstanceProcAddr)vk_funcs->p_vkGetInstanceProcAddr; - - return NULL; -} - -#endif /* USE_WIN32_VULKAN */ - -static PFN_vkd3d_acquire_vk_queue vkd3d_acquire_vk_queue; -static PFN_vkd3d_create_image_resource vkd3d_create_image_resource; -static PFN_vkd3d_get_device_parent vkd3d_get_device_parent; -static PFN_vkd3d_get_vk_device vkd3d_get_vk_device; -static PFN_vkd3d_get_vk_format vkd3d_get_vk_format; -static PFN_vkd3d_get_vk_physical_device vkd3d_get_vk_physical_device; -static PFN_vkd3d_get_vk_queue_family_index vkd3d_get_vk_queue_family_index; -static PFN_vkd3d_instance_from_device vkd3d_instance_from_device; -static PFN_vkd3d_instance_get_vk_instance vkd3d_instance_get_vk_instance; -static PFN_vkd3d_release_vk_queue vkd3d_release_vk_queue; -static PFN_vkd3d_resource_decref vkd3d_resource_decref; -static PFN_vkd3d_resource_incref vkd3d_resource_incref; - struct dxgi_vk_funcs { PFN_vkAcquireNextImageKHR p_vkAcquireNextImageKHR; @@ -2857,53 +2784,6 @@ static const struct IDXGISwapChain4Vtbl d3d12_swapchain_vtbl = d3d12_swapchain_SetHDRMetaData, };
-static BOOL load_vkd3d_functions(void *vkd3d_handle) -{ -#define LOAD_FUNCPTR(f) if (!(f = get_library_proc(vkd3d_handle, #f))) return FALSE; - LOAD_FUNCPTR(vkd3d_acquire_vk_queue) - LOAD_FUNCPTR(vkd3d_create_image_resource) - LOAD_FUNCPTR(vkd3d_get_device_parent) - LOAD_FUNCPTR(vkd3d_get_vk_device) - LOAD_FUNCPTR(vkd3d_get_vk_format) - LOAD_FUNCPTR(vkd3d_get_vk_physical_device) - LOAD_FUNCPTR(vkd3d_get_vk_queue_family_index) - LOAD_FUNCPTR(vkd3d_instance_from_device) - LOAD_FUNCPTR(vkd3d_instance_get_vk_instance) - LOAD_FUNCPTR(vkd3d_release_vk_queue) - LOAD_FUNCPTR(vkd3d_resource_decref) - LOAD_FUNCPTR(vkd3d_resource_incref) -#undef LOAD_FUNCPTR - - return TRUE; -} - -static void *vkd3d_handle; - -static BOOL WINAPI init_vkd3d_once(INIT_ONCE *once, void *param, void **context) -{ - TRACE("Loading vkd3d %s.\n", SONAME_LIBVKD3D); - - if (!(vkd3d_handle = load_library(SONAME_LIBVKD3D))) - return FALSE; - - if (!load_vkd3d_functions(vkd3d_handle)) - { - ERR("Failed to load vkd3d functions.\n"); - close_library(vkd3d_handle); - vkd3d_handle = NULL; - return FALSE; - } - - return TRUE; -} - -static BOOL init_vkd3d(void) -{ - static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; - InitOnceExecuteOnce(&init_once, init_vkd3d_once, NULL, NULL); - return !!vkd3d_handle; -} - static BOOL init_vk_funcs(struct dxgi_vk_funcs *dxgi, VkInstance vk_instance, VkDevice vk_device) { PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; @@ -3046,12 +2926,6 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI return DXGI_ERROR_INVALID_CALL; }
- if (!init_vkd3d()) - { - ERR_(winediag)("libvkd3d could not be loaded.\n"); - return DXGI_ERROR_UNSUPPORTED; - } - if (FAILED(hr = dxgi_get_output_from_window(factory, window, &output))) { WARN("Failed to get output from window %p, hr %#x.\n", window, hr); @@ -3242,15 +3116,3 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
return S_OK; } - -#else - -HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *queue, HWND window, - const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc, - IDXGISwapChain1 **swapchain) -{ - ERR_(winediag)("Wine was built without Direct3D 12 support.\n"); - return DXGI_ERROR_UNSUPPORTED; -} - -#endif /* SONAME_LIBVKD3D */ diff --git a/dlls/dxgi/utils.c b/dlls/dxgi/utils.c index af72f83b6b0..a9fef0a362c 100644 --- a/dlls/dxgi/utils.c +++ b/dlls/dxgi/utils.c @@ -17,9 +17,6 @@ * */
-#include "config.h" -#include "wine/port.h" - #include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi);