1 /* Wine Vulkan ICD private data structures
3 * Copyright 2017 Roderick Colenbrander
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_VULKAN_PRIVATE_H
21 #define __WINE_VULKAN_PRIVATE_H
23 /* Perform vulkan struct conversion on 32-bit x86 platforms. */
25 #define USE_STRUCT_CONVERSION
28 #include "wine/debug.h"
29 #include "wine/heap.h"
30 #include "wine/list.h"
31 #define VK_NO_PROTOTYPES
32 #include "wine/vulkan.h"
33 #include "wine/vulkan_driver.h"
35 #include "vulkan_thunks.h"
37 /* Magic value defined by Vulkan ICD / Loader spec */
38 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
40 #define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
48 /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
49 * This structure MUST be the first element of a dispatchable object as the ICD
50 * loader depends on it. For now only contains loader_magic, but over time more common
51 * functionality is expected.
55 /* Special section in each dispatchable object for use by the ICD loader for
56 * storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
58 UINT_PTR loader_magic
;
61 struct VkCommandBuffer_T
63 struct wine_vk_base base
;
64 struct VkDevice_T
*device
; /* parent */
65 VkCommandBuffer command_buffer
; /* native command buffer */
67 struct list pool_link
;
72 struct wine_vk_base base
;
73 struct vulkan_device_funcs funcs
;
74 VkDevice device
; /* native device */
76 struct VkQueue_T
**queues
;
77 uint32_t max_queue_families
;
84 struct wine_vk_base base
;
85 struct vulkan_instance_funcs funcs
;
86 VkInstance instance
; /* native instance */
88 /* We cache devices as we need to wrap them as they are
89 * dispatchable objects.
91 struct VkPhysicalDevice_T
**phys_devs
;
92 uint32_t phys_dev_count
;
97 struct VkPhysicalDevice_T
99 struct wine_vk_base base
;
100 struct VkInstance_T
*instance
; /* parent */
101 VkPhysicalDevice phys_dev
; /* native physical device */
103 VkExtensionProperties
*extensions
;
104 uint32_t extension_count
;
109 struct wine_vk_base base
;
110 struct VkDevice_T
*device
; /* parent */
111 VkQueue queue
; /* native queue */
113 VkDeviceQueueCreateFlags flags
;
118 VkCommandPool command_pool
;
120 struct list command_buffers
;
123 static inline struct wine_cmd_pool
*wine_cmd_pool_from_handle(VkCommandPool handle
)
125 return (struct wine_cmd_pool
*)(uintptr_t)handle
;
128 static inline VkCommandPool
wine_cmd_pool_to_handle(struct wine_cmd_pool
*cmd_pool
)
130 return (VkCommandPool
)(uintptr_t)cmd_pool
;
133 void *wine_vk_get_device_proc_addr(const char *name
) DECLSPEC_HIDDEN
;
134 void *wine_vk_get_instance_proc_addr(const char *name
) DECLSPEC_HIDDEN
;
136 BOOL
wine_vk_device_extension_supported(const char *name
) DECLSPEC_HIDDEN
;
137 BOOL
wine_vk_instance_extension_supported(const char *name
) DECLSPEC_HIDDEN
;
139 #endif /* __WINE_VULKAN_PRIVATE_H */