1 /*
2 * Copyright 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 // This file is generated.
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 #include "vulkan_wrapper.h"
22 #include <dlfcn.h>
23
InitVulkan(void)24 int InitVulkan(void) {
25 void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
26 if (!libvulkan)
27 return 0;
28
29 // Vulkan supported, set function addresses
30 vkCreateInstance = reinterpret_cast<PFN_vkCreateInstance>(dlsym(libvulkan, "vkCreateInstance"));
31 vkDestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(dlsym(libvulkan, "vkDestroyInstance"));
32 vkEnumeratePhysicalDevices = reinterpret_cast<PFN_vkEnumeratePhysicalDevices>(dlsym(libvulkan, "vkEnumeratePhysicalDevices"));
33 vkGetPhysicalDeviceFeatures = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures>(dlsym(libvulkan, "vkGetPhysicalDeviceFeatures"));
34 vkGetPhysicalDeviceFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceFormatProperties"));
35 vkGetPhysicalDeviceImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceImageFormatProperties"));
36 vkGetPhysicalDeviceProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceProperties"));
37 vkGetPhysicalDeviceQueueFamilyProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceQueueFamilyProperties"));
38 vkGetPhysicalDeviceMemoryProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceMemoryProperties"));
39 vkGetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(dlsym(libvulkan, "vkGetInstanceProcAddr"));
40 vkGetDeviceProcAddr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(dlsym(libvulkan, "vkGetDeviceProcAddr"));
41 vkCreateDevice = reinterpret_cast<PFN_vkCreateDevice>(dlsym(libvulkan, "vkCreateDevice"));
42 vkDestroyDevice = reinterpret_cast<PFN_vkDestroyDevice>(dlsym(libvulkan, "vkDestroyDevice"));
43 vkEnumerateInstanceExtensionProperties = reinterpret_cast<PFN_vkEnumerateInstanceExtensionProperties>(dlsym(libvulkan, "vkEnumerateInstanceExtensionProperties"));
44 vkEnumerateDeviceExtensionProperties = reinterpret_cast<PFN_vkEnumerateDeviceExtensionProperties>(dlsym(libvulkan, "vkEnumerateDeviceExtensionProperties"));
45 vkEnumerateInstanceLayerProperties = reinterpret_cast<PFN_vkEnumerateInstanceLayerProperties>(dlsym(libvulkan, "vkEnumerateInstanceLayerProperties"));
46 vkEnumerateDeviceLayerProperties = reinterpret_cast<PFN_vkEnumerateDeviceLayerProperties>(dlsym(libvulkan, "vkEnumerateDeviceLayerProperties"));
47 vkGetDeviceQueue = reinterpret_cast<PFN_vkGetDeviceQueue>(dlsym(libvulkan, "vkGetDeviceQueue"));
48 vkQueueSubmit = reinterpret_cast<PFN_vkQueueSubmit>(dlsym(libvulkan, "vkQueueSubmit"));
49 vkQueueWaitIdle = reinterpret_cast<PFN_vkQueueWaitIdle>(dlsym(libvulkan, "vkQueueWaitIdle"));
50 vkDeviceWaitIdle = reinterpret_cast<PFN_vkDeviceWaitIdle>(dlsym(libvulkan, "vkDeviceWaitIdle"));
51 vkAllocateMemory = reinterpret_cast<PFN_vkAllocateMemory>(dlsym(libvulkan, "vkAllocateMemory"));
52 vkFreeMemory = reinterpret_cast<PFN_vkFreeMemory>(dlsym(libvulkan, "vkFreeMemory"));
53 vkMapMemory = reinterpret_cast<PFN_vkMapMemory>(dlsym(libvulkan, "vkMapMemory"));
54 vkUnmapMemory = reinterpret_cast<PFN_vkUnmapMemory>(dlsym(libvulkan, "vkUnmapMemory"));
55 vkFlushMappedMemoryRanges = reinterpret_cast<PFN_vkFlushMappedMemoryRanges>(dlsym(libvulkan, "vkFlushMappedMemoryRanges"));
56 vkInvalidateMappedMemoryRanges = reinterpret_cast<PFN_vkInvalidateMappedMemoryRanges>(dlsym(libvulkan, "vkInvalidateMappedMemoryRanges"));
57 vkGetDeviceMemoryCommitment = reinterpret_cast<PFN_vkGetDeviceMemoryCommitment>(dlsym(libvulkan, "vkGetDeviceMemoryCommitment"));
58 vkBindBufferMemory = reinterpret_cast<PFN_vkBindBufferMemory>(dlsym(libvulkan, "vkBindBufferMemory"));
59 vkBindImageMemory = reinterpret_cast<PFN_vkBindImageMemory>(dlsym(libvulkan, "vkBindImageMemory"));
60 vkGetBufferMemoryRequirements = reinterpret_cast<PFN_vkGetBufferMemoryRequirements>(dlsym(libvulkan, "vkGetBufferMemoryRequirements"));
61 vkGetImageMemoryRequirements = reinterpret_cast<PFN_vkGetImageMemoryRequirements>(dlsym(libvulkan, "vkGetImageMemoryRequirements"));
62 vkGetImageSparseMemoryRequirements = reinterpret_cast<PFN_vkGetImageSparseMemoryRequirements>(dlsym(libvulkan, "vkGetImageSparseMemoryRequirements"));
63 vkGetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(dlsym(libvulkan, "vkGetPhysicalDeviceSparseImageFormatProperties"));
64 vkQueueBindSparse = reinterpret_cast<PFN_vkQueueBindSparse>(dlsym(libvulkan, "vkQueueBindSparse"));
65 vkCreateFence = reinterpret_cast<PFN_vkCreateFence>(dlsym(libvulkan, "vkCreateFence"));
66 vkDestroyFence = reinterpret_cast<PFN_vkDestroyFence>(dlsym(libvulkan, "vkDestroyFence"));
67 vkResetFences = reinterpret_cast<PFN_vkResetFences>(dlsym(libvulkan, "vkResetFences"));
68 vkGetFenceStatus = reinterpret_cast<PFN_vkGetFenceStatus>(dlsym(libvulkan, "vkGetFenceStatus"));
69 vkWaitForFences = reinterpret_cast<PFN_vkWaitForFences>(dlsym(libvulkan, "vkWaitForFences"));
70 vkCreateSemaphore = reinterpret_cast<PFN_vkCreateSemaphore>(dlsym(libvulkan, "vkCreateSemaphore"));
71 vkDestroySemaphore = reinterpret_cast<PFN_vkDestroySemaphore>(dlsym(libvulkan, "vkDestroySemaphore"));
72 vkCreateEvent = reinterpret_cast<PFN_vkCreateEvent>(dlsym(libvulkan, "vkCreateEvent"));
73 vkDestroyEvent = reinterpret_cast<PFN_vkDestroyEvent>(dlsym(libvulkan, "vkDestroyEvent"));
74 vkGetEventStatus = reinterpret_cast<PFN_vkGetEventStatus>(dlsym(libvulkan, "vkGetEventStatus"));
75 vkSetEvent = reinterpret_cast<PFN_vkSetEvent>(dlsym(libvulkan, "vkSetEvent"));
76 vkResetEvent = reinterpret_cast<PFN_vkResetEvent>(dlsym(libvulkan, "vkResetEvent"));
77 vkCreateQueryPool = reinterpret_cast<PFN_vkCreateQueryPool>(dlsym(libvulkan, "vkCreateQueryPool"));
78 vkDestroyQueryPool = reinterpret_cast<PFN_vkDestroyQueryPool>(dlsym(libvulkan, "vkDestroyQueryPool"));
79 vkGetQueryPoolResults = reinterpret_cast<PFN_vkGetQueryPoolResults>(dlsym(libvulkan, "vkGetQueryPoolResults"));
80 vkCreateBuffer = reinterpret_cast<PFN_vkCreateBuffer>(dlsym(libvulkan, "vkCreateBuffer"));
81 vkDestroyBuffer = reinterpret_cast<PFN_vkDestroyBuffer>(dlsym(libvulkan, "vkDestroyBuffer"));
82 vkCreateBufferView = reinterpret_cast<PFN_vkCreateBufferView>(dlsym(libvulkan, "vkCreateBufferView"));
83 vkDestroyBufferView = reinterpret_cast<PFN_vkDestroyBufferView>(dlsym(libvulkan, "vkDestroyBufferView"));
84 vkCreateImage = reinterpret_cast<PFN_vkCreateImage>(dlsym(libvulkan, "vkCreateImage"));
85 vkDestroyImage = reinterpret_cast<PFN_vkDestroyImage>(dlsym(libvulkan, "vkDestroyImage"));
86 vkGetImageSubresourceLayout = reinterpret_cast<PFN_vkGetImageSubresourceLayout>(dlsym(libvulkan, "vkGetImageSubresourceLayout"));
87 vkCreateImageView = reinterpret_cast<PFN_vkCreateImageView>(dlsym(libvulkan, "vkCreateImageView"));
88 vkDestroyImageView = reinterpret_cast<PFN_vkDestroyImageView>(dlsym(libvulkan, "vkDestroyImageView"));
89 vkCreateShaderModule = reinterpret_cast<PFN_vkCreateShaderModule>(dlsym(libvulkan, "vkCreateShaderModule"));
90 vkDestroyShaderModule = reinterpret_cast<PFN_vkDestroyShaderModule>(dlsym(libvulkan, "vkDestroyShaderModule"));
91 vkCreatePipelineCache = reinterpret_cast<PFN_vkCreatePipelineCache>(dlsym(libvulkan, "vkCreatePipelineCache"));
92 vkDestroyPipelineCache = reinterpret_cast<PFN_vkDestroyPipelineCache>(dlsym(libvulkan, "vkDestroyPipelineCache"));
93 vkGetPipelineCacheData = reinterpret_cast<PFN_vkGetPipelineCacheData>(dlsym(libvulkan, "vkGetPipelineCacheData"));
94 vkMergePipelineCaches = reinterpret_cast<PFN_vkMergePipelineCaches>(dlsym(libvulkan, "vkMergePipelineCaches"));
95 vkCreateGraphicsPipelines = reinterpret_cast<PFN_vkCreateGraphicsPipelines>(dlsym(libvulkan, "vkCreateGraphicsPipelines"));
96 vkCreateComputePipelines = reinterpret_cast<PFN_vkCreateComputePipelines>(dlsym(libvulkan, "vkCreateComputePipelines"));
97 vkDestroyPipeline = reinterpret_cast<PFN_vkDestroyPipeline>(dlsym(libvulkan, "vkDestroyPipeline"));
98 vkCreatePipelineLayout = reinterpret_cast<PFN_vkCreatePipelineLayout>(dlsym(libvulkan, "vkCreatePipelineLayout"));
99 vkDestroyPipelineLayout = reinterpret_cast<PFN_vkDestroyPipelineLayout>(dlsym(libvulkan, "vkDestroyPipelineLayout"));
100 vkCreateSampler = reinterpret_cast<PFN_vkCreateSampler>(dlsym(libvulkan, "vkCreateSampler"));
101 vkDestroySampler = reinterpret_cast<PFN_vkDestroySampler>(dlsym(libvulkan, "vkDestroySampler"));
102 vkCreateDescriptorSetLayout = reinterpret_cast<PFN_vkCreateDescriptorSetLayout>(dlsym(libvulkan, "vkCreateDescriptorSetLayout"));
103 vkDestroyDescriptorSetLayout = reinterpret_cast<PFN_vkDestroyDescriptorSetLayout>(dlsym(libvulkan, "vkDestroyDescriptorSetLayout"));
104 vkCreateDescriptorPool = reinterpret_cast<PFN_vkCreateDescriptorPool>(dlsym(libvulkan, "vkCreateDescriptorPool"));
105 vkDestroyDescriptorPool = reinterpret_cast<PFN_vkDestroyDescriptorPool>(dlsym(libvulkan, "vkDestroyDescriptorPool"));
106 vkResetDescriptorPool = reinterpret_cast<PFN_vkResetDescriptorPool>(dlsym(libvulkan, "vkResetDescriptorPool"));
107 vkAllocateDescriptorSets = reinterpret_cast<PFN_vkAllocateDescriptorSets>(dlsym(libvulkan, "vkAllocateDescriptorSets"));
108 vkFreeDescriptorSets = reinterpret_cast<PFN_vkFreeDescriptorSets>(dlsym(libvulkan, "vkFreeDescriptorSets"));
109 vkUpdateDescriptorSets = reinterpret_cast<PFN_vkUpdateDescriptorSets>(dlsym(libvulkan, "vkUpdateDescriptorSets"));
110 vkCreateFramebuffer = reinterpret_cast<PFN_vkCreateFramebuffer>(dlsym(libvulkan, "vkCreateFramebuffer"));
111 vkDestroyFramebuffer = reinterpret_cast<PFN_vkDestroyFramebuffer>(dlsym(libvulkan, "vkDestroyFramebuffer"));
112 vkCreateRenderPass = reinterpret_cast<PFN_vkCreateRenderPass>(dlsym(libvulkan, "vkCreateRenderPass"));
113 vkDestroyRenderPass = reinterpret_cast<PFN_vkDestroyRenderPass>(dlsym(libvulkan, "vkDestroyRenderPass"));
114 vkGetRenderAreaGranularity = reinterpret_cast<PFN_vkGetRenderAreaGranularity>(dlsym(libvulkan, "vkGetRenderAreaGranularity"));
115 vkCreateCommandPool = reinterpret_cast<PFN_vkCreateCommandPool>(dlsym(libvulkan, "vkCreateCommandPool"));
116 vkDestroyCommandPool = reinterpret_cast<PFN_vkDestroyCommandPool>(dlsym(libvulkan, "vkDestroyCommandPool"));
117 vkResetCommandPool = reinterpret_cast<PFN_vkResetCommandPool>(dlsym(libvulkan, "vkResetCommandPool"));
118 vkAllocateCommandBuffers = reinterpret_cast<PFN_vkAllocateCommandBuffers>(dlsym(libvulkan, "vkAllocateCommandBuffers"));
119 vkFreeCommandBuffers = reinterpret_cast<PFN_vkFreeCommandBuffers>(dlsym(libvulkan, "vkFreeCommandBuffers"));
120 vkBeginCommandBuffer = reinterpret_cast<PFN_vkBeginCommandBuffer>(dlsym(libvulkan, "vkBeginCommandBuffer"));
121 vkEndCommandBuffer = reinterpret_cast<PFN_vkEndCommandBuffer>(dlsym(libvulkan, "vkEndCommandBuffer"));
122 vkResetCommandBuffer = reinterpret_cast<PFN_vkResetCommandBuffer>(dlsym(libvulkan, "vkResetCommandBuffer"));
123 vkCmdBindPipeline = reinterpret_cast<PFN_vkCmdBindPipeline>(dlsym(libvulkan, "vkCmdBindPipeline"));
124 vkCmdSetViewport = reinterpret_cast<PFN_vkCmdSetViewport>(dlsym(libvulkan, "vkCmdSetViewport"));
125 vkCmdSetScissor = reinterpret_cast<PFN_vkCmdSetScissor>(dlsym(libvulkan, "vkCmdSetScissor"));
126 vkCmdSetLineWidth = reinterpret_cast<PFN_vkCmdSetLineWidth>(dlsym(libvulkan, "vkCmdSetLineWidth"));
127 vkCmdSetDepthBias = reinterpret_cast<PFN_vkCmdSetDepthBias>(dlsym(libvulkan, "vkCmdSetDepthBias"));
128 vkCmdSetBlendConstants = reinterpret_cast<PFN_vkCmdSetBlendConstants>(dlsym(libvulkan, "vkCmdSetBlendConstants"));
129 vkCmdSetDepthBounds = reinterpret_cast<PFN_vkCmdSetDepthBounds>(dlsym(libvulkan, "vkCmdSetDepthBounds"));
130 vkCmdSetStencilCompareMask = reinterpret_cast<PFN_vkCmdSetStencilCompareMask>(dlsym(libvulkan, "vkCmdSetStencilCompareMask"));
131 vkCmdSetStencilWriteMask = reinterpret_cast<PFN_vkCmdSetStencilWriteMask>(dlsym(libvulkan, "vkCmdSetStencilWriteMask"));
132 vkCmdSetStencilReference = reinterpret_cast<PFN_vkCmdSetStencilReference>(dlsym(libvulkan, "vkCmdSetStencilReference"));
133 vkCmdBindDescriptorSets = reinterpret_cast<PFN_vkCmdBindDescriptorSets>(dlsym(libvulkan, "vkCmdBindDescriptorSets"));
134 vkCmdBindIndexBuffer = reinterpret_cast<PFN_vkCmdBindIndexBuffer>(dlsym(libvulkan, "vkCmdBindIndexBuffer"));
135 vkCmdBindVertexBuffers = reinterpret_cast<PFN_vkCmdBindVertexBuffers>(dlsym(libvulkan, "vkCmdBindVertexBuffers"));
136 vkCmdDraw = reinterpret_cast<PFN_vkCmdDraw>(dlsym(libvulkan, "vkCmdDraw"));
137 vkCmdDrawIndexed = reinterpret_cast<PFN_vkCmdDrawIndexed>(dlsym(libvulkan, "vkCmdDrawIndexed"));
138 vkCmdDrawIndirect = reinterpret_cast<PFN_vkCmdDrawIndirect>(dlsym(libvulkan, "vkCmdDrawIndirect"));
139 vkCmdDrawIndexedIndirect = reinterpret_cast<PFN_vkCmdDrawIndexedIndirect>(dlsym(libvulkan, "vkCmdDrawIndexedIndirect"));
140 vkCmdDispatch = reinterpret_cast<PFN_vkCmdDispatch>(dlsym(libvulkan, "vkCmdDispatch"));
141 vkCmdDispatchIndirect = reinterpret_cast<PFN_vkCmdDispatchIndirect>(dlsym(libvulkan, "vkCmdDispatchIndirect"));
142 vkCmdCopyBuffer = reinterpret_cast<PFN_vkCmdCopyBuffer>(dlsym(libvulkan, "vkCmdCopyBuffer"));
143 vkCmdCopyImage = reinterpret_cast<PFN_vkCmdCopyImage>(dlsym(libvulkan, "vkCmdCopyImage"));
144 vkCmdBlitImage = reinterpret_cast<PFN_vkCmdBlitImage>(dlsym(libvulkan, "vkCmdBlitImage"));
145 vkCmdCopyBufferToImage = reinterpret_cast<PFN_vkCmdCopyBufferToImage>(dlsym(libvulkan, "vkCmdCopyBufferToImage"));
146 vkCmdCopyImageToBuffer = reinterpret_cast<PFN_vkCmdCopyImageToBuffer>(dlsym(libvulkan, "vkCmdCopyImageToBuffer"));
147 vkCmdUpdateBuffer = reinterpret_cast<PFN_vkCmdUpdateBuffer>(dlsym(libvulkan, "vkCmdUpdateBuffer"));
148 vkCmdFillBuffer = reinterpret_cast<PFN_vkCmdFillBuffer>(dlsym(libvulkan, "vkCmdFillBuffer"));
149 vkCmdClearColorImage = reinterpret_cast<PFN_vkCmdClearColorImage>(dlsym(libvulkan, "vkCmdClearColorImage"));
150 vkCmdClearDepthStencilImage = reinterpret_cast<PFN_vkCmdClearDepthStencilImage>(dlsym(libvulkan, "vkCmdClearDepthStencilImage"));
151 vkCmdClearAttachments = reinterpret_cast<PFN_vkCmdClearAttachments>(dlsym(libvulkan, "vkCmdClearAttachments"));
152 vkCmdResolveImage = reinterpret_cast<PFN_vkCmdResolveImage>(dlsym(libvulkan, "vkCmdResolveImage"));
153 vkCmdSetEvent = reinterpret_cast<PFN_vkCmdSetEvent>(dlsym(libvulkan, "vkCmdSetEvent"));
154 vkCmdResetEvent = reinterpret_cast<PFN_vkCmdResetEvent>(dlsym(libvulkan, "vkCmdResetEvent"));
155 vkCmdWaitEvents = reinterpret_cast<PFN_vkCmdWaitEvents>(dlsym(libvulkan, "vkCmdWaitEvents"));
156 vkCmdPipelineBarrier = reinterpret_cast<PFN_vkCmdPipelineBarrier>(dlsym(libvulkan, "vkCmdPipelineBarrier"));
157 vkCmdBeginQuery = reinterpret_cast<PFN_vkCmdBeginQuery>(dlsym(libvulkan, "vkCmdBeginQuery"));
158 vkCmdEndQuery = reinterpret_cast<PFN_vkCmdEndQuery>(dlsym(libvulkan, "vkCmdEndQuery"));
159 vkCmdResetQueryPool = reinterpret_cast<PFN_vkCmdResetQueryPool>(dlsym(libvulkan, "vkCmdResetQueryPool"));
160 vkCmdWriteTimestamp = reinterpret_cast<PFN_vkCmdWriteTimestamp>(dlsym(libvulkan, "vkCmdWriteTimestamp"));
161 vkCmdCopyQueryPoolResults = reinterpret_cast<PFN_vkCmdCopyQueryPoolResults>(dlsym(libvulkan, "vkCmdCopyQueryPoolResults"));
162 vkCmdPushConstants = reinterpret_cast<PFN_vkCmdPushConstants>(dlsym(libvulkan, "vkCmdPushConstants"));
163 vkCmdBeginRenderPass = reinterpret_cast<PFN_vkCmdBeginRenderPass>(dlsym(libvulkan, "vkCmdBeginRenderPass"));
164 vkCmdNextSubpass = reinterpret_cast<PFN_vkCmdNextSubpass>(dlsym(libvulkan, "vkCmdNextSubpass"));
165 vkCmdEndRenderPass = reinterpret_cast<PFN_vkCmdEndRenderPass>(dlsym(libvulkan, "vkCmdEndRenderPass"));
166 vkCmdExecuteCommands = reinterpret_cast<PFN_vkCmdExecuteCommands>(dlsym(libvulkan, "vkCmdExecuteCommands"));
167 vkDestroySurfaceKHR = reinterpret_cast<PFN_vkDestroySurfaceKHR>(dlsym(libvulkan, "vkDestroySurfaceKHR"));
168 vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceSurfaceSupportKHR"));
169 vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"));
170 vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceSurfaceFormatsKHR"));
171 vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceSurfacePresentModesKHR"));
172 vkCreateSwapchainKHR = reinterpret_cast<PFN_vkCreateSwapchainKHR>(dlsym(libvulkan, "vkCreateSwapchainKHR"));
173 vkDestroySwapchainKHR = reinterpret_cast<PFN_vkDestroySwapchainKHR>(dlsym(libvulkan, "vkDestroySwapchainKHR"));
174 vkGetSwapchainImagesKHR = reinterpret_cast<PFN_vkGetSwapchainImagesKHR>(dlsym(libvulkan, "vkGetSwapchainImagesKHR"));
175 vkAcquireNextImageKHR = reinterpret_cast<PFN_vkAcquireNextImageKHR>(dlsym(libvulkan, "vkAcquireNextImageKHR"));
176 vkQueuePresentKHR = reinterpret_cast<PFN_vkQueuePresentKHR>(dlsym(libvulkan, "vkQueuePresentKHR"));
177 vkGetPhysicalDeviceDisplayPropertiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceDisplayPropertiesKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceDisplayPropertiesKHR"));
178 vkGetPhysicalDeviceDisplayPlanePropertiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR"));
179 vkGetDisplayPlaneSupportedDisplaysKHR = reinterpret_cast<PFN_vkGetDisplayPlaneSupportedDisplaysKHR>(dlsym(libvulkan, "vkGetDisplayPlaneSupportedDisplaysKHR"));
180 vkGetDisplayModePropertiesKHR = reinterpret_cast<PFN_vkGetDisplayModePropertiesKHR>(dlsym(libvulkan, "vkGetDisplayModePropertiesKHR"));
181 vkCreateDisplayModeKHR = reinterpret_cast<PFN_vkCreateDisplayModeKHR>(dlsym(libvulkan, "vkCreateDisplayModeKHR"));
182 vkGetDisplayPlaneCapabilitiesKHR = reinterpret_cast<PFN_vkGetDisplayPlaneCapabilitiesKHR>(dlsym(libvulkan, "vkGetDisplayPlaneCapabilitiesKHR"));
183 vkCreateDisplayPlaneSurfaceKHR = reinterpret_cast<PFN_vkCreateDisplayPlaneSurfaceKHR>(dlsym(libvulkan, "vkCreateDisplayPlaneSurfaceKHR"));
184 vkCreateSharedSwapchainsKHR = reinterpret_cast<PFN_vkCreateSharedSwapchainsKHR>(dlsym(libvulkan, "vkCreateSharedSwapchainsKHR"));
185
186 #ifdef VK_USE_PLATFORM_XLIB_KHR
187 vkCreateXlibSurfaceKHR = reinterpret_cast<PFN_vkCreateXlibSurfaceKHR>(dlsym(libvulkan, "vkCreateXlibSurfaceKHR"));
188 vkGetPhysicalDeviceXlibPresentationSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceXlibPresentationSupportKHR"));
189 #endif
190
191 #ifdef VK_USE_PLATFORM_XCB_KHR
192 vkCreateXcbSurfaceKHR = reinterpret_cast<PFN_vkCreateXcbSurfaceKHR>(dlsym(libvulkan, "vkCreateXcbSurfaceKHR"));
193 vkGetPhysicalDeviceXcbPresentationSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceXcbPresentationSupportKHR"));
194 #endif
195
196 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
197 vkCreateWaylandSurfaceKHR = reinterpret_cast<PFN_vkCreateWaylandSurfaceKHR>(dlsym(libvulkan, "vkCreateWaylandSurfaceKHR"));
198 vkGetPhysicalDeviceWaylandPresentationSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceWaylandPresentationSupportKHR"));
199 #endif
200
201 #ifdef VK_USE_PLATFORM_MIR_KHR
202 vkCreateMirSurfaceKHR = reinterpret_cast<PFN_vkCreateMirSurfaceKHR>(dlsym(libvulkan, "vkCreateMirSurfaceKHR"));
203 vkGetPhysicalDeviceMirPresentationSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceMirPresentationSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceMirPresentationSupportKHR"));
204 #endif
205
206 #ifdef VK_USE_PLATFORM_ANDROID_KHR
207 vkCreateAndroidSurfaceKHR = reinterpret_cast<PFN_vkCreateAndroidSurfaceKHR>(dlsym(libvulkan, "vkCreateAndroidSurfaceKHR"));
208 #endif
209
210 #ifdef VK_USE_PLATFORM_WIN32_KHR
211 vkCreateWin32SurfaceKHR = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>(dlsym(libvulkan, "vkCreateWin32SurfaceKHR"));
212 vkGetPhysicalDeviceWin32PresentationSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR>(dlsym(libvulkan, "vkGetPhysicalDeviceWin32PresentationSupportKHR"));
213 #endif
214 return 1;
215 }
216
217 // No Vulkan support, do not set function addresses
218 PFN_vkCreateInstance vkCreateInstance;
219 PFN_vkDestroyInstance vkDestroyInstance;
220 PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
221 PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures;
222 PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
223 PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties;
224 PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
225 PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
226 PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
227 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
228 PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
229 PFN_vkCreateDevice vkCreateDevice;
230 PFN_vkDestroyDevice vkDestroyDevice;
231 PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
232 PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
233 PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties;
234 PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
235 PFN_vkGetDeviceQueue vkGetDeviceQueue;
236 PFN_vkQueueSubmit vkQueueSubmit;
237 PFN_vkQueueWaitIdle vkQueueWaitIdle;
238 PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
239 PFN_vkAllocateMemory vkAllocateMemory;
240 PFN_vkFreeMemory vkFreeMemory;
241 PFN_vkMapMemory vkMapMemory;
242 PFN_vkUnmapMemory vkUnmapMemory;
243 PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
244 PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
245 PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment;
246 PFN_vkBindBufferMemory vkBindBufferMemory;
247 PFN_vkBindImageMemory vkBindImageMemory;
248 PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
249 PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
250 PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements;
251 PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties;
252 PFN_vkQueueBindSparse vkQueueBindSparse;
253 PFN_vkCreateFence vkCreateFence;
254 PFN_vkDestroyFence vkDestroyFence;
255 PFN_vkResetFences vkResetFences;
256 PFN_vkGetFenceStatus vkGetFenceStatus;
257 PFN_vkWaitForFences vkWaitForFences;
258 PFN_vkCreateSemaphore vkCreateSemaphore;
259 PFN_vkDestroySemaphore vkDestroySemaphore;
260 PFN_vkCreateEvent vkCreateEvent;
261 PFN_vkDestroyEvent vkDestroyEvent;
262 PFN_vkGetEventStatus vkGetEventStatus;
263 PFN_vkSetEvent vkSetEvent;
264 PFN_vkResetEvent vkResetEvent;
265 PFN_vkCreateQueryPool vkCreateQueryPool;
266 PFN_vkDestroyQueryPool vkDestroyQueryPool;
267 PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
268 PFN_vkCreateBuffer vkCreateBuffer;
269 PFN_vkDestroyBuffer vkDestroyBuffer;
270 PFN_vkCreateBufferView vkCreateBufferView;
271 PFN_vkDestroyBufferView vkDestroyBufferView;
272 PFN_vkCreateImage vkCreateImage;
273 PFN_vkDestroyImage vkDestroyImage;
274 PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
275 PFN_vkCreateImageView vkCreateImageView;
276 PFN_vkDestroyImageView vkDestroyImageView;
277 PFN_vkCreateShaderModule vkCreateShaderModule;
278 PFN_vkDestroyShaderModule vkDestroyShaderModule;
279 PFN_vkCreatePipelineCache vkCreatePipelineCache;
280 PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
281 PFN_vkGetPipelineCacheData vkGetPipelineCacheData;
282 PFN_vkMergePipelineCaches vkMergePipelineCaches;
283 PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
284 PFN_vkCreateComputePipelines vkCreateComputePipelines;
285 PFN_vkDestroyPipeline vkDestroyPipeline;
286 PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
287 PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
288 PFN_vkCreateSampler vkCreateSampler;
289 PFN_vkDestroySampler vkDestroySampler;
290 PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
291 PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
292 PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
293 PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
294 PFN_vkResetDescriptorPool vkResetDescriptorPool;
295 PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
296 PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
297 PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
298 PFN_vkCreateFramebuffer vkCreateFramebuffer;
299 PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
300 PFN_vkCreateRenderPass vkCreateRenderPass;
301 PFN_vkDestroyRenderPass vkDestroyRenderPass;
302 PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity;
303 PFN_vkCreateCommandPool vkCreateCommandPool;
304 PFN_vkDestroyCommandPool vkDestroyCommandPool;
305 PFN_vkResetCommandPool vkResetCommandPool;
306 PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
307 PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
308 PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
309 PFN_vkEndCommandBuffer vkEndCommandBuffer;
310 PFN_vkResetCommandBuffer vkResetCommandBuffer;
311 PFN_vkCmdBindPipeline vkCmdBindPipeline;
312 PFN_vkCmdSetViewport vkCmdSetViewport;
313 PFN_vkCmdSetScissor vkCmdSetScissor;
314 PFN_vkCmdSetLineWidth vkCmdSetLineWidth;
315 PFN_vkCmdSetDepthBias vkCmdSetDepthBias;
316 PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants;
317 PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds;
318 PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask;
319 PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask;
320 PFN_vkCmdSetStencilReference vkCmdSetStencilReference;
321 PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
322 PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
323 PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
324 PFN_vkCmdDraw vkCmdDraw;
325 PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
326 PFN_vkCmdDrawIndirect vkCmdDrawIndirect;
327 PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect;
328 PFN_vkCmdDispatch vkCmdDispatch;
329 PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect;
330 PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
331 PFN_vkCmdCopyImage vkCmdCopyImage;
332 PFN_vkCmdBlitImage vkCmdBlitImage;
333 PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
334 PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer;
335 PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer;
336 PFN_vkCmdFillBuffer vkCmdFillBuffer;
337 PFN_vkCmdClearColorImage vkCmdClearColorImage;
338 PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage;
339 PFN_vkCmdClearAttachments vkCmdClearAttachments;
340 PFN_vkCmdResolveImage vkCmdResolveImage;
341 PFN_vkCmdSetEvent vkCmdSetEvent;
342 PFN_vkCmdResetEvent vkCmdResetEvent;
343 PFN_vkCmdWaitEvents vkCmdWaitEvents;
344 PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
345 PFN_vkCmdBeginQuery vkCmdBeginQuery;
346 PFN_vkCmdEndQuery vkCmdEndQuery;
347 PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
348 PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp;
349 PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
350 PFN_vkCmdPushConstants vkCmdPushConstants;
351 PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
352 PFN_vkCmdNextSubpass vkCmdNextSubpass;
353 PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
354 PFN_vkCmdExecuteCommands vkCmdExecuteCommands;
355 PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
356 PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
357 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
358 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
359 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
360 PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
361 PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
362 PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
363 PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
364 PFN_vkQueuePresentKHR vkQueuePresentKHR;
365 PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR;
366 PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
367 PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR;
368 PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR;
369 PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR;
370 PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR;
371 PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR;
372 PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR;
373
374 #ifdef VK_USE_PLATFORM_XLIB_KHR
375 PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR;
376 PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR;
377 #endif
378
379 #ifdef VK_USE_PLATFORM_XCB_KHR
380 PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR;
381 PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR;
382 #endif
383
384 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
385 PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR;
386 PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR;
387 #endif
388
389 #ifdef VK_USE_PLATFORM_MIR_KHR
390 PFN_vkCreateMirSurfaceKHR vkCreateMirSurfaceKHR;
391 PFN_vkGetPhysicalDeviceMirPresentationSupportKHR vkGetPhysicalDeviceMirPresentationSupportKHR;
392 #endif
393
394 #ifdef VK_USE_PLATFORM_ANDROID_KHR
395 PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
396 #endif
397
398 #ifdef VK_USE_PLATFORM_WIN32_KHR
399 PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR;
400 PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR;
401 #endif
402 PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
403 PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT;
404 PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT;
405
406 #ifdef __cplusplus
407 }
408 #endif
409