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 22 #include <vulkan/vk_android_native_buffer.h> 23 #include <vulkan/vulkan.h> 24 #include <bitset> 25 26 namespace vulkan { 27 namespace driver { 28 29 struct ProcHook { 30 enum Type { 31 GLOBAL, 32 INSTANCE, 33 DEVICE, 34 }; 35 enum Extension { 36 ANDROID_native_buffer, 37 EXT_debug_report, 38 EXT_hdr_metadata, 39 EXT_swapchain_colorspace, 40 GOOGLE_display_timing, 41 KHR_android_surface, 42 KHR_incremental_present, 43 KHR_shared_presentable_image, 44 KHR_surface, 45 KHR_swapchain, 46 KHR_get_surface_capabilities2, 47 KHR_get_physical_device_properties2, 48 ANDROID_external_memory_android_hardware_buffer, 49 KHR_bind_memory2, 50 51 EXTENSION_CORE_1_0, 52 EXTENSION_CORE_1_1, 53 EXTENSION_COUNT, 54 EXTENSION_UNKNOWN, 55 }; 56 57 const char* name; 58 Type type; 59 Extension extension; 60 61 PFN_vkVoidFunction proc; 62 PFN_vkVoidFunction checked_proc; // always nullptr for non-device hooks 63 }; 64 65 struct InstanceDriverTable { 66 // clang-format off 67 PFN_vkDestroyInstance DestroyInstance; 68 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; 69 PFN_vkGetInstanceProcAddr GetInstanceProcAddr; 70 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; 71 PFN_vkCreateDevice CreateDevice; 72 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; 73 PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups; 74 PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; 75 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; 76 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; 77 PFN_vkDebugReportMessageEXT DebugReportMessageEXT; 78 PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR; 79 // clang-format on 80 }; 81 82 struct DeviceDriverTable { 83 // clang-format off 84 PFN_vkGetDeviceProcAddr GetDeviceProcAddr; 85 PFN_vkDestroyDevice DestroyDevice; 86 PFN_vkGetDeviceQueue GetDeviceQueue; 87 PFN_vkCreateImage CreateImage; 88 PFN_vkDestroyImage DestroyImage; 89 PFN_vkAllocateCommandBuffers AllocateCommandBuffers; 90 PFN_vkBindImageMemory2 BindImageMemory2; 91 PFN_vkGetDeviceQueue2 GetDeviceQueue2; 92 PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID; 93 PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID; 94 PFN_vkAcquireImageANDROID AcquireImageANDROID; 95 PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID; 96 PFN_vkBindImageMemory2KHR BindImageMemory2KHR; 97 // clang-format on 98 }; 99 100 const ProcHook* GetProcHook(const char* name); 101 ProcHook::Extension GetProcHookExtension(const char* name); 102 103 bool InitDriverTable(VkInstance instance, 104 PFN_vkGetInstanceProcAddr get_proc, 105 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); 106 bool InitDriverTable(VkDevice dev, 107 PFN_vkGetDeviceProcAddr get_proc, 108 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions); 109 110 } // namespace driver 111 } // namespace vulkan 112 113 #endif // LIBVULKAN_DRIVER_TABLE_H 114