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_LOADER_H
21 #define __WINE_VULKAN_LOADER_H
24 #define WIN32_NO_STATUS
31 #include "wine/debug.h"
32 #include "wine/vulkan.h"
33 #include "wine/unixlib.h"
34 #include "wine/list.h"
36 #include "loader_thunks.h"
38 /* Magic value defined by Vulkan ICD / Loader spec */
39 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
41 #define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
42 #define WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT 0x00000002
43 #define WINEVULKAN_QUIRK_IGNORE_EXPLICIT_LAYERS 0x00000004
45 /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
46 * This structure MUST be the first element of a dispatchable object as the ICD
47 * loader depends on it. For now only contains loader_magic, but over time more common
48 * functionality is expected.
52 /* Special section in each dispatchable object for use by the ICD loader for
53 * storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
59 struct VkPhysicalDevice_T
61 struct wine_vk_base base
;
66 struct wine_vk_base base
;
67 uint32_t phys_dev_count
;
68 struct VkPhysicalDevice_T phys_devs
[1];
73 struct wine_vk_base base
;
78 struct wine_vk_base base
;
80 struct VkQueue_T queues
[1];
83 struct vk_command_pool
86 struct list command_buffers
;
89 static inline struct vk_command_pool
*command_pool_from_handle(VkCommandPool handle
)
91 return (struct vk_command_pool
*)(uintptr_t)handle
;
94 struct VkCommandBuffer_T
96 struct wine_vk_base base
;
97 struct list pool_link
;
106 void *wine_vk_get_device_proc_addr(const char *name
);
107 void *wine_vk_get_phys_dev_proc_addr(const char *name
);
108 void *wine_vk_get_instance_proc_addr(const char *name
);
110 /* debug callbacks params */
112 struct wine_vk_debug_utils_params
114 PFN_vkDebugUtilsMessengerCallbackEXT user_callback
;
117 VkDebugUtilsMessageSeverityFlagBitsEXT severity
;
118 VkDebugUtilsMessageTypeFlagsEXT message_types
;
119 VkDebugUtilsMessengerCallbackDataEXT data
;
122 struct wine_vk_debug_report_params
124 PFN_vkDebugReportCallbackEXT user_callback
;
127 VkDebugReportFlagsEXT flags
;
128 VkDebugReportObjectTypeEXT object_type
;
129 uint64_t object_handle
;
132 const char *layer_prefix
;
136 struct is_available_instance_function_params
142 struct is_available_device_function_params
148 #define UNIX_CALL(code, params) WINE_UNIX_CALL(unix_ ## code, params)
150 #endif /* __WINE_VULKAN_LOADER_H */