Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 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 | |
| 17 | // WARNING: This file is generated. See ../README.md for instructions. |
| 18 | |
| 19 | #ifndef LIBVULKAN_DRIVER_GEN_H |
| 20 | #define LIBVULKAN_DRIVER_GEN_H |
| 21 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 22 | #include <vulkan/vk_android_native_buffer.h> |
Chris Forbes | e2d3ee1 | 2017-03-16 16:10:15 +1300 | [diff] [blame] | 23 | #include <vulkan/vulkan.h> |
Yiwei Zhang | 6d78a57 | 2019-04-10 15:35:38 -0700 | [diff] [blame] | 24 | |
Chris Forbes | e2d3ee1 | 2017-03-16 16:10:15 +1300 | [diff] [blame] | 25 | #include <bitset> |
Yiwei Zhang | 7c0c07c | 2020-07-04 23:49:47 -0700 | [diff] [blame] | 26 | #include <optional> |
| 27 | #include <vector> |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 28 | |
Tom Murphy | ea32184 | 2024-06-14 18:26:58 +0000 | [diff] [blame] | 29 | /* |
| 30 | * This file is autogenerated by driver_generator.py. Do not edit directly. |
| 31 | */ |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 32 | namespace vulkan { |
| 33 | namespace driver { |
| 34 | |
| 35 | struct ProcHook { |
| 36 | enum Type { |
| 37 | GLOBAL, |
| 38 | INSTANCE, |
| 39 | DEVICE, |
| 40 | }; |
| 41 | enum Extension { |
| 42 | ANDROID_native_buffer, |
| 43 | EXT_debug_report, |
Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 44 | EXT_hdr_metadata, |
Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 45 | EXT_swapchain_colorspace, |
Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 46 | GOOGLE_display_timing, |
Ian Elliott | 1ce053f | 2022-03-16 09:49:53 -0600 | [diff] [blame] | 47 | GOOGLE_surfaceless_query, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 48 | KHR_android_surface, |
Yiwei Zhang | dc792f5 | 2019-10-10 16:29:42 -0700 | [diff] [blame] | 49 | KHR_get_surface_capabilities2, |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 50 | KHR_incremental_present, |
Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 51 | KHR_shared_presentable_image, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 52 | KHR_surface, |
Ian Elliott | bb67b24 | 2022-03-16 09:52:28 -0600 | [diff] [blame] | 53 | KHR_surface_protected_capabilities, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 54 | KHR_swapchain, |
Chris Forbes | 9d0d9ff | 2022-12-28 01:58:31 +0000 | [diff] [blame] | 55 | EXT_swapchain_maintenance1, |
| 56 | EXT_surface_maintenance1, |
Jesse Hall | a8d367a | 2018-01-18 15:40:46 -0800 | [diff] [blame] | 57 | ANDROID_external_memory_android_hardware_buffer, |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 58 | KHR_bind_memory2, |
Yiwei Zhang | dc792f5 | 2019-10-10 16:29:42 -0700 | [diff] [blame] | 59 | KHR_get_physical_device_properties2, |
Yiwei Zhang | e4f6417 | 2020-07-05 15:17:32 -0700 | [diff] [blame] | 60 | KHR_device_group_creation, |
Yiwei Zhang | e1f3501 | 2020-07-05 22:52:04 -0700 | [diff] [blame] | 61 | KHR_external_memory_capabilities, |
| 62 | KHR_external_semaphore_capabilities, |
| 63 | KHR_external_fence_capabilities, |
Chris Forbes | 9d0d9ff | 2022-12-28 01:58:31 +0000 | [diff] [blame] | 64 | KHR_external_fence_fd, |
Tom Murphy | ea32184 | 2024-06-14 18:26:58 +0000 | [diff] [blame] | 65 | KHR_swapchain_mutable_format, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 66 | |
Yiwei Zhang | 7cc36a5 | 2019-10-11 19:02:09 -0700 | [diff] [blame] | 67 | EXTENSION_CORE_1_0, |
| 68 | EXTENSION_CORE_1_1, |
Yiwei Zhang | 6be097b | 2020-10-19 20:22:05 -0700 | [diff] [blame] | 69 | EXTENSION_CORE_1_2, |
Trevor David Black | b700ae8 | 2021-09-27 04:50:04 +0000 | [diff] [blame] | 70 | EXTENSION_CORE_1_3, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 71 | EXTENSION_COUNT, |
| 72 | EXTENSION_UNKNOWN, |
| 73 | }; |
| 74 | |
| 75 | const char* name; |
| 76 | Type type; |
| 77 | Extension extension; |
| 78 | |
| 79 | PFN_vkVoidFunction proc; |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 80 | PFN_vkVoidFunction checked_proc; // always nullptr for non-device hooks |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 81 | }; |
| 82 | |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 83 | struct InstanceDriverTable { |
| 84 | // clang-format off |
| 85 | PFN_vkDestroyInstance DestroyInstance; |
| 86 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
| 87 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; |
Jesse Hall | 85bb0c5 | 2017-02-09 22:13:02 -0800 | [diff] [blame] | 88 | PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 89 | PFN_vkCreateDevice CreateDevice; |
| 90 | PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; |
| 91 | PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; |
| 92 | PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; |
| 93 | PFN_vkDebugReportMessageEXT DebugReportMessageEXT; |
Yiwei Zhang | a55624b | 2020-07-05 16:05:26 -0700 | [diff] [blame] | 94 | PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2; |
| 95 | PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR; |
Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 96 | PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; |
Chris Forbes | 6aa30db | 2017-02-20 17:12:53 +1300 | [diff] [blame] | 97 | PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; |
Yiwei Zhang | a55624b | 2020-07-05 16:05:26 -0700 | [diff] [blame] | 98 | PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2; |
| 99 | PFN_vkGetPhysicalDeviceFormatProperties2KHR GetPhysicalDeviceFormatProperties2KHR; |
| 100 | PFN_vkGetPhysicalDeviceImageFormatProperties2 GetPhysicalDeviceImageFormatProperties2; |
| 101 | PFN_vkGetPhysicalDeviceImageFormatProperties2KHR GetPhysicalDeviceImageFormatProperties2KHR; |
| 102 | PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2; |
| 103 | PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR GetPhysicalDeviceQueueFamilyProperties2KHR; |
| 104 | PFN_vkGetPhysicalDeviceMemoryProperties2 GetPhysicalDeviceMemoryProperties2; |
| 105 | PFN_vkGetPhysicalDeviceMemoryProperties2KHR GetPhysicalDeviceMemoryProperties2KHR; |
| 106 | PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 GetPhysicalDeviceSparseImageFormatProperties2; |
| 107 | PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR GetPhysicalDeviceSparseImageFormatProperties2KHR; |
Yiwei Zhang | e1f3501 | 2020-07-05 22:52:04 -0700 | [diff] [blame] | 108 | PFN_vkGetPhysicalDeviceExternalBufferProperties GetPhysicalDeviceExternalBufferProperties; |
| 109 | PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR GetPhysicalDeviceExternalBufferPropertiesKHR; |
| 110 | PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties; |
| 111 | PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR GetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 112 | PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties; |
| 113 | PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR; |
Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 114 | PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups; |
Yiwei Zhang | e4f6417 | 2020-07-05 15:17:32 -0700 | [diff] [blame] | 115 | PFN_vkEnumeratePhysicalDeviceGroupsKHR EnumeratePhysicalDeviceGroupsKHR; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 116 | // clang-format on |
| 117 | }; |
| 118 | |
| 119 | struct DeviceDriverTable { |
| 120 | // clang-format off |
| 121 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; |
| 122 | PFN_vkDestroyDevice DestroyDevice; |
| 123 | PFN_vkGetDeviceQueue GetDeviceQueue; |
Yiwei Zhang | 899d175 | 2019-09-23 16:05:35 -0700 | [diff] [blame] | 124 | PFN_vkQueueSubmit QueueSubmit; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 125 | PFN_vkCreateImage CreateImage; |
| 126 | PFN_vkDestroyImage DestroyImage; |
| 127 | PFN_vkAllocateCommandBuffers AllocateCommandBuffers; |
Chris Forbes | 9d0d9ff | 2022-12-28 01:58:31 +0000 | [diff] [blame] | 128 | PFN_vkImportFenceFdKHR ImportFenceFdKHR; |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 129 | PFN_vkBindImageMemory2 BindImageMemory2; |
Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 130 | PFN_vkBindImageMemory2KHR BindImageMemory2KHR; |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 131 | PFN_vkGetDeviceQueue2 GetDeviceQueue2; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 132 | PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID; |
Yiwei Zhang | 4bc489b | 2019-09-23 15:17:22 -0700 | [diff] [blame] | 133 | PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID; |
Trevor David Black | 2cc4468 | 2022-03-09 00:31:38 +0000 | [diff] [blame] | 134 | PFN_vkGetSwapchainGrallocUsage3ANDROID GetSwapchainGrallocUsage3ANDROID; |
Trevor David Black | b6ca842 | 2023-07-26 20:00:04 +0000 | [diff] [blame] | 135 | PFN_vkGetSwapchainGrallocUsage4ANDROID GetSwapchainGrallocUsage4ANDROID; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 136 | PFN_vkAcquireImageANDROID AcquireImageANDROID; |
| 137 | PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID; |
| 138 | // clang-format on |
| 139 | }; |
| 140 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 141 | const ProcHook* GetProcHook(const char* name); |
| 142 | ProcHook::Extension GetProcHookExtension(const char* name); |
| 143 | |
Chia-I Wu | cbe07ef | 2016-04-13 15:01:00 +0800 | [diff] [blame] | 144 | bool InitDriverTable(VkInstance instance, |
| 145 | PFN_vkGetInstanceProcAddr get_proc, |
| 146 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); |
| 147 | bool InitDriverTable(VkDevice dev, |
| 148 | PFN_vkGetDeviceProcAddr get_proc, |
| 149 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 150 | |
Yiwei Zhang | 7c0c07c | 2020-07-04 23:49:47 -0700 | [diff] [blame] | 151 | std::optional<uint32_t> GetInstanceExtensionPromotedVersion(const char* name); |
| 152 | uint32_t CountPromotedInstanceExtensions(uint32_t begin_version, |
| 153 | uint32_t end_version); |
| 154 | std::vector<const char*> GetPromotedInstanceExtensions(uint32_t begin_version, |
| 155 | uint32_t end_version); |
| 156 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 157 | } // namespace driver |
| 158 | } // namespace vulkan |
| 159 | |
| 160 | #endif // LIBVULKAN_DRIVER_TABLE_H |