blob: 43c4d1469ef5a6a837a9b1a59042f89c06d03fb2 [file] [log] [blame]
Chia-I Wueb7db122016-03-24 09:11:06 +08001/*
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 Wueb7db122016-03-24 09:11:06 +080022#include <vulkan/vk_android_native_buffer.h>
Chris Forbese2d3ee12017-03-16 16:10:15 +130023#include <vulkan/vulkan.h>
Yiwei Zhang6d78a572019-04-10 15:35:38 -070024
Chris Forbese2d3ee12017-03-16 16:10:15 +130025#include <bitset>
Chia-I Wueb7db122016-03-24 09:11:06 +080026
27namespace vulkan {
28namespace driver {
29
30struct ProcHook {
31 enum Type {
32 GLOBAL,
33 INSTANCE,
34 DEVICE,
35 };
36 enum Extension {
37 ANDROID_native_buffer,
38 EXT_debug_report,
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -070039 EXT_hdr_metadata,
Courtney Goeltzenleuchtere278daf2017-02-02 16:54:57 -070040 EXT_swapchain_colorspace,
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -070041 GOOGLE_display_timing,
Chia-I Wueb7db122016-03-24 09:11:06 +080042 KHR_android_surface,
Yiwei Zhangdc792f52019-10-10 16:29:42 -070043 KHR_get_surface_capabilities2,
Chris Forbes48853712017-01-12 14:09:33 +130044 KHR_incremental_present,
Courtney Goeltzenleuchtere278daf2017-02-02 16:54:57 -070045 KHR_shared_presentable_image,
Chia-I Wueb7db122016-03-24 09:11:06 +080046 KHR_surface,
47 KHR_swapchain,
Jesse Halla8d367a2018-01-18 15:40:46 -080048 ANDROID_external_memory_android_hardware_buffer,
Yiwei Zhang23143102019-04-10 18:24:05 -070049 KHR_bind_memory2,
Yiwei Zhangdc792f52019-10-10 16:29:42 -070050 KHR_get_physical_device_properties2,
Chia-I Wueb7db122016-03-24 09:11:06 +080051
Yiwei Zhang7cc36a52019-10-11 19:02:09 -070052 EXTENSION_CORE_1_0,
53 EXTENSION_CORE_1_1,
Chia-I Wueb7db122016-03-24 09:11:06 +080054 EXTENSION_COUNT,
55 EXTENSION_UNKNOWN,
56 };
57
58 const char* name;
59 Type type;
60 Extension extension;
61
62 PFN_vkVoidFunction proc;
Chia-I Wu36cc00a2016-04-13 16:52:06 +080063 PFN_vkVoidFunction checked_proc; // always nullptr for non-device hooks
Chia-I Wueb7db122016-03-24 09:11:06 +080064};
65
Chia-I Wucc5e2762016-03-24 13:01:16 +080066struct InstanceDriverTable {
67 // clang-format off
68 PFN_vkDestroyInstance DestroyInstance;
69 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
70 PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
Jesse Hall85bb0c52017-02-09 22:13:02 -080071 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
Chia-I Wucc5e2762016-03-24 13:01:16 +080072 PFN_vkCreateDevice CreateDevice;
73 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
74 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
75 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
76 PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
Adithya Srinivasan8dce9d72019-07-11 14:26:04 -070077 PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
Chris Forbes6aa30db2017-02-20 17:12:53 +130078 PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR;
Adithya Srinivasan8dce9d72019-07-11 14:26:04 -070079 PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
Chia-I Wucc5e2762016-03-24 13:01:16 +080080 // clang-format on
81};
82
83struct DeviceDriverTable {
84 // clang-format off
85 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
86 PFN_vkDestroyDevice DestroyDevice;
87 PFN_vkGetDeviceQueue GetDeviceQueue;
Yiwei Zhang899d1752019-09-23 16:05:35 -070088 PFN_vkQueueSubmit QueueSubmit;
Chia-I Wucc5e2762016-03-24 13:01:16 +080089 PFN_vkCreateImage CreateImage;
90 PFN_vkDestroyImage DestroyImage;
91 PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
Yiwei Zhang23143102019-04-10 18:24:05 -070092 PFN_vkBindImageMemory2 BindImageMemory2;
Adithya Srinivasan8dce9d72019-07-11 14:26:04 -070093 PFN_vkBindImageMemory2KHR BindImageMemory2KHR;
Daniel Kochf25f5bb2017-10-05 00:26:58 -040094 PFN_vkGetDeviceQueue2 GetDeviceQueue2;
Chia-I Wucc5e2762016-03-24 13:01:16 +080095 PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID;
Yiwei Zhang4bc489b2019-09-23 15:17:22 -070096 PFN_vkGetSwapchainGrallocUsage2ANDROID GetSwapchainGrallocUsage2ANDROID;
Chia-I Wucc5e2762016-03-24 13:01:16 +080097 PFN_vkAcquireImageANDROID AcquireImageANDROID;
98 PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID;
99 // clang-format on
100};
101
Chia-I Wueb7db122016-03-24 09:11:06 +0800102const ProcHook* GetProcHook(const char* name);
103ProcHook::Extension GetProcHookExtension(const char* name);
104
Chia-I Wucbe07ef2016-04-13 15:01:00 +0800105bool InitDriverTable(VkInstance instance,
106 PFN_vkGetInstanceProcAddr get_proc,
107 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions);
108bool InitDriverTable(VkDevice dev,
109 PFN_vkGetDeviceProcAddr get_proc,
110 const std::bitset<ProcHook::EXTENSION_COUNT>& extensions);
Chia-I Wucc5e2762016-03-24 13:01:16 +0800111
Chia-I Wueb7db122016-03-24 09:11:06 +0800112} // namespace driver
113} // namespace vulkan
114
115#endif // LIBVULKAN_DRIVER_TABLE_H