| 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> | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 26 |  | 
|  | 27 | namespace vulkan { | 
|  | 28 | namespace driver { | 
|  | 29 |  | 
|  | 30 | struct ProcHook { | 
|  | 31 | enum Type { | 
|  | 32 | GLOBAL, | 
|  | 33 | INSTANCE, | 
|  | 34 | DEVICE, | 
|  | 35 | }; | 
|  | 36 | enum Extension { | 
|  | 37 | ANDROID_native_buffer, | 
|  | 38 | EXT_debug_report, | 
| Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 39 | EXT_hdr_metadata, | 
| Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 40 | EXT_swapchain_colorspace, | 
| Courtney Goeltzenleuchter | d634c48 | 2017-01-05 15:55:31 -0700 | [diff] [blame] | 41 | GOOGLE_display_timing, | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 42 | KHR_android_surface, | 
| Yiwei Zhang | dc792f5 | 2019-10-10 16:29:42 -0700 | [diff] [blame] | 43 | KHR_get_surface_capabilities2, | 
| Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 44 | KHR_incremental_present, | 
| Courtney Goeltzenleuchter | e278daf | 2017-02-02 16:54:57 -0700 | [diff] [blame] | 45 | KHR_shared_presentable_image, | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 46 | KHR_surface, | 
|  | 47 | KHR_swapchain, | 
| Jesse Hall | a8d367a | 2018-01-18 15:40:46 -0800 | [diff] [blame] | 48 | ANDROID_external_memory_android_hardware_buffer, | 
| Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 49 | KHR_bind_memory2, | 
| Yiwei Zhang | dc792f5 | 2019-10-10 16:29:42 -0700 | [diff] [blame] | 50 | KHR_get_physical_device_properties2, | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 51 |  | 
| Yiwei Zhang | 7cc36a5 | 2019-10-11 19:02:09 -0700 | [diff] [blame] | 52 | EXTENSION_CORE_1_0, | 
|  | 53 | EXTENSION_CORE_1_1, | 
| Yiwei Zhang | 6be097b | 2020-10-19 20:22:05 -0700 | [diff] [blame] | 54 | EXTENSION_CORE_1_2, | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 55 | EXTENSION_COUNT, | 
|  | 56 | EXTENSION_UNKNOWN, | 
|  | 57 | }; | 
|  | 58 |  | 
|  | 59 | const char* name; | 
|  | 60 | Type type; | 
|  | 61 | Extension extension; | 
|  | 62 |  | 
|  | 63 | PFN_vkVoidFunction proc; | 
| Chia-I Wu | 36cc00a | 2016-04-13 16:52:06 +0800 | [diff] [blame] | 64 | PFN_vkVoidFunction checked_proc;  // always nullptr for non-device hooks | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 65 | }; | 
|  | 66 |  | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 67 | struct InstanceDriverTable { | 
|  | 68 | // clang-format off | 
|  | 69 | PFN_vkDestroyInstance DestroyInstance; | 
|  | 70 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; | 
|  | 71 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; | 
| Jesse Hall | 85bb0c5 | 2017-02-09 22:13:02 -0800 | [diff] [blame] | 72 | PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 73 | PFN_vkCreateDevice CreateDevice; | 
|  | 74 | PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; | 
|  | 75 | PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; | 
|  | 76 | PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; | 
|  | 77 | PFN_vkDebugReportMessageEXT DebugReportMessageEXT; | 
| Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 78 | PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; | 
| Chris Forbes | 6aa30db | 2017-02-20 17:12:53 +1300 | [diff] [blame] | 79 | PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; | 
| Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 80 | PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups; | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 81 | // clang-format on | 
|  | 82 | }; | 
|  | 83 |  | 
|  | 84 | struct DeviceDriverTable { | 
|  | 85 | // clang-format off | 
|  | 86 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; | 
|  | 87 | PFN_vkDestroyDevice DestroyDevice; | 
|  | 88 | PFN_vkGetDeviceQueue GetDeviceQueue; | 
| Yiwei Zhang | 899d175 | 2019-09-23 16:05:35 -0700 | [diff] [blame] | 89 | PFN_vkQueueSubmit QueueSubmit; | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 90 | PFN_vkCreateImage CreateImage; | 
|  | 91 | PFN_vkDestroyImage DestroyImage; | 
|  | 92 | PFN_vkAllocateCommandBuffers AllocateCommandBuffers; | 
| Yiwei Zhang | 2314310 | 2019-04-10 18:24:05 -0700 | [diff] [blame] | 93 | PFN_vkBindImageMemory2 BindImageMemory2; | 
| Adithya Srinivasan | 8dce9d7 | 2019-07-11 14:26:04 -0700 | [diff] [blame] | 94 | PFN_vkBindImageMemory2KHR BindImageMemory2KHR; | 
| Daniel Koch | f25f5bb | 2017-10-05 00:26:58 -0400 | [diff] [blame] | 95 | PFN_vkGetDeviceQueue2 GetDeviceQueue2; | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 96 | PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID; | 
| Yiwei Zhang | 4bc489b | 2019-09-23 15:17:22 -0700 | [diff] [blame] | 97 | PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID; | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 98 | PFN_vkAcquireImageANDROID AcquireImageANDROID; | 
|  | 99 | PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID; | 
|  | 100 | // clang-format on | 
|  | 101 | }; | 
|  | 102 |  | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 103 | const ProcHook* GetProcHook(const char* name); | 
|  | 104 | ProcHook::Extension GetProcHookExtension(const char* name); | 
|  | 105 |  | 
| Chia-I Wu | cbe07ef | 2016-04-13 15:01:00 +0800 | [diff] [blame] | 106 | bool InitDriverTable(VkInstance instance, | 
|  | 107 | PFN_vkGetInstanceProcAddr get_proc, | 
|  | 108 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); | 
|  | 109 | bool InitDriverTable(VkDevice dev, | 
|  | 110 | PFN_vkGetDeviceProcAddr get_proc, | 
|  | 111 | const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); | 
| Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 112 |  | 
| Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 113 | }  // namespace driver | 
|  | 114 | }  // namespace vulkan | 
|  | 115 |  | 
|  | 116 | #endif  // LIBVULKAN_DRIVER_TABLE_H |