// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // This file is auto-generated from // gpu/vulkan/generate_bindings.py // It's formatted by clang-format using chromium coding style: // clang-format -i -style=chromium filename // DO NOT EDIT! #ifndef GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_ #define GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_ #include #include "base/compiler_specific.h" #include "base/native_library.h" #include "build/build_config.h" #include "gpu/vulkan/vulkan_export.h" #include "ui/gfx/extension_set.h" #if defined(OS_ANDROID) #include #endif #if defined(OS_FUCHSIA) #include // must be included after #include #include "gpu/vulkan/fuchsia/vulkan_fuchsia_ext.h" #endif #if defined(USE_VULKAN_XLIB) #include #include #endif #if defined(OS_WIN) #include #endif namespace gpu { struct VulkanFunctionPointers; VULKAN_EXPORT VulkanFunctionPointers* GetVulkanFunctionPointers(); struct VulkanFunctionPointers { VulkanFunctionPointers(); ~VulkanFunctionPointers(); VULKAN_EXPORT bool BindUnassociatedFunctionPointers(); // These functions assume that vkGetInstanceProcAddr has been populated. VULKAN_EXPORT bool BindInstanceFunctionPointers( VkInstance vk_instance, uint32_t api_version, const gfx::ExtensionSet& enabled_extensions); // These functions assume that vkGetDeviceProcAddr has been populated. VULKAN_EXPORT bool BindDeviceFunctionPointers( VkDevice vk_device, uint32_t api_version, const gfx::ExtensionSet& enabled_extensions); base::NativeLibrary vulkan_loader_library = nullptr; template class VulkanFunction; template class VulkanFunction { public: explicit operator bool() { return !!fn_; } NO_SANITIZE("cfi-icall") R operator()(Args... args) { return fn_(args...); } private: friend VulkanFunctionPointers; using Fn = R(VKAPI_PTR*)(Args...); Fn operator=(Fn fn) { fn_ = fn; return fn_; } Fn fn_ = nullptr; }; // Unassociated functions VulkanFunction vkEnumerateInstanceVersionFn; VulkanFunction vkGetInstanceProcAddrFn; VulkanFunction vkCreateInstanceFn; VulkanFunction vkEnumerateInstanceExtensionPropertiesFn; VulkanFunction vkEnumerateInstanceLayerPropertiesFn; // Instance functions VulkanFunction vkCreateDeviceFn; VulkanFunction vkDestroyInstanceFn; VulkanFunction vkEnumerateDeviceExtensionPropertiesFn; VulkanFunction vkEnumerateDeviceLayerPropertiesFn; VulkanFunction vkEnumeratePhysicalDevicesFn; VulkanFunction vkGetDeviceProcAddrFn; VulkanFunction vkGetPhysicalDeviceFeaturesFn; VulkanFunction vkGetPhysicalDeviceFormatPropertiesFn; VulkanFunction vkGetPhysicalDeviceMemoryPropertiesFn; VulkanFunction vkGetPhysicalDevicePropertiesFn; VulkanFunction vkGetPhysicalDeviceQueueFamilyPropertiesFn; #if DCHECK_IS_ON() VulkanFunction vkCreateDebugReportCallbackEXTFn; VulkanFunction vkDestroyDebugReportCallbackEXTFn; #endif // DCHECK_IS_ON() VulkanFunction vkDestroySurfaceKHRFn; VulkanFunction vkGetPhysicalDeviceSurfaceCapabilitiesKHRFn; VulkanFunction vkGetPhysicalDeviceSurfaceFormatsKHRFn; VulkanFunction vkGetPhysicalDeviceSurfaceSupportKHRFn; #if defined(USE_VULKAN_XLIB) VulkanFunction vkCreateXlibSurfaceKHRFn; VulkanFunction vkGetPhysicalDeviceXlibPresentationSupportKHRFn; #endif // defined(USE_VULKAN_XLIB) #if defined(OS_WIN) VulkanFunction vkCreateWin32SurfaceKHRFn; VulkanFunction vkGetPhysicalDeviceWin32PresentationSupportKHRFn; #endif // defined(OS_WIN) #if defined(OS_ANDROID) VulkanFunction vkCreateAndroidSurfaceKHRFn; #endif // defined(OS_ANDROID) #if defined(OS_FUCHSIA) VulkanFunction vkCreateImagePipeSurfaceFUCHSIAFn; #endif // defined(OS_FUCHSIA) VulkanFunction vkGetPhysicalDeviceImageFormatProperties2Fn; VulkanFunction vkGetPhysicalDeviceFeatures2Fn; // Device functions VulkanFunction vkAllocateCommandBuffersFn; VulkanFunction vkAllocateDescriptorSetsFn; VulkanFunction vkAllocateMemoryFn; VulkanFunction vkBeginCommandBufferFn; VulkanFunction vkBindBufferMemoryFn; VulkanFunction vkBindImageMemoryFn; VulkanFunction vkCmdBeginRenderPassFn; VulkanFunction vkCmdCopyBufferToImageFn; VulkanFunction vkCmdEndRenderPassFn; VulkanFunction vkCmdExecuteCommandsFn; VulkanFunction vkCmdNextSubpassFn; VulkanFunction vkCmdPipelineBarrierFn; VulkanFunction vkCreateBufferFn; VulkanFunction vkCreateCommandPoolFn; VulkanFunction vkCreateDescriptorPoolFn; VulkanFunction vkCreateDescriptorSetLayoutFn; VulkanFunction vkCreateFenceFn; VulkanFunction vkCreateFramebufferFn; VulkanFunction vkCreateImageFn; VulkanFunction vkCreateImageViewFn; VulkanFunction vkCreateRenderPassFn; VulkanFunction vkCreateSamplerFn; VulkanFunction vkCreateSemaphoreFn; VulkanFunction vkCreateShaderModuleFn; VulkanFunction vkDestroyBufferFn; VulkanFunction vkDestroyCommandPoolFn; VulkanFunction vkDestroyDescriptorPoolFn; VulkanFunction vkDestroyDescriptorSetLayoutFn; VulkanFunction vkDestroyDeviceFn; VulkanFunction vkDestroyFenceFn; VulkanFunction vkDestroyFramebufferFn; VulkanFunction vkDestroyImageFn; VulkanFunction vkDestroyImageViewFn; VulkanFunction vkDestroyRenderPassFn; VulkanFunction vkDestroySamplerFn; VulkanFunction vkDestroySemaphoreFn; VulkanFunction vkDestroyShaderModuleFn; VulkanFunction vkDeviceWaitIdleFn; VulkanFunction vkEndCommandBufferFn; VulkanFunction vkFreeCommandBuffersFn; VulkanFunction vkFreeDescriptorSetsFn; VulkanFunction vkFreeMemoryFn; VulkanFunction vkGetBufferMemoryRequirementsFn; VulkanFunction vkGetDeviceQueueFn; VulkanFunction vkGetFenceStatusFn; VulkanFunction vkGetImageMemoryRequirementsFn; VulkanFunction vkMapMemoryFn; VulkanFunction vkQueueSubmitFn; VulkanFunction vkQueueWaitIdleFn; VulkanFunction vkResetCommandBufferFn; VulkanFunction vkResetFencesFn; VulkanFunction vkUnmapMemoryFn; VulkanFunction vkUpdateDescriptorSetsFn; VulkanFunction vkWaitForFencesFn; VulkanFunction vkGetDeviceQueue2Fn; VulkanFunction vkGetImageMemoryRequirements2Fn; #if defined(OS_ANDROID) VulkanFunction vkGetAndroidHardwareBufferPropertiesANDROIDFn; #endif // defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) VulkanFunction vkGetSemaphoreFdKHRFn; VulkanFunction vkImportSemaphoreFdKHRFn; #endif // defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) VulkanFunction vkGetMemoryFdKHRFn; VulkanFunction vkGetMemoryFdPropertiesKHRFn; #endif // defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_FUCHSIA) VulkanFunction vkImportSemaphoreZirconHandleFUCHSIAFn; VulkanFunction vkGetSemaphoreZirconHandleFUCHSIAFn; #endif // defined(OS_FUCHSIA) #if defined(OS_FUCHSIA) VulkanFunction vkGetMemoryZirconHandleFUCHSIAFn; #endif // defined(OS_FUCHSIA) #if defined(OS_FUCHSIA) VulkanFunction vkCreateBufferCollectionFUCHSIAFn; VulkanFunction vkSetBufferCollectionConstraintsFUCHSIAFn; VulkanFunction vkGetBufferCollectionPropertiesFUCHSIAFn; VulkanFunction vkDestroyBufferCollectionFUCHSIAFn; #endif // defined(OS_FUCHSIA) VulkanFunction vkAcquireNextImageKHRFn; VulkanFunction vkCreateSwapchainKHRFn; VulkanFunction vkDestroySwapchainKHRFn; VulkanFunction vkGetSwapchainImagesKHRFn; VulkanFunction vkQueuePresentKHRFn; }; } // namespace gpu // Unassociated functions #define vkGetInstanceProcAddr \ gpu::GetVulkanFunctionPointers()->vkGetInstanceProcAddrFn #define vkEnumerateInstanceVersion \ gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceVersionFn #define vkCreateInstance gpu::GetVulkanFunctionPointers()->vkCreateInstanceFn #define vkEnumerateInstanceExtensionProperties \ gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceExtensionPropertiesFn #define vkEnumerateInstanceLayerProperties \ gpu::GetVulkanFunctionPointers()->vkEnumerateInstanceLayerPropertiesFn // Instance functions #define vkCreateDevice gpu::GetVulkanFunctionPointers()->vkCreateDeviceFn #define vkDestroyInstance gpu::GetVulkanFunctionPointers()->vkDestroyInstanceFn #define vkEnumerateDeviceExtensionProperties \ gpu::GetVulkanFunctionPointers()->vkEnumerateDeviceExtensionPropertiesFn #define vkEnumerateDeviceLayerProperties \ gpu::GetVulkanFunctionPointers()->vkEnumerateDeviceLayerPropertiesFn #define vkEnumeratePhysicalDevices \ gpu::GetVulkanFunctionPointers()->vkEnumeratePhysicalDevicesFn #define vkGetDeviceProcAddr \ gpu::GetVulkanFunctionPointers()->vkGetDeviceProcAddrFn #define vkGetPhysicalDeviceFeatures \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFeaturesFn #define vkGetPhysicalDeviceFormatProperties \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFormatPropertiesFn #define vkGetPhysicalDeviceMemoryProperties \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceMemoryPropertiesFn #define vkGetPhysicalDeviceProperties \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDevicePropertiesFn #define vkGetPhysicalDeviceQueueFamilyProperties \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceQueueFamilyPropertiesFn #if DCHECK_IS_ON() #define vkCreateDebugReportCallbackEXT \ gpu::GetVulkanFunctionPointers()->vkCreateDebugReportCallbackEXTFn #define vkDestroyDebugReportCallbackEXT \ gpu::GetVulkanFunctionPointers()->vkDestroyDebugReportCallbackEXTFn #endif // DCHECK_IS_ON() #define vkDestroySurfaceKHR \ gpu::GetVulkanFunctionPointers()->vkDestroySurfaceKHRFn #define vkGetPhysicalDeviceSurfaceCapabilitiesKHR \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceCapabilitiesKHRFn #define vkGetPhysicalDeviceSurfaceFormatsKHR \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceFormatsKHRFn #define vkGetPhysicalDeviceSurfaceSupportKHR \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceSurfaceSupportKHRFn #if defined(USE_VULKAN_XLIB) #define vkCreateXlibSurfaceKHR \ gpu::GetVulkanFunctionPointers()->vkCreateXlibSurfaceKHRFn #define vkGetPhysicalDeviceXlibPresentationSupportKHR \ gpu::GetVulkanFunctionPointers() \ ->vkGetPhysicalDeviceXlibPresentationSupportKHRFn #endif // defined(USE_VULKAN_XLIB) #if defined(OS_WIN) #define vkCreateWin32SurfaceKHR \ gpu::GetVulkanFunctionPointers()->vkCreateWin32SurfaceKHRFn #define vkGetPhysicalDeviceWin32PresentationSupportKHR \ gpu::GetVulkanFunctionPointers() \ ->vkGetPhysicalDeviceWin32PresentationSupportKHRFn #endif // defined(OS_WIN) #if defined(OS_ANDROID) #define vkCreateAndroidSurfaceKHR \ gpu::GetVulkanFunctionPointers()->vkCreateAndroidSurfaceKHRFn #endif // defined(OS_ANDROID) #if defined(OS_FUCHSIA) #define vkCreateImagePipeSurfaceFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkCreateImagePipeSurfaceFUCHSIAFn #endif // defined(OS_FUCHSIA) #define vkGetPhysicalDeviceImageFormatProperties2 \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceImageFormatProperties2Fn #define vkGetPhysicalDeviceFeatures2 \ gpu::GetVulkanFunctionPointers()->vkGetPhysicalDeviceFeatures2Fn // Device functions #define vkAllocateCommandBuffers \ gpu::GetVulkanFunctionPointers()->vkAllocateCommandBuffersFn #define vkAllocateDescriptorSets \ gpu::GetVulkanFunctionPointers()->vkAllocateDescriptorSetsFn #define vkAllocateMemory gpu::GetVulkanFunctionPointers()->vkAllocateMemoryFn #define vkBeginCommandBuffer \ gpu::GetVulkanFunctionPointers()->vkBeginCommandBufferFn #define vkBindBufferMemory \ gpu::GetVulkanFunctionPointers()->vkBindBufferMemoryFn #define vkBindImageMemory gpu::GetVulkanFunctionPointers()->vkBindImageMemoryFn #define vkCmdBeginRenderPass \ gpu::GetVulkanFunctionPointers()->vkCmdBeginRenderPassFn #define vkCmdCopyBufferToImage \ gpu::GetVulkanFunctionPointers()->vkCmdCopyBufferToImageFn #define vkCmdEndRenderPass \ gpu::GetVulkanFunctionPointers()->vkCmdEndRenderPassFn #define vkCmdExecuteCommands \ gpu::GetVulkanFunctionPointers()->vkCmdExecuteCommandsFn #define vkCmdNextSubpass gpu::GetVulkanFunctionPointers()->vkCmdNextSubpassFn #define vkCmdPipelineBarrier \ gpu::GetVulkanFunctionPointers()->vkCmdPipelineBarrierFn #define vkCreateBuffer gpu::GetVulkanFunctionPointers()->vkCreateBufferFn #define vkCreateCommandPool \ gpu::GetVulkanFunctionPointers()->vkCreateCommandPoolFn #define vkCreateDescriptorPool \ gpu::GetVulkanFunctionPointers()->vkCreateDescriptorPoolFn #define vkCreateDescriptorSetLayout \ gpu::GetVulkanFunctionPointers()->vkCreateDescriptorSetLayoutFn #define vkCreateFence gpu::GetVulkanFunctionPointers()->vkCreateFenceFn #define vkCreateFramebuffer \ gpu::GetVulkanFunctionPointers()->vkCreateFramebufferFn #define vkCreateImage gpu::GetVulkanFunctionPointers()->vkCreateImageFn #define vkCreateImageView gpu::GetVulkanFunctionPointers()->vkCreateImageViewFn #define vkCreateRenderPass \ gpu::GetVulkanFunctionPointers()->vkCreateRenderPassFn #define vkCreateSampler gpu::GetVulkanFunctionPointers()->vkCreateSamplerFn #define vkCreateSemaphore gpu::GetVulkanFunctionPointers()->vkCreateSemaphoreFn #define vkCreateShaderModule \ gpu::GetVulkanFunctionPointers()->vkCreateShaderModuleFn #define vkDestroyBuffer gpu::GetVulkanFunctionPointers()->vkDestroyBufferFn #define vkDestroyCommandPool \ gpu::GetVulkanFunctionPointers()->vkDestroyCommandPoolFn #define vkDestroyDescriptorPool \ gpu::GetVulkanFunctionPointers()->vkDestroyDescriptorPoolFn #define vkDestroyDescriptorSetLayout \ gpu::GetVulkanFunctionPointers()->vkDestroyDescriptorSetLayoutFn #define vkDestroyDevice gpu::GetVulkanFunctionPointers()->vkDestroyDeviceFn #define vkDestroyFence gpu::GetVulkanFunctionPointers()->vkDestroyFenceFn #define vkDestroyFramebuffer \ gpu::GetVulkanFunctionPointers()->vkDestroyFramebufferFn #define vkDestroyImage gpu::GetVulkanFunctionPointers()->vkDestroyImageFn #define vkDestroyImageView \ gpu::GetVulkanFunctionPointers()->vkDestroyImageViewFn #define vkDestroyRenderPass \ gpu::GetVulkanFunctionPointers()->vkDestroyRenderPassFn #define vkDestroySampler gpu::GetVulkanFunctionPointers()->vkDestroySamplerFn #define vkDestroySemaphore \ gpu::GetVulkanFunctionPointers()->vkDestroySemaphoreFn #define vkDestroyShaderModule \ gpu::GetVulkanFunctionPointers()->vkDestroyShaderModuleFn #define vkDeviceWaitIdle gpu::GetVulkanFunctionPointers()->vkDeviceWaitIdleFn #define vkEndCommandBuffer \ gpu::GetVulkanFunctionPointers()->vkEndCommandBufferFn #define vkFreeCommandBuffers \ gpu::GetVulkanFunctionPointers()->vkFreeCommandBuffersFn #define vkFreeDescriptorSets \ gpu::GetVulkanFunctionPointers()->vkFreeDescriptorSetsFn #define vkFreeMemory gpu::GetVulkanFunctionPointers()->vkFreeMemoryFn #define vkGetBufferMemoryRequirements \ gpu::GetVulkanFunctionPointers()->vkGetBufferMemoryRequirementsFn #define vkGetDeviceQueue gpu::GetVulkanFunctionPointers()->vkGetDeviceQueueFn #define vkGetFenceStatus gpu::GetVulkanFunctionPointers()->vkGetFenceStatusFn #define vkGetImageMemoryRequirements \ gpu::GetVulkanFunctionPointers()->vkGetImageMemoryRequirementsFn #define vkMapMemory gpu::GetVulkanFunctionPointers()->vkMapMemoryFn #define vkQueueSubmit gpu::GetVulkanFunctionPointers()->vkQueueSubmitFn #define vkQueueWaitIdle gpu::GetVulkanFunctionPointers()->vkQueueWaitIdleFn #define vkResetCommandBuffer \ gpu::GetVulkanFunctionPointers()->vkResetCommandBufferFn #define vkResetFences gpu::GetVulkanFunctionPointers()->vkResetFencesFn #define vkUnmapMemory gpu::GetVulkanFunctionPointers()->vkUnmapMemoryFn #define vkUpdateDescriptorSets \ gpu::GetVulkanFunctionPointers()->vkUpdateDescriptorSetsFn #define vkWaitForFences gpu::GetVulkanFunctionPointers()->vkWaitForFencesFn #define vkGetDeviceQueue2 gpu::GetVulkanFunctionPointers()->vkGetDeviceQueue2Fn #define vkGetImageMemoryRequirements2 \ gpu::GetVulkanFunctionPointers()->vkGetImageMemoryRequirements2Fn #if defined(OS_ANDROID) #define vkGetAndroidHardwareBufferPropertiesANDROID \ gpu::GetVulkanFunctionPointers() \ ->vkGetAndroidHardwareBufferPropertiesANDROIDFn #endif // defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) #define vkGetSemaphoreFdKHR \ gpu::GetVulkanFunctionPointers()->vkGetSemaphoreFdKHRFn #define vkImportSemaphoreFdKHR \ gpu::GetVulkanFunctionPointers()->vkImportSemaphoreFdKHRFn #endif // defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_LINUX) || defined(OS_ANDROID) #define vkGetMemoryFdKHR gpu::GetVulkanFunctionPointers()->vkGetMemoryFdKHRFn #define vkGetMemoryFdPropertiesKHR \ gpu::GetVulkanFunctionPointers()->vkGetMemoryFdPropertiesKHRFn #endif // defined(OS_LINUX) || defined(OS_ANDROID) #if defined(OS_FUCHSIA) #define vkImportSemaphoreZirconHandleFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkImportSemaphoreZirconHandleFUCHSIAFn #define vkGetSemaphoreZirconHandleFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkGetSemaphoreZirconHandleFUCHSIAFn #endif // defined(OS_FUCHSIA) #if defined(OS_FUCHSIA) #define vkGetMemoryZirconHandleFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkGetMemoryZirconHandleFUCHSIAFn #endif // defined(OS_FUCHSIA) #if defined(OS_FUCHSIA) #define vkCreateBufferCollectionFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkCreateBufferCollectionFUCHSIAFn #define vkSetBufferCollectionConstraintsFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkSetBufferCollectionConstraintsFUCHSIAFn #define vkGetBufferCollectionPropertiesFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkGetBufferCollectionPropertiesFUCHSIAFn #define vkDestroyBufferCollectionFUCHSIA \ gpu::GetVulkanFunctionPointers()->vkDestroyBufferCollectionFUCHSIAFn #endif // defined(OS_FUCHSIA) #define vkAcquireNextImageKHR \ gpu::GetVulkanFunctionPointers()->vkAcquireNextImageKHRFn #define vkCreateSwapchainKHR \ gpu::GetVulkanFunctionPointers()->vkCreateSwapchainKHRFn #define vkDestroySwapchainKHR \ gpu::GetVulkanFunctionPointers()->vkDestroySwapchainKHRFn #define vkGetSwapchainImagesKHR \ gpu::GetVulkanFunctionPointers()->vkGetSwapchainImagesKHRFn #define vkQueuePresentKHR gpu::GetVulkanFunctionPointers()->vkQueuePresentKHRFn #endif // GPU_VULKAN_VULKAN_FUNCTION_POINTERS_H_