wsdapi: Add a trailing '\n' to a WARN() message.
[wine.git] / dlls / winevulkan / vulkan_private.h
blob582fb7822928ae1a35c2b1231d39c5c2852709f6
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 "wine/debug.h"
29 #include "wine/heap.h"
30 #define VK_NO_PROTOTYPES
31 #include "wine/vulkan.h"
32 #include "wine/vulkan_driver.h"
34 #include "vulkan_thunks.h"
36 /* Magic value defined by Vulkan ICD / Loader spec */
37 #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
39 #ifndef ARRAY_SIZE
40 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
41 #endif
43 #define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
45 struct vulkan_func
47 const char *name;
48 void *func;
51 /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
52 * This structure MUST be the first element of a dispatchable object as the ICD
53 * loader depends on it. For now only contains loader_magic, but over time more common
54 * functionality is expected.
56 struct wine_vk_base
58 /* Special section in each dispatchable object for use by the ICD loader for
59 * storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
61 UINT_PTR loader_magic;
64 struct VkCommandBuffer_T
66 struct wine_vk_base base;
67 struct VkDevice_T *device; /* parent */
68 VkCommandBuffer command_buffer; /* native command buffer */
71 struct VkDevice_T
73 struct wine_vk_base base;
74 struct vulkan_device_funcs funcs;
75 VkDevice device; /* native device */
77 struct VkQueue_T **queues;
78 uint32_t max_queue_families;
80 unsigned int quirks;
83 struct VkInstance_T
85 struct wine_vk_base base;
86 struct vulkan_instance_funcs funcs;
87 VkInstance instance; /* native instance */
89 /* We cache devices as we need to wrap them as they are
90 * dispatchable objects.
92 struct VkPhysicalDevice_T **phys_devs;
93 uint32_t num_phys_devs;
95 unsigned int quirks;
98 struct VkPhysicalDevice_T
100 struct wine_vk_base base;
101 struct VkInstance_T *instance; /* parent */
102 VkPhysicalDevice phys_dev; /* native physical device */
104 VkExtensionProperties *extensions;
105 uint32_t extension_count;
108 struct VkQueue_T
110 struct wine_vk_base base;
111 struct VkDevice_T *device; /* parent */
112 VkQueue queue; /* native queue */
115 void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;
116 void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
118 BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN;
119 BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;
121 #endif /* __WINE_VULKAN_PRIVATE_H */