winevulkan: Limit vkGetDeviceProcAddr() workaround to broken apps.
[wine.git] / dlls / winevulkan / vulkan_private.h
blob30ab62547f7487aecbb297a36011610b88aff98f
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. */
24 #if defined(__i386__)
25 #define USE_STRUCT_CONVERSION
26 #endif
28 #include "vulkan_thunks.h"
30 /* Magic value defined by Vulkan ICD / Loader spec */
31 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
33 #ifndef ARRAY_SIZE
34 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
35 #endif
37 #define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
39 struct vulkan_func
41 const char *name;
42 void *func;
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.
50 struct wine_vk_base
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'.
55 UINT_PTR loader_magic;
58 struct VkCommandBuffer_T
60 struct wine_vk_base base;
61 VkDevice device; /* parent */
62 VkCommandBuffer command_buffer; /* native command buffer */
65 struct VkDevice_T
67 struct wine_vk_base base;
68 struct vulkan_device_funcs funcs;
69 struct VkPhysicalDevice_T *phys_dev; /* parent */
71 uint32_t max_queue_families;
72 struct VkQueue_T **queues;
74 VkDevice device; /* native device */
76 unsigned int quirks;
79 struct VkInstance_T
81 struct wine_vk_base base;
82 struct vulkan_instance_funcs funcs;
84 /* We cache devices as we need to wrap them as they are
85 * dispatchable objects.
87 uint32_t num_phys_devs;
88 struct VkPhysicalDevice_T **phys_devs;
90 VkInstance instance; /* native instance */
92 unsigned int quirks;
95 struct VkPhysicalDevice_T
97 struct wine_vk_base base;
98 struct VkInstance_T *instance; /* parent */
100 uint32_t extension_count;
101 VkExtensionProperties *extensions;
103 VkPhysicalDevice phys_dev; /* native physical device */
106 struct VkQueue_T
108 struct wine_vk_base base;
109 VkDevice device; /* parent */
110 VkQueue queue; /* native queue */
113 void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;
114 void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
116 BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN;
117 BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;
119 #endif /* __WINE_VULKAN_PRIVATE_H */