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