winevulkan: Separate PE and Unix VkQueue structs.
[wine.git] / dlls / winevulkan / vulkan_loader.h
blobf47cc59e0320850b5e5503f91a77b9c6054ac6f3
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
23 #include "ntstatus.h"
24 #define WIN32_NO_STATUS
25 #include <stdarg.h>
26 #include <stdlib.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winternl.h"
30 #include "wine/debug.h"
31 #include "wine/vulkan.h"
32 #include "wine/unixlib.h"
34 #include "loader_thunks.h"
36 /* Magic value defined by Vulkan ICD / Loader spec */
37 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
39 #define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
40 #define WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT 0x00000002
41 #define WINEVULKAN_QUIRK_IGNORE_EXPLICIT_LAYERS 0x00000004
43 /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
44 * This structure MUST be the first element of a dispatchable object as the ICD
45 * loader depends on it. For now only contains loader_magic, but over time more common
46 * functionality is expected.
48 struct wine_vk_base
50 /* Special section in each dispatchable object for use by the ICD loader for
51 * storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
53 UINT64 loader_magic;
54 UINT64 unix_handle;
57 struct VkQueue_T
59 struct wine_vk_base base;
62 struct VkDevice_T
64 struct wine_vk_base base;
65 unsigned int quirks;
66 struct VkQueue_T queues[1];
69 struct vulkan_func
71 const char *name;
72 void *func;
75 void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;
76 void *wine_vk_get_phys_dev_proc_addr(const char *name) DECLSPEC_HIDDEN;
77 void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
79 /* debug callbacks params */
81 struct wine_vk_debug_utils_params
83 PFN_vkDebugUtilsMessengerCallbackEXT user_callback;
84 void *user_data;
86 VkDebugUtilsMessageSeverityFlagBitsEXT severity;
87 VkDebugUtilsMessageTypeFlagsEXT message_types;
88 VkDebugUtilsMessengerCallbackDataEXT data;
91 struct wine_vk_debug_report_params
93 PFN_vkDebugReportCallbackEXT user_callback;
94 void *user_data;
96 VkDebugReportFlagsEXT flags;
97 VkDebugReportObjectTypeEXT object_type;
98 uint64_t object_handle;
99 size_t location;
100 int32_t code;
101 const char *layer_prefix;
102 const char *message;
105 struct is_available_instance_function_params
107 VkInstance instance;
108 const char *name;
111 struct is_available_device_function_params
113 VkDevice device;
114 const char *name;
117 extern NTSTATUS (WINAPI *p_vk_direct_unix_call)(unixlib_handle_t handle, unsigned int code,
118 void *args) DECLSPEC_HIDDEN;
119 extern unixlib_handle_t unix_handle DECLSPEC_HIDDEN;
121 static inline NTSTATUS vk_unix_call(enum unix_call code, void *params)
123 return __wine_unix_call(unix_handle, code, params);
126 #endif /* __WINE_VULKAN_LOADER_H */