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