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_API_GEN_H 20 #define LIBVULKAN_API_GEN_H 21 22 #include <vulkan/vulkan.h> 23 #include <bitset> 24 #include "driver_gen.h" 25 26 namespace vulkan { 27 namespace api { 28 29 struct InstanceDispatchTable { 30 // clang-format off 31 PFN_vkDestroyInstance DestroyInstance; 32 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; 33 PFN_vkGetInstanceProcAddr GetInstanceProcAddr; 34 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties; 35 PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties; 36 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties; 37 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; 38 PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties; 39 PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties; 40 PFN_vkCreateDevice CreateDevice; 41 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties; 42 PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties; 43 PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups; 44 PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2; 45 PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; 46 PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2; 47 PFN_vkGetPhysicalDeviceImageFormatProperties2 GetPhysicalDeviceImageFormatProperties2; 48 PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2; 49 PFN_vkGetPhysicalDeviceMemoryProperties2 GetPhysicalDeviceMemoryProperties2; 50 PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 GetPhysicalDeviceSparseImageFormatProperties2; 51 PFN_vkGetPhysicalDeviceExternalBufferProperties GetPhysicalDeviceExternalBufferProperties; 52 PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties; 53 PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties; 54 PFN_vkDestroySurfaceKHR DestroySurfaceKHR; 55 PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR; 56 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR; 57 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR; 58 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR; 59 PFN_vkGetPhysicalDevicePresentRectanglesKHR GetPhysicalDevicePresentRectanglesKHR; 60 PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR; 61 // clang-format on 62 }; 63 64 struct DeviceDispatchTable { 65 // clang-format off 66 PFN_vkGetDeviceProcAddr GetDeviceProcAddr; 67 PFN_vkDestroyDevice DestroyDevice; 68 PFN_vkGetDeviceQueue GetDeviceQueue; 69 PFN_vkQueueSubmit QueueSubmit; 70 PFN_vkQueueWaitIdle QueueWaitIdle; 71 PFN_vkDeviceWaitIdle DeviceWaitIdle; 72 PFN_vkAllocateMemory AllocateMemory; 73 PFN_vkFreeMemory FreeMemory; 74 PFN_vkMapMemory MapMemory; 75 PFN_vkUnmapMemory UnmapMemory; 76 PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; 77 PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; 78 PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment; 79 PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements; 80 PFN_vkBindBufferMemory BindBufferMemory; 81 PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements; 82 PFN_vkBindImageMemory BindImageMemory; 83 PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements; 84 PFN_vkQueueBindSparse QueueBindSparse; 85 PFN_vkCreateFence CreateFence; 86 PFN_vkDestroyFence DestroyFence; 87 PFN_vkResetFences ResetFences; 88 PFN_vkGetFenceStatus GetFenceStatus; 89 PFN_vkWaitForFences WaitForFences; 90 PFN_vkCreateSemaphore CreateSemaphore; 91 PFN_vkDestroySemaphore DestroySemaphore; 92 PFN_vkCreateEvent CreateEvent; 93 PFN_vkDestroyEvent DestroyEvent; 94 PFN_vkGetEventStatus GetEventStatus; 95 PFN_vkSetEvent SetEvent; 96 PFN_vkResetEvent ResetEvent; 97 PFN_vkCreateQueryPool CreateQueryPool; 98 PFN_vkDestroyQueryPool DestroyQueryPool; 99 PFN_vkGetQueryPoolResults GetQueryPoolResults; 100 PFN_vkCreateBuffer CreateBuffer; 101 PFN_vkDestroyBuffer DestroyBuffer; 102 PFN_vkCreateBufferView CreateBufferView; 103 PFN_vkDestroyBufferView DestroyBufferView; 104 PFN_vkCreateImage CreateImage; 105 PFN_vkDestroyImage DestroyImage; 106 PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout; 107 PFN_vkCreateImageView CreateImageView; 108 PFN_vkDestroyImageView DestroyImageView; 109 PFN_vkCreateShaderModule CreateShaderModule; 110 PFN_vkDestroyShaderModule DestroyShaderModule; 111 PFN_vkCreatePipelineCache CreatePipelineCache; 112 PFN_vkDestroyPipelineCache DestroyPipelineCache; 113 PFN_vkGetPipelineCacheData GetPipelineCacheData; 114 PFN_vkMergePipelineCaches MergePipelineCaches; 115 PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines; 116 PFN_vkCreateComputePipelines CreateComputePipelines; 117 PFN_vkDestroyPipeline DestroyPipeline; 118 PFN_vkCreatePipelineLayout CreatePipelineLayout; 119 PFN_vkDestroyPipelineLayout DestroyPipelineLayout; 120 PFN_vkCreateSampler CreateSampler; 121 PFN_vkDestroySampler DestroySampler; 122 PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; 123 PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout; 124 PFN_vkCreateDescriptorPool CreateDescriptorPool; 125 PFN_vkDestroyDescriptorPool DestroyDescriptorPool; 126 PFN_vkResetDescriptorPool ResetDescriptorPool; 127 PFN_vkAllocateDescriptorSets AllocateDescriptorSets; 128 PFN_vkFreeDescriptorSets FreeDescriptorSets; 129 PFN_vkUpdateDescriptorSets UpdateDescriptorSets; 130 PFN_vkCreateFramebuffer CreateFramebuffer; 131 PFN_vkDestroyFramebuffer DestroyFramebuffer; 132 PFN_vkCreateRenderPass CreateRenderPass; 133 PFN_vkDestroyRenderPass DestroyRenderPass; 134 PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; 135 PFN_vkCreateCommandPool CreateCommandPool; 136 PFN_vkDestroyCommandPool DestroyCommandPool; 137 PFN_vkResetCommandPool ResetCommandPool; 138 PFN_vkAllocateCommandBuffers AllocateCommandBuffers; 139 PFN_vkFreeCommandBuffers FreeCommandBuffers; 140 PFN_vkBeginCommandBuffer BeginCommandBuffer; 141 PFN_vkEndCommandBuffer EndCommandBuffer; 142 PFN_vkResetCommandBuffer ResetCommandBuffer; 143 PFN_vkCmdBindPipeline CmdBindPipeline; 144 PFN_vkCmdSetViewport CmdSetViewport; 145 PFN_vkCmdSetScissor CmdSetScissor; 146 PFN_vkCmdSetLineWidth CmdSetLineWidth; 147 PFN_vkCmdSetDepthBias CmdSetDepthBias; 148 PFN_vkCmdSetBlendConstants CmdSetBlendConstants; 149 PFN_vkCmdSetDepthBounds CmdSetDepthBounds; 150 PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask; 151 PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask; 152 PFN_vkCmdSetStencilReference CmdSetStencilReference; 153 PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; 154 PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; 155 PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; 156 PFN_vkCmdDraw CmdDraw; 157 PFN_vkCmdDrawIndexed CmdDrawIndexed; 158 PFN_vkCmdDrawIndirect CmdDrawIndirect; 159 PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; 160 PFN_vkCmdDispatch CmdDispatch; 161 PFN_vkCmdDispatchIndirect CmdDispatchIndirect; 162 PFN_vkCmdCopyBuffer CmdCopyBuffer; 163 PFN_vkCmdCopyImage CmdCopyImage; 164 PFN_vkCmdBlitImage CmdBlitImage; 165 PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; 166 PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; 167 PFN_vkCmdUpdateBuffer CmdUpdateBuffer; 168 PFN_vkCmdFillBuffer CmdFillBuffer; 169 PFN_vkCmdClearColorImage CmdClearColorImage; 170 PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage; 171 PFN_vkCmdClearAttachments CmdClearAttachments; 172 PFN_vkCmdResolveImage CmdResolveImage; 173 PFN_vkCmdSetEvent CmdSetEvent; 174 PFN_vkCmdResetEvent CmdResetEvent; 175 PFN_vkCmdWaitEvents CmdWaitEvents; 176 PFN_vkCmdPipelineBarrier CmdPipelineBarrier; 177 PFN_vkCmdBeginQuery CmdBeginQuery; 178 PFN_vkCmdEndQuery CmdEndQuery; 179 PFN_vkCmdResetQueryPool CmdResetQueryPool; 180 PFN_vkCmdWriteTimestamp CmdWriteTimestamp; 181 PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; 182 PFN_vkCmdPushConstants CmdPushConstants; 183 PFN_vkCmdBeginRenderPass CmdBeginRenderPass; 184 PFN_vkCmdNextSubpass CmdNextSubpass; 185 PFN_vkCmdEndRenderPass CmdEndRenderPass; 186 PFN_vkCmdExecuteCommands CmdExecuteCommands; 187 PFN_vkBindBufferMemory2 BindBufferMemory2; 188 PFN_vkBindImageMemory2 BindImageMemory2; 189 PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures; 190 PFN_vkCmdSetDeviceMask CmdSetDeviceMask; 191 PFN_vkCmdDispatchBase CmdDispatchBase; 192 PFN_vkGetImageMemoryRequirements2 GetImageMemoryRequirements2; 193 PFN_vkGetBufferMemoryRequirements2 GetBufferMemoryRequirements2; 194 PFN_vkGetImageSparseMemoryRequirements2 GetImageSparseMemoryRequirements2; 195 PFN_vkTrimCommandPool TrimCommandPool; 196 PFN_vkGetDeviceQueue2 GetDeviceQueue2; 197 PFN_vkCreateSamplerYcbcrConversion CreateSamplerYcbcrConversion; 198 PFN_vkDestroySamplerYcbcrConversion DestroySamplerYcbcrConversion; 199 PFN_vkCreateDescriptorUpdateTemplate CreateDescriptorUpdateTemplate; 200 PFN_vkDestroyDescriptorUpdateTemplate DestroyDescriptorUpdateTemplate; 201 PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate; 202 PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport; 203 PFN_vkCreateSwapchainKHR CreateSwapchainKHR; 204 PFN_vkDestroySwapchainKHR DestroySwapchainKHR; 205 PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR; 206 PFN_vkAcquireNextImageKHR AcquireNextImageKHR; 207 PFN_vkQueuePresentKHR QueuePresentKHR; 208 PFN_vkGetDeviceGroupPresentCapabilitiesKHR GetDeviceGroupPresentCapabilitiesKHR; 209 PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR; 210 PFN_vkAcquireNextImage2KHR AcquireNextImage2KHR; 211 PFN_vkGetAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferPropertiesANDROID; 212 PFN_vkGetMemoryAndroidHardwareBufferANDROID GetMemoryAndroidHardwareBufferANDROID; 213 // clang-format on 214 }; 215 216 bool InitDispatchTable( 217 VkInstance instance, 218 PFN_vkGetInstanceProcAddr get_proc, 219 const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions); 220 bool InitDispatchTable( 221 VkDevice dev, 222 PFN_vkGetDeviceProcAddr get_proc, 223 const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions); 224 225 } // namespace api 226 } // namespace vulkan 227 228 #endif // LIBVULKAN_API_GEN_H 229