From fcc9f9b2944282251595344391d712d99ecef163 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 17 Oct 2016 14:48:30 +0200 Subject: [PATCH] libs/vkd3d: Merge vkd3d_vulkan.h into vkd3d_private.h. --- Makefile.am | 1 - libs/vkd3d/vkd3d_private.h | 33 +++++++++++++++++++++- libs/vkd3d/vkd3d_vulkan.h | 58 -------------------------------------- 3 files changed, 32 insertions(+), 60 deletions(-) delete mode 100644 libs/vkd3d/vkd3d_vulkan.h diff --git a/Makefile.am b/Makefile.am index 59b88b84..95ee50d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,6 @@ libvkd3d_la_SOURCES = \ libs/vkd3d/utils.c \ libs/vkd3d/vkd3d_main.c \ libs/vkd3d/vkd3d_private.h \ - libs/vkd3d/vkd3d_vulkan.h \ libs/vkd3d/vulkan_procs.h libvkd3d_la_LIBADD = libvkd3d-common.la @PTHREAD_LIBS@ diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 34838f83..b703b388 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -23,17 +23,21 @@ #ifndef __VKD3D_PRIVATE_H #define __VKD3D_PRIVATE_H +#define VK_NO_PROTOTYPES +#include + #define COBJMACROS #define NONAMELESSUNION #include "vkd3d.h" #include "vkd3d_memory.h" -#include "vkd3d_vulkan.h" #include #include #include #include +#define VK_CALL(f) (vk_procs->f) + #define VKD3D_DESCRIPTOR_MAGIC_FREE 0x00000000u #define VKD3D_DESCRIPTOR_MAGIC_RTV 0x00565452u @@ -42,6 +46,21 @@ struct d3d12_command_list; struct d3d12_device; +#define DECLARE_VK_PFN(name) PFN_##name name; +struct vkd3d_vk_instance_procs +{ +#define VK_INSTANCE_PFN DECLARE_VK_PFN +#include "vulkan_procs.h" +}; + +struct vkd3d_vk_device_procs +{ +#define VK_INSTANCE_PFN DECLARE_VK_PFN +#define VK_DEVICE_PFN DECLARE_VK_PFN +#include "vulkan_procs.h" +}; +#undef DECLARE_VK_PFN + struct vkd3d_instance { VkInstance vk_instance; @@ -358,4 +377,16 @@ HRESULT vkd3d_load_vk_instance_procs(struct vkd3d_vk_instance_procs *procs, HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device) DECLSPEC_HIDDEN; +/* We link directly to the loader library and use the following exported functions. */ +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, + const char *name); +VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkInstance *instance); +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *layer_name, + uint32_t *property_count, VkExtensionProperties *properties); +VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *property_count, + VkLayerProperties *properties); +VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *allocator); +VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *allocator); + #endif /* __VKD3D_PRIVATE_H */ diff --git a/libs/vkd3d/vkd3d_vulkan.h b/libs/vkd3d/vkd3d_vulkan.h deleted file mode 100644 index 7c5c6854..00000000 --- a/libs/vkd3d/vkd3d_vulkan.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Józef Kucia for CodeWeavers - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef __VKD3D_VULKAN_H -#define __VKD3D_VULKAN_H - -#define VK_NO_PROTOTYPES -#include "vulkan/vulkan.h" - -#define DECLARE_VK_PFN(name) PFN_##name name; - -/* We link directly to the loader library and use the following exported functions. */ -VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, - const char *name); -VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *create_info, - const VkAllocationCallbacks *allocator, VkInstance *instance); -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *layer_name, - uint32_t *property_count, VkExtensionProperties *properties); -VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *property_count, - VkLayerProperties *properties); -VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *allocator); -VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *allocator); - -struct vkd3d_vk_instance_procs -{ -#define VK_INSTANCE_PFN DECLARE_VK_PFN -#include "vulkan_procs.h" -}; - -struct vkd3d_vk_device_procs -{ -#define VK_INSTANCE_PFN DECLARE_VK_PFN -#define VK_DEVICE_PFN DECLARE_VK_PFN -#include "vulkan_procs.h" -}; - -#define VK_CALL(f) (vk_procs->f) - -#endif /* __VKD3D_VULKAN_H */