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 | #include <string.h> |
Mark Salyzyn | a5e161b | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 20 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 21 | #include <algorithm> |
Mark Salyzyn | a5e161b | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 22 | |
Mark Salyzyn | 7823e12 | 2016-09-29 08:08:05 -0700 | [diff] [blame] | 23 | #include <log/log.h> |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 24 | |
| 25 | #include "driver.h" |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 26 | |
| 27 | namespace vulkan { |
| 28 | namespace driver { |
| 29 | |
| 30 | namespace { |
| 31 | |
| 32 | // clang-format off |
| 33 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 34 | VKAPI_ATTR VkResult checkedCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) { |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 35 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 36 | return CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); |
| 37 | } else { |
Chia-I Wu | 5beb2ac | 2016-05-04 16:37:23 +0800 | [diff] [blame] | 38 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkCreateSwapchainKHR not executed."); |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 39 | return VK_SUCCESS; |
| 40 | } |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | VKAPI_ATTR void checkedDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) { |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 44 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 45 | DestroySwapchainKHR(device, swapchain, pAllocator); |
| 46 | } else { |
Chia-I Wu | 5beb2ac | 2016-05-04 16:37:23 +0800 | [diff] [blame] | 47 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkDestroySwapchainKHR not executed."); |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 48 | } |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | VKAPI_ATTR VkResult checkedGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) { |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 52 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 53 | return GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); |
| 54 | } else { |
Chia-I Wu | 5beb2ac | 2016-05-04 16:37:23 +0800 | [diff] [blame] | 55 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkGetSwapchainImagesKHR not executed."); |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 56 | return VK_SUCCESS; |
| 57 | } |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | VKAPI_ATTR VkResult checkedAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) { |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 61 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 62 | return AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); |
| 63 | } else { |
Chia-I Wu | 5beb2ac | 2016-05-04 16:37:23 +0800 | [diff] [blame] | 64 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkAcquireNextImageKHR not executed."); |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 65 | return VK_SUCCESS; |
| 66 | } |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | VKAPI_ATTR VkResult checkedQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) { |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 70 | if (GetData(queue).hook_extensions[ProcHook::KHR_swapchain]) { |
| 71 | return QueuePresentKHR(queue, pPresentInfo); |
| 72 | } else { |
Chia-I Wu | 5beb2ac | 2016-05-04 16:37:23 +0800 | [diff] [blame] | 73 | Logger(queue).Err(queue, "VK_KHR_swapchain not enabled. vkQueuePresentKHR not executed."); |
Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 74 | return VK_SUCCESS; |
| 75 | } |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 76 | } |
| 77 | |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 78 | VKAPI_ATTR VkResult checkedGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) { |
| 79 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 80 | return GetDeviceGroupPresentCapabilitiesKHR(device, pDeviceGroupPresentCapabilities); |
| 81 | } else { |
| 82 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkGetDeviceGroupPresentCapabilitiesKHR not executed."); |
| 83 | return VK_SUCCESS; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | VKAPI_ATTR VkResult checkedGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) { |
| 88 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 89 | return GetDeviceGroupSurfacePresentModesKHR(device, surface, pModes); |
| 90 | } else { |
| 91 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkGetDeviceGroupSurfacePresentModesKHR not executed."); |
| 92 | return VK_SUCCESS; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | VKAPI_ATTR VkResult checkedAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) { |
| 97 | if (GetData(device).hook_extensions[ProcHook::KHR_swapchain]) { |
| 98 | return AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex); |
| 99 | } else { |
| 100 | Logger(device).Err(device, "VK_KHR_swapchain not enabled. vkAcquireNextImage2KHR not executed."); |
| 101 | return VK_SUCCESS; |
| 102 | } |
| 103 | } |
| 104 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 105 | VKAPI_ATTR VkResult checkedGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { |
| 106 | if (GetData(device).hook_extensions[ProcHook::GOOGLE_display_timing]) { |
| 107 | return GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); |
| 108 | } else { |
| 109 | Logger(device).Err(device, "VK_GOOGLE_display_timing not enabled. vkGetRefreshCycleDurationGOOGLE not executed."); |
| 110 | return VK_SUCCESS; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | VKAPI_ATTR VkResult checkedGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings) { |
| 115 | if (GetData(device).hook_extensions[ProcHook::GOOGLE_display_timing]) { |
| 116 | return GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, pPresentationTimings); |
| 117 | } else { |
| 118 | Logger(device).Err(device, "VK_GOOGLE_display_timing not enabled. vkGetPastPresentationTimingGOOGLE not executed."); |
| 119 | return VK_SUCCESS; |
| 120 | } |
| 121 | } |
| 122 | |
Jesse Hall | 889cd9a | 2017-02-25 22:12:23 -0800 | [diff] [blame] | 123 | VKAPI_ATTR void checkedSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) { |
| 124 | if (GetData(device).hook_extensions[ProcHook::EXT_hdr_metadata]) { |
| 125 | SetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata); |
| 126 | } else { |
| 127 | Logger(device).Err(device, "VK_EXT_hdr_metadata not enabled. vkSetHdrMetadataEXT not executed."); |
| 128 | } |
| 129 | } |
| 130 | |
Chris Forbes | 0f2ac2e | 2017-01-18 13:33:53 +1300 | [diff] [blame] | 131 | VKAPI_ATTR VkResult checkedGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) { |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 132 | if (GetData(device).hook_extensions[ProcHook::KHR_shared_presentable_image]) { |
Chris Forbes | 0f2ac2e | 2017-01-18 13:33:53 +1300 | [diff] [blame] | 133 | return GetSwapchainStatusKHR(device, swapchain); |
| 134 | } else { |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 135 | Logger(device).Err(device, "VK_KHR_shared_presentable_image not enabled. vkGetSwapchainStatusKHR not executed."); |
Chris Forbes | 0f2ac2e | 2017-01-18 13:33:53 +1300 | [diff] [blame] | 136 | return VK_SUCCESS; |
| 137 | } |
| 138 | } |
| 139 | |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 140 | VKAPI_ATTR VkResult checkedBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfoKHR* pBindInfos) { |
| 141 | if (GetData(device).hook_extensions[ProcHook::KHR_bind_memory2]) { |
| 142 | return BindImageMemory2KHR(device, bindInfoCount, pBindInfos); |
| 143 | } else { |
| 144 | Logger(device).Err(device, "VK_KHR_bind_memory2 not enabled. vkBindImageMemory2KHR not executed."); |
| 145 | return VK_SUCCESS; |
| 146 | } |
| 147 | } |
| 148 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 149 | // clang-format on |
| 150 | |
| 151 | const ProcHook g_proc_hooks[] = { |
| 152 | // clang-format off |
| 153 | { |
| 154 | "vkAcquireImageANDROID", |
| 155 | ProcHook::DEVICE, |
| 156 | ProcHook::ANDROID_native_buffer, |
| 157 | nullptr, |
| 158 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 159 | }, |
| 160 | { |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 161 | "vkAcquireNextImage2KHR", |
| 162 | ProcHook::DEVICE, |
| 163 | ProcHook::KHR_swapchain, |
| 164 | reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImage2KHR), |
| 165 | reinterpret_cast<PFN_vkVoidFunction>(checkedAcquireNextImage2KHR), |
| 166 | }, |
| 167 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 168 | "vkAcquireNextImageKHR", |
| 169 | ProcHook::DEVICE, |
| 170 | ProcHook::KHR_swapchain, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 171 | reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImageKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 172 | reinterpret_cast<PFN_vkVoidFunction>(checkedAcquireNextImageKHR), |
| 173 | }, |
| 174 | { |
| 175 | "vkAllocateCommandBuffers", |
| 176 | ProcHook::DEVICE, |
| 177 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | 6a58a8a | 2016-03-24 16:29:51 +0800 | [diff] [blame] | 178 | reinterpret_cast<PFN_vkVoidFunction>(AllocateCommandBuffers), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 179 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 180 | }, |
| 181 | { |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 182 | "vkBindImageMemory2", |
| 183 | ProcHook::DEVICE, |
| 184 | ProcHook::EXTENSION_CORE, |
| 185 | reinterpret_cast<PFN_vkVoidFunction>(BindImageMemory2), |
| 186 | nullptr, |
| 187 | }, |
| 188 | { |
| 189 | "vkBindImageMemory2KHR", |
| 190 | ProcHook::DEVICE, |
| 191 | ProcHook::KHR_bind_memory2, |
| 192 | reinterpret_cast<PFN_vkVoidFunction>(BindImageMemory2KHR), |
| 193 | reinterpret_cast<PFN_vkVoidFunction>(checkedBindImageMemory2KHR), |
| 194 | }, |
| 195 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 196 | "vkCreateAndroidSurfaceKHR", |
| 197 | ProcHook::INSTANCE, |
| 198 | ProcHook::KHR_android_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 199 | reinterpret_cast<PFN_vkVoidFunction>(CreateAndroidSurfaceKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 200 | nullptr, |
| 201 | }, |
| 202 | { |
| 203 | "vkCreateDebugReportCallbackEXT", |
| 204 | ProcHook::INSTANCE, |
| 205 | ProcHook::EXT_debug_report, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 206 | reinterpret_cast<PFN_vkVoidFunction>(CreateDebugReportCallbackEXT), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 207 | nullptr, |
| 208 | }, |
| 209 | { |
| 210 | "vkCreateDevice", |
| 211 | ProcHook::INSTANCE, |
| 212 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | 4901db7 | 2016-03-24 16:38:58 +0800 | [diff] [blame] | 213 | reinterpret_cast<PFN_vkVoidFunction>(CreateDevice), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 214 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 215 | }, |
| 216 | { |
| 217 | "vkCreateInstance", |
| 218 | ProcHook::GLOBAL, |
| 219 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | ff4a6c7 | 2016-03-24 16:05:56 +0800 | [diff] [blame] | 220 | reinterpret_cast<PFN_vkVoidFunction>(CreateInstance), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 221 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 222 | }, |
| 223 | { |
| 224 | "vkCreateSwapchainKHR", |
| 225 | ProcHook::DEVICE, |
| 226 | ProcHook::KHR_swapchain, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 227 | reinterpret_cast<PFN_vkVoidFunction>(CreateSwapchainKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 228 | reinterpret_cast<PFN_vkVoidFunction>(checkedCreateSwapchainKHR), |
| 229 | }, |
| 230 | { |
| 231 | "vkDebugReportMessageEXT", |
| 232 | ProcHook::INSTANCE, |
| 233 | ProcHook::EXT_debug_report, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 234 | reinterpret_cast<PFN_vkVoidFunction>(DebugReportMessageEXT), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 235 | nullptr, |
| 236 | }, |
| 237 | { |
| 238 | "vkDestroyDebugReportCallbackEXT", |
| 239 | ProcHook::INSTANCE, |
| 240 | ProcHook::EXT_debug_report, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 241 | reinterpret_cast<PFN_vkVoidFunction>(DestroyDebugReportCallbackEXT), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 242 | nullptr, |
| 243 | }, |
| 244 | { |
| 245 | "vkDestroyDevice", |
| 246 | ProcHook::DEVICE, |
| 247 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | 4901db7 | 2016-03-24 16:38:58 +0800 | [diff] [blame] | 248 | reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 249 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 250 | }, |
| 251 | { |
| 252 | "vkDestroyInstance", |
| 253 | ProcHook::INSTANCE, |
| 254 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | ff4a6c7 | 2016-03-24 16:05:56 +0800 | [diff] [blame] | 255 | reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 256 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 257 | }, |
| 258 | { |
| 259 | "vkDestroySurfaceKHR", |
| 260 | ProcHook::INSTANCE, |
| 261 | ProcHook::KHR_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 262 | reinterpret_cast<PFN_vkVoidFunction>(DestroySurfaceKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 263 | nullptr, |
| 264 | }, |
| 265 | { |
| 266 | "vkDestroySwapchainKHR", |
| 267 | ProcHook::DEVICE, |
| 268 | ProcHook::KHR_swapchain, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 269 | reinterpret_cast<PFN_vkVoidFunction>(DestroySwapchainKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 270 | reinterpret_cast<PFN_vkVoidFunction>(checkedDestroySwapchainKHR), |
| 271 | }, |
| 272 | { |
| 273 | "vkEnumerateDeviceExtensionProperties", |
| 274 | ProcHook::INSTANCE, |
| 275 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | 01cf305 | 2016-03-24 16:16:21 +0800 | [diff] [blame] | 276 | reinterpret_cast<PFN_vkVoidFunction>(EnumerateDeviceExtensionProperties), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 277 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 278 | }, |
| 279 | { |
| 280 | "vkEnumerateInstanceExtensionProperties", |
| 281 | ProcHook::GLOBAL, |
| 282 | ProcHook::EXTENSION_CORE, |
| 283 | reinterpret_cast<PFN_vkVoidFunction>(EnumerateInstanceExtensionProperties), |
| 284 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 285 | }, |
| 286 | { |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 287 | "vkEnumeratePhysicalDeviceGroups", |
| 288 | ProcHook::INSTANCE, |
| 289 | ProcHook::EXTENSION_CORE, |
| 290 | reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDeviceGroups), |
| 291 | nullptr, |
| 292 | }, |
| 293 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 294 | "vkEnumeratePhysicalDevices", |
| 295 | ProcHook::INSTANCE, |
| 296 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | ff4a6c7 | 2016-03-24 16:05:56 +0800 | [diff] [blame] | 297 | reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 298 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 299 | }, |
| 300 | { |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 301 | "vkGetDeviceGroupPresentCapabilitiesKHR", |
| 302 | ProcHook::DEVICE, |
| 303 | ProcHook::KHR_swapchain, |
| 304 | reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupPresentCapabilitiesKHR), |
| 305 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetDeviceGroupPresentCapabilitiesKHR), |
| 306 | }, |
| 307 | { |
| 308 | "vkGetDeviceGroupSurfacePresentModesKHR", |
| 309 | ProcHook::DEVICE, |
| 310 | ProcHook::KHR_swapchain, |
| 311 | reinterpret_cast<PFN_vkVoidFunction>(GetDeviceGroupSurfacePresentModesKHR), |
| 312 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetDeviceGroupSurfacePresentModesKHR), |
| 313 | }, |
| 314 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 315 | "vkGetDeviceProcAddr", |
| 316 | ProcHook::DEVICE, |
| 317 | ProcHook::EXTENSION_CORE, |
| 318 | reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr), |
| 319 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 320 | }, |
| 321 | { |
| 322 | "vkGetDeviceQueue", |
| 323 | ProcHook::DEVICE, |
| 324 | ProcHook::EXTENSION_CORE, |
Chia-I Wu | ba0be41 | 2016-03-24 16:24:40 +0800 | [diff] [blame] | 325 | reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 326 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 327 | }, |
| 328 | { |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 329 | "vkGetDeviceQueue2", |
| 330 | ProcHook::DEVICE, |
| 331 | ProcHook::EXTENSION_CORE, |
| 332 | reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue2), |
| 333 | nullptr, |
| 334 | }, |
| 335 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 336 | "vkGetInstanceProcAddr", |
| 337 | ProcHook::INSTANCE, |
| 338 | ProcHook::EXTENSION_CORE, |
| 339 | reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr), |
| 340 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 341 | }, |
| 342 | { |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 343 | "vkGetPastPresentationTimingGOOGLE", |
| 344 | ProcHook::DEVICE, |
| 345 | ProcHook::GOOGLE_display_timing, |
| 346 | reinterpret_cast<PFN_vkVoidFunction>(GetPastPresentationTimingGOOGLE), |
| 347 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetPastPresentationTimingGOOGLE), |
| 348 | }, |
| 349 | { |
Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 350 | "vkGetPhysicalDevicePresentRectanglesKHR", |
| 351 | ProcHook::INSTANCE, |
| 352 | ProcHook::KHR_swapchain, |
| 353 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDevicePresentRectanglesKHR), |
| 354 | nullptr, |
| 355 | }, |
| 356 | { |
Chris Forbes | 2452cf7 | 2017-03-16 16:30:17 +1300 | [diff] [blame] | 357 | "vkGetPhysicalDeviceSurfaceCapabilities2KHR", |
| 358 | ProcHook::INSTANCE, |
| 359 | ProcHook::KHR_get_surface_capabilities2, |
| 360 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceCapabilities2KHR), |
| 361 | nullptr, |
| 362 | }, |
| 363 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 364 | "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", |
| 365 | ProcHook::INSTANCE, |
| 366 | ProcHook::KHR_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 367 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceCapabilitiesKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 368 | nullptr, |
| 369 | }, |
| 370 | { |
Chris Forbes | 2452cf7 | 2017-03-16 16:30:17 +1300 | [diff] [blame] | 371 | "vkGetPhysicalDeviceSurfaceFormats2KHR", |
| 372 | ProcHook::INSTANCE, |
| 373 | ProcHook::KHR_get_surface_capabilities2, |
| 374 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceFormats2KHR), |
| 375 | nullptr, |
| 376 | }, |
| 377 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 378 | "vkGetPhysicalDeviceSurfaceFormatsKHR", |
| 379 | ProcHook::INSTANCE, |
| 380 | ProcHook::KHR_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 381 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceFormatsKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 382 | nullptr, |
| 383 | }, |
| 384 | { |
| 385 | "vkGetPhysicalDeviceSurfacePresentModesKHR", |
| 386 | ProcHook::INSTANCE, |
| 387 | ProcHook::KHR_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 388 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfacePresentModesKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 389 | nullptr, |
| 390 | }, |
| 391 | { |
| 392 | "vkGetPhysicalDeviceSurfaceSupportKHR", |
| 393 | ProcHook::INSTANCE, |
| 394 | ProcHook::KHR_surface, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 395 | reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceSupportKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 396 | nullptr, |
| 397 | }, |
| 398 | { |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 399 | "vkGetRefreshCycleDurationGOOGLE", |
| 400 | ProcHook::DEVICE, |
| 401 | ProcHook::GOOGLE_display_timing, |
| 402 | reinterpret_cast<PFN_vkVoidFunction>(GetRefreshCycleDurationGOOGLE), |
| 403 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetRefreshCycleDurationGOOGLE), |
| 404 | }, |
| 405 | { |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 406 | "vkGetSwapchainGrallocUsage2ANDROID", |
| 407 | ProcHook::DEVICE, |
| 408 | ProcHook::ANDROID_native_buffer, |
| 409 | nullptr, |
| 410 | nullptr, |
| 411 | }, |
| 412 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 413 | "vkGetSwapchainGrallocUsageANDROID", |
| 414 | ProcHook::DEVICE, |
| 415 | ProcHook::ANDROID_native_buffer, |
| 416 | nullptr, |
| 417 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 418 | }, |
| 419 | { |
| 420 | "vkGetSwapchainImagesKHR", |
| 421 | ProcHook::DEVICE, |
| 422 | ProcHook::KHR_swapchain, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 423 | reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 424 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetSwapchainImagesKHR), |
| 425 | }, |
| 426 | { |
Chris Forbes | 0f2ac2e | 2017-01-18 13:33:53 +1300 | [diff] [blame] | 427 | "vkGetSwapchainStatusKHR", |
| 428 | ProcHook::DEVICE, |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 429 | ProcHook::KHR_shared_presentable_image, |
Chris Forbes | 0f2ac2e | 2017-01-18 13:33:53 +1300 | [diff] [blame] | 430 | reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainStatusKHR), |
| 431 | reinterpret_cast<PFN_vkVoidFunction>(checkedGetSwapchainStatusKHR), |
| 432 | }, |
| 433 | { |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 434 | "vkQueuePresentKHR", |
| 435 | ProcHook::DEVICE, |
| 436 | ProcHook::KHR_swapchain, |
Chia-I Wu | 6226223 | 2016-03-26 07:06:44 +0800 | [diff] [blame] | 437 | reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR), |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 438 | reinterpret_cast<PFN_vkVoidFunction>(checkedQueuePresentKHR), |
| 439 | }, |
| 440 | { |
| 441 | "vkQueueSignalReleaseImageANDROID", |
| 442 | ProcHook::DEVICE, |
| 443 | ProcHook::ANDROID_native_buffer, |
| 444 | nullptr, |
| 445 | nullptr, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 446 | }, |
Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 447 | { |
| 448 | "vkSetHdrMetadataEXT", |
| 449 | ProcHook::DEVICE, |
| 450 | ProcHook::EXT_hdr_metadata, |
| 451 | reinterpret_cast<PFN_vkVoidFunction>(SetHdrMetadataEXT), |
| 452 | reinterpret_cast<PFN_vkVoidFunction>(checkedSetHdrMetadataEXT), |
| 453 | }, |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 454 | // clang-format on |
| 455 | }; |
| 456 | |
Chris Forbes | e2d3ee1 | 2017-03-16 16:10:15 +1300 | [diff] [blame] | 457 | } // namespace |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 458 | |
| 459 | const ProcHook* GetProcHook(const char* name) { |
| 460 | const auto& begin = g_proc_hooks; |
| 461 | const auto& end = |
| 462 | g_proc_hooks + sizeof(g_proc_hooks) / sizeof(g_proc_hooks[0]); |
| 463 | const auto hook = std::lower_bound( |
| 464 | begin, end, name, |
| 465 | [](const ProcHook& e, const char* n) { return strcmp(e.name, n) < 0; }); |
| 466 | return (hook < end && strcmp(hook->name, name) == 0) ? hook : nullptr; |
| 467 | } |
| 468 | |
| 469 | ProcHook::Extension GetProcHookExtension(const char* name) { |
| 470 | // clang-format off |
| 471 | if (strcmp(name, "VK_ANDROID_native_buffer") == 0) return ProcHook::ANDROID_native_buffer; |
| 472 | if (strcmp(name, "VK_EXT_debug_report") == 0) return ProcHook::EXT_debug_report; |
Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 473 | if (strcmp(name, "VK_EXT_hdr_metadata") == 0) return ProcHook::EXT_hdr_metadata; |
Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 474 | if (strcmp(name, "VK_EXT_swapchain_colorspace") == 0) return ProcHook::EXT_swapchain_colorspace; |
Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 475 | if (strcmp(name, "VK_GOOGLE_display_timing") == 0) return ProcHook::GOOGLE_display_timing; |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 476 | if (strcmp(name, "VK_KHR_android_surface") == 0) return ProcHook::KHR_android_surface; |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 477 | if (strcmp(name, "VK_KHR_incremental_present") == 0) return ProcHook::KHR_incremental_present; |
Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 478 | if (strcmp(name, "VK_KHR_shared_presentable_image") == 0) return ProcHook::KHR_shared_presentable_image; |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 479 | if (strcmp(name, "VK_KHR_surface") == 0) return ProcHook::KHR_surface; |
| 480 | if (strcmp(name, "VK_KHR_swapchain") == 0) return ProcHook::KHR_swapchain; |
Chris Forbes | 2452cf7 | 2017-03-16 16:30:17 +1300 | [diff] [blame] | 481 | if (strcmp(name, "VK_KHR_get_surface_capabilities2") == 0) return ProcHook::KHR_get_surface_capabilities2; |
Chris Forbes | 6aa30db | 2017-02-20 17:12:53 +1300 | [diff] [blame] | 482 | if (strcmp(name, "VK_KHR_get_physical_device_properties2") == 0) return ProcHook::KHR_get_physical_device_properties2; |
Jesse Hall | a8d367a | 2018-01-18 15:40:46 -0800 | [diff] [blame] | 483 | if (strcmp(name, "VK_ANDROID_external_memory_android_hardware_buffer") == 0) return ProcHook::ANDROID_external_memory_android_hardware_buffer; |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 484 | if (strcmp(name, "VK_KHR_bind_memory2") == 0) return ProcHook::KHR_bind_memory2; |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 485 | // clang-format on |
| 486 | return ProcHook::EXTENSION_UNKNOWN; |
| 487 | } |
| 488 | |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 489 | #define UNLIKELY(expr) __builtin_expect((expr), 0) |
| 490 | |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 491 | #define INIT_PROC(required, obj, proc) \ |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 492 | do { \ |
| 493 | data.driver.proc = \ |
| 494 | reinterpret_cast<PFN_vk##proc>(get_proc(obj, "vk" #proc)); \ |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 495 | if (UNLIKELY(required && !data.driver.proc)) { \ |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 496 | ALOGE("missing " #obj " proc: vk" #proc); \ |
| 497 | success = false; \ |
| 498 | } \ |
| 499 | } while (0) |
| 500 | |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 501 | #define INIT_PROC_EXT(ext, required, obj, proc) \ |
| 502 | do { \ |
| 503 | if (extensions[ProcHook::ext]) \ |
| 504 | INIT_PROC(required, obj, proc); \ |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 505 | } while (0) |
| 506 | |
Chia-I Wu | cbe07ef | 2016-04-13 15:01:00 +0800 | [diff] [blame] | 507 | bool InitDriverTable(VkInstance instance, |
| 508 | PFN_vkGetInstanceProcAddr get_proc, |
| 509 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions) { |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 510 | auto& data = GetData(instance); |
| 511 | bool success = true; |
| 512 | |
| 513 | // clang-format off |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 514 | INIT_PROC(true, instance, DestroyInstance); |
| 515 | INIT_PROC(true, instance, EnumeratePhysicalDevices); |
| 516 | INIT_PROC(true, instance, GetInstanceProcAddr); |
Jesse Hall | 85bb0c5 | 2017-02-09 22:13:02 -0800 | [diff] [blame] | 517 | INIT_PROC(true, instance, GetPhysicalDeviceProperties); |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 518 | INIT_PROC(true, instance, CreateDevice); |
| 519 | INIT_PROC(true, instance, EnumerateDeviceExtensionProperties); |
Ian Elliott | cd8ad33 | 2017-10-13 09:21:12 -0600 | [diff] [blame] | 520 | INIT_PROC(false, instance, EnumeratePhysicalDeviceGroups); |
Yiwei Zhang | 922b1e3 | 2018-03-13 17:12:11 -0700 | [diff] [blame] | 521 | INIT_PROC(false, instance, GetPhysicalDeviceProperties2); |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 522 | INIT_PROC_EXT(EXT_debug_report, true, instance, CreateDebugReportCallbackEXT); |
| 523 | INIT_PROC_EXT(EXT_debug_report, true, instance, DestroyDebugReportCallbackEXT); |
| 524 | INIT_PROC_EXT(EXT_debug_report, true, instance, DebugReportMessageEXT); |
Chris Forbes | 6aa30db | 2017-02-20 17:12:53 +1300 | [diff] [blame] | 525 | INIT_PROC_EXT(KHR_get_physical_device_properties2, true, instance, GetPhysicalDeviceProperties2KHR); |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 526 | // clang-format on |
| 527 | |
| 528 | return success; |
| 529 | } |
| 530 | |
Chia-I Wu | cbe07ef | 2016-04-13 15:01:00 +0800 | [diff] [blame] | 531 | bool InitDriverTable(VkDevice dev, |
| 532 | PFN_vkGetDeviceProcAddr get_proc, |
| 533 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions) { |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 534 | auto& data = GetData(dev); |
| 535 | bool success = true; |
| 536 | |
| 537 | // clang-format off |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 538 | INIT_PROC(true, dev, GetDeviceProcAddr); |
| 539 | INIT_PROC(true, dev, DestroyDevice); |
| 540 | INIT_PROC(true, dev, GetDeviceQueue); |
| 541 | INIT_PROC(true, dev, CreateImage); |
| 542 | INIT_PROC(true, dev, DestroyImage); |
| 543 | INIT_PROC(true, dev, AllocateCommandBuffers); |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 544 | INIT_PROC(false, dev, BindImageMemory2); |
Ian Elliott | cd8ad33 | 2017-10-13 09:21:12 -0600 | [diff] [blame] | 545 | INIT_PROC(false, dev, GetDeviceQueue2); |
Chris Forbes | d827791 | 2017-02-10 14:59:59 +1300 | [diff] [blame] | 546 | INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsageANDROID); |
Chris Forbes | 5948b3e | 2016-12-23 13:49:53 +1300 | [diff] [blame] | 547 | INIT_PROC_EXT(ANDROID_native_buffer, false, dev, GetSwapchainGrallocUsage2ANDROID); |
| 548 | INIT_PROC_EXT(ANDROID_native_buffer, true, dev, AcquireImageANDROID); |
| 549 | INIT_PROC_EXT(ANDROID_native_buffer, true, dev, QueueSignalReleaseImageANDROID); |
Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 550 | INIT_PROC_EXT(KHR_bind_memory2, true, dev, BindImageMemory2KHR); |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 551 | // clang-format on |
| 552 | |
| 553 | return success; |
| 554 | } |
| 555 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 556 | } // namespace driver |
| 557 | } // namespace vulkan |
| 558 | |
| 559 | // clang-format on |