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 | |
| 22 | #include <vulkan/vulkan.h> |
| 23 | #include <vulkan/vk_android_native_buffer.h> |
| 24 | |
| 25 | namespace vulkan { |
| 26 | namespace driver { |
| 27 | |
| 28 | struct ProcHook { |
| 29 | enum Type { |
| 30 | GLOBAL, |
| 31 | INSTANCE, |
| 32 | DEVICE, |
| 33 | }; |
| 34 | enum Extension { |
| 35 | ANDROID_native_buffer, |
| 36 | EXT_debug_report, |
| 37 | KHR_android_surface, |
| 38 | KHR_surface, |
| 39 | KHR_swapchain, |
| 40 | |
| 41 | EXTENSION_CORE, // valid bit |
| 42 | EXTENSION_COUNT, |
| 43 | EXTENSION_UNKNOWN, |
| 44 | }; |
| 45 | |
| 46 | const char* name; |
| 47 | Type type; |
| 48 | Extension extension; |
| 49 | |
| 50 | PFN_vkVoidFunction proc; |
| 51 | PFN_vkVoidFunction disabled_proc; // nullptr for global hooks |
| 52 | PFN_vkVoidFunction checked_proc; // nullptr for global/instance hooks |
| 53 | }; |
| 54 | |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 55 | struct InstanceDriverTable { |
| 56 | // clang-format off |
| 57 | PFN_vkDestroyInstance DestroyInstance; |
| 58 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
| 59 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; |
| 60 | PFN_vkCreateDevice CreateDevice; |
Chia-I Wu | 4901db7 | 2016-03-24 16:38:58 +0800 | [diff] [blame^] | 61 | PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties; |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 62 | PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; |
| 63 | PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT; |
| 64 | PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT; |
| 65 | PFN_vkDebugReportMessageEXT DebugReportMessageEXT; |
| 66 | // clang-format on |
| 67 | }; |
| 68 | |
| 69 | struct DeviceDriverTable { |
| 70 | // clang-format off |
| 71 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; |
| 72 | PFN_vkDestroyDevice DestroyDevice; |
| 73 | PFN_vkGetDeviceQueue GetDeviceQueue; |
| 74 | PFN_vkCreateImage CreateImage; |
| 75 | PFN_vkDestroyImage DestroyImage; |
| 76 | PFN_vkAllocateCommandBuffers AllocateCommandBuffers; |
| 77 | PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID; |
| 78 | PFN_vkAcquireImageANDROID AcquireImageANDROID; |
| 79 | PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID; |
| 80 | // clang-format on |
| 81 | }; |
| 82 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 83 | const ProcHook* GetProcHook(const char* name); |
| 84 | ProcHook::Extension GetProcHookExtension(const char* name); |
| 85 | |
Chia-I Wu | cc5e276 | 2016-03-24 13:01:16 +0800 | [diff] [blame] | 86 | bool InitDriverTable(VkInstance instance, PFN_vkGetInstanceProcAddr get_proc); |
| 87 | bool InitDriverTable(VkDevice dev, PFN_vkGetDeviceProcAddr get_proc); |
| 88 | |
Chia-I Wu | eb7db12 | 2016-03-24 09:11:06 +0800 | [diff] [blame] | 89 | } // namespace driver |
| 90 | } // namespace vulkan |
| 91 | |
| 92 | #endif // LIBVULKAN_DRIVER_TABLE_H |