-
Notifications
You must be signed in to change notification settings - Fork 55
/
vk_wrapper.h
244 lines (225 loc) · 12.2 KB
/
vk_wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
#ifndef VULKAN_WRAPPER_H_
#define VULKAN_WRAPPER_H_ 1
#define VK_NO_PROTOTYPES 1
#include "vulkan/vulkan.h"
#ifdef VK_USE_PLATFORM_IOS_MVK
#include "moltenVK/vk_mvk_moltenvk.h"
#endif
void setProcAddr(void* getProcAddr);
void setDefaultProcAddr();
int isProcAddrSet();
int vkInit();
int vkInitInstance(VkInstance instance);
// VK_core
extern PFN_vkCreateInstance vgo_vkCreateInstance;
extern PFN_vkDestroyInstance vgo_vkDestroyInstance;
extern PFN_vkEnumeratePhysicalDevices vgo_vkEnumeratePhysicalDevices;
extern PFN_vkGetPhysicalDeviceFeatures vgo_vkGetPhysicalDeviceFeatures;
extern PFN_vkGetPhysicalDeviceFormatProperties vgo_vkGetPhysicalDeviceFormatProperties;
extern PFN_vkGetPhysicalDeviceImageFormatProperties vgo_vkGetPhysicalDeviceImageFormatProperties;
extern PFN_vkGetPhysicalDeviceProperties vgo_vkGetPhysicalDeviceProperties;
extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vgo_vkGetPhysicalDeviceQueueFamilyProperties;
extern PFN_vkGetPhysicalDeviceMemoryProperties vgo_vkGetPhysicalDeviceMemoryProperties;
extern PFN_vkGetInstanceProcAddr vgo_vkGetInstanceProcAddr;
extern PFN_vkGetDeviceProcAddr vgo_vkGetDeviceProcAddr;
extern PFN_vkCreateDevice vgo_vkCreateDevice;
extern PFN_vkDestroyDevice vgo_vkDestroyDevice;
extern PFN_vkEnumerateInstanceExtensionProperties vgo_vkEnumerateInstanceExtensionProperties;
extern PFN_vkEnumerateDeviceExtensionProperties vgo_vkEnumerateDeviceExtensionProperties;
extern PFN_vkEnumerateInstanceLayerProperties vgo_vkEnumerateInstanceLayerProperties;
extern PFN_vkEnumerateDeviceLayerProperties vgo_vkEnumerateDeviceLayerProperties;
extern PFN_vkGetDeviceQueue vgo_vkGetDeviceQueue;
extern PFN_vkQueueSubmit vgo_vkQueueSubmit;
extern PFN_vkQueueWaitIdle vgo_vkQueueWaitIdle;
extern PFN_vkDeviceWaitIdle vgo_vkDeviceWaitIdle;
extern PFN_vkAllocateMemory vgo_vkAllocateMemory;
extern PFN_vkFreeMemory vgo_vkFreeMemory;
extern PFN_vkMapMemory vgo_vkMapMemory;
extern PFN_vkUnmapMemory vgo_vkUnmapMemory;
extern PFN_vkFlushMappedMemoryRanges vgo_vkFlushMappedMemoryRanges;
extern PFN_vkInvalidateMappedMemoryRanges vgo_vkInvalidateMappedMemoryRanges;
extern PFN_vkGetDeviceMemoryCommitment vgo_vkGetDeviceMemoryCommitment;
extern PFN_vkBindBufferMemory vgo_vkBindBufferMemory;
extern PFN_vkBindImageMemory vgo_vkBindImageMemory;
extern PFN_vkGetBufferMemoryRequirements vgo_vkGetBufferMemoryRequirements;
extern PFN_vkGetImageMemoryRequirements vgo_vkGetImageMemoryRequirements;
extern PFN_vkGetImageSparseMemoryRequirements vgo_vkGetImageSparseMemoryRequirements;
extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties vgo_vkGetPhysicalDeviceSparseImageFormatProperties;
extern PFN_vkQueueBindSparse vgo_vkQueueBindSparse;
extern PFN_vkCreateFence vgo_vkCreateFence;
extern PFN_vkDestroyFence vgo_vkDestroyFence;
extern PFN_vkResetFences vgo_vkResetFences;
extern PFN_vkGetFenceStatus vgo_vkGetFenceStatus;
extern PFN_vkWaitForFences vgo_vkWaitForFences;
extern PFN_vkCreateSemaphore vgo_vkCreateSemaphore;
extern PFN_vkDestroySemaphore vgo_vkDestroySemaphore;
extern PFN_vkCreateEvent vgo_vkCreateEvent;
extern PFN_vkDestroyEvent vgo_vkDestroyEvent;
extern PFN_vkGetEventStatus vgo_vkGetEventStatus;
extern PFN_vkSetEvent vgo_vkSetEvent;
extern PFN_vkResetEvent vgo_vkResetEvent;
extern PFN_vkCreateQueryPool vgo_vkCreateQueryPool;
extern PFN_vkDestroyQueryPool vgo_vkDestroyQueryPool;
extern PFN_vkGetQueryPoolResults vgo_vkGetQueryPoolResults;
extern PFN_vkCreateBuffer vgo_vkCreateBuffer;
extern PFN_vkDestroyBuffer vgo_vkDestroyBuffer;
extern PFN_vkCreateBufferView vgo_vkCreateBufferView;
extern PFN_vkDestroyBufferView vgo_vkDestroyBufferView;
extern PFN_vkCreateImage vgo_vkCreateImage;
extern PFN_vkDestroyImage vgo_vkDestroyImage;
extern PFN_vkGetImageSubresourceLayout vgo_vkGetImageSubresourceLayout;
extern PFN_vkCreateImageView vgo_vkCreateImageView;
extern PFN_vkDestroyImageView vgo_vkDestroyImageView;
extern PFN_vkCreateShaderModule vgo_vkCreateShaderModule;
extern PFN_vkDestroyShaderModule vgo_vkDestroyShaderModule;
extern PFN_vkCreatePipelineCache vgo_vkCreatePipelineCache;
extern PFN_vkDestroyPipelineCache vgo_vkDestroyPipelineCache;
extern PFN_vkGetPipelineCacheData vgo_vkGetPipelineCacheData;
extern PFN_vkMergePipelineCaches vgo_vkMergePipelineCaches;
extern PFN_vkCreateGraphicsPipelines vgo_vkCreateGraphicsPipelines;
extern PFN_vkCreateComputePipelines vgo_vkCreateComputePipelines;
extern PFN_vkDestroyPipeline vgo_vkDestroyPipeline;
extern PFN_vkCreatePipelineLayout vgo_vkCreatePipelineLayout;
extern PFN_vkDestroyPipelineLayout vgo_vkDestroyPipelineLayout;
extern PFN_vkCreateSampler vgo_vkCreateSampler;
extern PFN_vkDestroySampler vgo_vkDestroySampler;
extern PFN_vkCreateDescriptorSetLayout vgo_vkCreateDescriptorSetLayout;
extern PFN_vkDestroyDescriptorSetLayout vgo_vkDestroyDescriptorSetLayout;
extern PFN_vkCreateDescriptorPool vgo_vkCreateDescriptorPool;
extern PFN_vkDestroyDescriptorPool vgo_vkDestroyDescriptorPool;
extern PFN_vkResetDescriptorPool vgo_vkResetDescriptorPool;
extern PFN_vkAllocateDescriptorSets vgo_vkAllocateDescriptorSets;
extern PFN_vkFreeDescriptorSets vgo_vkFreeDescriptorSets;
extern PFN_vkUpdateDescriptorSets vgo_vkUpdateDescriptorSets;
extern PFN_vkCreateFramebuffer vgo_vkCreateFramebuffer;
extern PFN_vkDestroyFramebuffer vgo_vkDestroyFramebuffer;
extern PFN_vkCreateRenderPass vgo_vkCreateRenderPass;
extern PFN_vkDestroyRenderPass vgo_vkDestroyRenderPass;
extern PFN_vkGetRenderAreaGranularity vgo_vkGetRenderAreaGranularity;
extern PFN_vkCreateCommandPool vgo_vkCreateCommandPool;
extern PFN_vkDestroyCommandPool vgo_vkDestroyCommandPool;
extern PFN_vkResetCommandPool vgo_vkResetCommandPool;
extern PFN_vkAllocateCommandBuffers vgo_vkAllocateCommandBuffers;
extern PFN_vkFreeCommandBuffers vgo_vkFreeCommandBuffers;
extern PFN_vkBeginCommandBuffer vgo_vkBeginCommandBuffer;
extern PFN_vkEndCommandBuffer vgo_vkEndCommandBuffer;
extern PFN_vkResetCommandBuffer vgo_vkResetCommandBuffer;
extern PFN_vkCmdBindPipeline vgo_vkCmdBindPipeline;
extern PFN_vkCmdSetViewport vgo_vkCmdSetViewport;
extern PFN_vkCmdSetScissor vgo_vkCmdSetScissor;
extern PFN_vkCmdSetLineWidth vgo_vkCmdSetLineWidth;
extern PFN_vkCmdSetDepthBias vgo_vkCmdSetDepthBias;
extern PFN_vkCmdSetBlendConstants vgo_vkCmdSetBlendConstants;
extern PFN_vkCmdSetDepthBounds vgo_vkCmdSetDepthBounds;
extern PFN_vkCmdSetStencilCompareMask vgo_vkCmdSetStencilCompareMask;
extern PFN_vkCmdSetStencilWriteMask vgo_vkCmdSetStencilWriteMask;
extern PFN_vkCmdSetStencilReference vgo_vkCmdSetStencilReference;
extern PFN_vkCmdBindDescriptorSets vgo_vkCmdBindDescriptorSets;
extern PFN_vkCmdBindIndexBuffer vgo_vkCmdBindIndexBuffer;
extern PFN_vkCmdBindVertexBuffers vgo_vkCmdBindVertexBuffers;
extern PFN_vkCmdDraw vgo_vkCmdDraw;
extern PFN_vkCmdDrawIndexed vgo_vkCmdDrawIndexed;
extern PFN_vkCmdDrawIndirect vgo_vkCmdDrawIndirect;
extern PFN_vkCmdDrawIndexedIndirect vgo_vkCmdDrawIndexedIndirect;
extern PFN_vkCmdDispatch vgo_vkCmdDispatch;
extern PFN_vkCmdDispatchIndirect vgo_vkCmdDispatchIndirect;
extern PFN_vkCmdCopyBuffer vgo_vkCmdCopyBuffer;
extern PFN_vkCmdCopyImage vgo_vkCmdCopyImage;
extern PFN_vkCmdBlitImage vgo_vkCmdBlitImage;
extern PFN_vkCmdCopyBufferToImage vgo_vkCmdCopyBufferToImage;
extern PFN_vkCmdCopyImageToBuffer vgo_vkCmdCopyImageToBuffer;
extern PFN_vkCmdUpdateBuffer vgo_vkCmdUpdateBuffer;
extern PFN_vkCmdFillBuffer vgo_vkCmdFillBuffer;
extern PFN_vkCmdClearColorImage vgo_vkCmdClearColorImage;
extern PFN_vkCmdClearDepthStencilImage vgo_vkCmdClearDepthStencilImage;
extern PFN_vkCmdClearAttachments vgo_vkCmdClearAttachments;
extern PFN_vkCmdResolveImage vgo_vkCmdResolveImage;
extern PFN_vkCmdSetEvent vgo_vkCmdSetEvent;
extern PFN_vkCmdResetEvent vgo_vkCmdResetEvent;
extern PFN_vkCmdWaitEvents vgo_vkCmdWaitEvents;
extern PFN_vkCmdPipelineBarrier vgo_vkCmdPipelineBarrier;
extern PFN_vkCmdBeginQuery vgo_vkCmdBeginQuery;
extern PFN_vkCmdEndQuery vgo_vkCmdEndQuery;
extern PFN_vkCmdResetQueryPool vgo_vkCmdResetQueryPool;
extern PFN_vkCmdWriteTimestamp vgo_vkCmdWriteTimestamp;
extern PFN_vkCmdCopyQueryPoolResults vgo_vkCmdCopyQueryPoolResults;
extern PFN_vkCmdPushConstants vgo_vkCmdPushConstants;
extern PFN_vkCmdBeginRenderPass vgo_vkCmdBeginRenderPass;
extern PFN_vkCmdNextSubpass vgo_vkCmdNextSubpass;
extern PFN_vkCmdEndRenderPass vgo_vkCmdEndRenderPass;
extern PFN_vkCmdExecuteCommands vgo_vkCmdExecuteCommands;
// VK_KHR_surface
extern PFN_vkDestroySurfaceKHR vgo_vkDestroySurfaceKHR;
extern PFN_vkGetPhysicalDeviceSurfaceSupportKHR vgo_vkGetPhysicalDeviceSurfaceSupportKHR;
extern PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vgo_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
extern PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vgo_vkGetPhysicalDeviceSurfaceFormatsKHR;
extern PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vgo_vkGetPhysicalDeviceSurfacePresentModesKHR;
// VK_KHR_swapchain
extern PFN_vkCreateSwapchainKHR vgo_vkCreateSwapchainKHR;
extern PFN_vkDestroySwapchainKHR vgo_vkDestroySwapchainKHR;
extern PFN_vkGetSwapchainImagesKHR vgo_vkGetSwapchainImagesKHR;
extern PFN_vkAcquireNextImageKHR vgo_vkAcquireNextImageKHR;
extern PFN_vkQueuePresentKHR vgo_vkQueuePresentKHR;
// VK_KHR_display
extern PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vgo_vkGetPhysicalDeviceDisplayPropertiesKHR;
extern PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vgo_vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
extern PFN_vkGetDisplayPlaneSupportedDisplaysKHR vgo_vkGetDisplayPlaneSupportedDisplaysKHR;
extern PFN_vkGetDisplayModePropertiesKHR vgo_vkGetDisplayModePropertiesKHR;
extern PFN_vkCreateDisplayModeKHR vgo_vkCreateDisplayModeKHR;
extern PFN_vkGetDisplayPlaneCapabilitiesKHR vgo_vkGetDisplayPlaneCapabilitiesKHR;
extern PFN_vkCreateDisplayPlaneSurfaceKHR vgo_vkCreateDisplayPlaneSurfaceKHR;
// VK_KHR_display_swapchain
extern PFN_vkCreateSharedSwapchainsKHR vgo_vkCreateSharedSwapchainsKHR;
#ifdef VK_USE_PLATFORM_XLIB_KHR
// VK_KHR_xlib_surface
extern PFN_vkCreateXlibSurfaceKHR vgo_vkCreateXlibSurfaceKHR;
extern PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vgo_vkGetPhysicalDeviceXlibPresentationSupportKHR;
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
// VK_KHR_xcb_surface
extern PFN_vkCreateXcbSurfaceKHR vgo_vkCreateXcbSurfaceKHR;
extern PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vgo_vkGetPhysicalDeviceXcbPresentationSupportKHR;
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
// VK_KHR_wayland_surface
extern PFN_vkCreateWaylandSurfaceKHR vgo_vkCreateWaylandSurfaceKHR;
extern PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vgo_vkGetPhysicalDeviceWaylandPresentationSupportKHR;
#endif
#ifdef VK_USE_PLATFORM_MIR_KHR
// VK_KHR_mir_surface
extern PFN_vkCreateMirSurfaceKHR vgo_vkCreateMirSurfaceKHR;
extern PFN_vkGetPhysicalDeviceMirPresentationSupportKHR vgo_vkGetPhysicalDeviceMirPresentationSupportKHR;
#endif
#ifdef VK_USE_PLATFORM_ANDROID_KHR
// VK_KHR_android_surface
extern PFN_vkCreateAndroidSurfaceKHR vgo_vkCreateAndroidSurfaceKHR;
#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
// VK_MVK_ios_surface
extern PFN_vkCreateIOSSurfaceMVK vgo_vkCreateIOSSurfaceMVK;
extern PFN_vkActivateMoltenVKLicenseMVK vgo_vkActivateMoltenVKLicenseMVK;
extern PFN_vkActivateMoltenVKLicensesMVK vgo_vkActivateMoltenVKLicensesMVK;
extern PFN_vkGetMoltenVKDeviceConfigurationMVK vgo_vkGetMoltenVKDeviceConfigurationMVK;
extern PFN_vkSetMoltenVKDeviceConfigurationMVK vgo_vkSetMoltenVKDeviceConfigurationMVK;
extern PFN_vkGetPhysicalDeviceMetalFeaturesMVK vgo_vkGetPhysicalDeviceMetalFeaturesMVK;
extern PFN_vkGetSwapchainPerformanceMVK vgo_vkGetSwapchainPerformanceMVK;
// vkGetInstanceProcAddr left there so the linker would link MoltenVK
extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
#endif
#ifdef VK_USE_PLATFORM_MACOS_MVK
// vkGetInstanceProcAddr left there so the linker would link MoltenVK
extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
// VK_KHR_win32_surface
extern PFN_vkCreateWin32SurfaceKHR vgo_vkCreateWin32SurfaceKHR;
extern PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vgo_vkGetPhysicalDeviceWin32PresentationSupportKHR;
#endif
// VK_EXT_debug_report
extern PFN_vkCreateDebugReportCallbackEXT vgo_vkCreateDebugReportCallbackEXT;
extern PFN_vkDestroyDebugReportCallbackEXT vgo_vkDestroyDebugReportCallbackEXT;
extern PFN_vkDebugReportMessageEXT vgo_vkDebugReportMessageEXT;
// VK_GOOGLE_display_timing
extern PFN_vkGetRefreshCycleDurationGOOGLE vgo_vkGetRefreshCycleDurationGOOGLE;
extern PFN_vkGetPastPresentationTimingGOOGLE vgo_vkGetPastPresentationTimingGOOGLE;
#endif // VULKAN_WRAPPER_H_