winevulkan: Implement VK_KHR_get_physical_device_properties2.
[wine.git] / dlls / winevulkan / vulkan_private.h
blob419e6ac4857a0c94a23f74e47c6b77d769df6636
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 #include "vulkan_thunks.h"
25 /* Magic value defined by Vulkan ICD / Loader spec */
26 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
28 #ifndef ARRAY_SIZE
29 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
30 #endif
32 struct vulkan_func
34 const char *name;
35 void *func;
38 /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
39 * This structure MUST be the first element of a dispatchable object as the ICD
40 * loader depends on it. For now only contains loader_magic, but over time more common
41 * functionality is expected.
43 struct wine_vk_base
45 /* Special section in each dispatchable object for use by the ICD loader for
46 * storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
48 UINT_PTR loader_magic;
51 struct VkCommandBuffer_T
53 struct wine_vk_base base;
54 VkDevice device; /* parent */
55 VkCommandBuffer command_buffer; /* native command buffer */
58 struct VkDevice_T
60 struct wine_vk_base base;
61 struct vulkan_device_funcs funcs;
62 struct VkPhysicalDevice_T *phys_dev; /* parent */
64 uint32_t max_queue_families;
65 struct VkQueue_T **queues;
67 VkDevice device; /* native device */
70 struct VkInstance_T
72 struct wine_vk_base base;
73 struct vulkan_instance_funcs funcs;
75 /* We cache devices as we need to wrap them as they are
76 * dispatchable objects.
78 uint32_t num_phys_devs;
79 struct VkPhysicalDevice_T **phys_devs;
81 VkInstance instance; /* native instance */
84 struct VkPhysicalDevice_T
86 struct wine_vk_base base;
87 struct VkInstance_T *instance; /* parent */
89 uint32_t num_properties;
90 VkExtensionProperties *properties;
92 VkPhysicalDevice phys_dev; /* native physical device */
95 struct VkQueue_T
97 struct wine_vk_base base;
98 VkDevice device; /* parent */
99 VkQueue queue; /* native queue */
102 #endif /* __WINE_VULKAN_PRIVATE_H */