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 <bitset>
23 #include <vulkan/vulkan.h>
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_vkDestroySurfaceKHR DestroySurfaceKHR;
44     PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
45     PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
46     PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
47     PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
48     PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
49     // clang-format on
50 };
51 
52 struct DeviceDispatchTable {
53     // clang-format off
54     PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
55     PFN_vkDestroyDevice DestroyDevice;
56     PFN_vkGetDeviceQueue GetDeviceQueue;
57     PFN_vkQueueSubmit QueueSubmit;
58     PFN_vkQueueWaitIdle QueueWaitIdle;
59     PFN_vkDeviceWaitIdle DeviceWaitIdle;
60     PFN_vkAllocateMemory AllocateMemory;
61     PFN_vkFreeMemory FreeMemory;
62     PFN_vkMapMemory MapMemory;
63     PFN_vkUnmapMemory UnmapMemory;
64     PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
65     PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
66     PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
67     PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
68     PFN_vkBindBufferMemory BindBufferMemory;
69     PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
70     PFN_vkBindImageMemory BindImageMemory;
71     PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
72     PFN_vkQueueBindSparse QueueBindSparse;
73     PFN_vkCreateFence CreateFence;
74     PFN_vkDestroyFence DestroyFence;
75     PFN_vkResetFences ResetFences;
76     PFN_vkGetFenceStatus GetFenceStatus;
77     PFN_vkWaitForFences WaitForFences;
78     PFN_vkCreateSemaphore CreateSemaphore;
79     PFN_vkDestroySemaphore DestroySemaphore;
80     PFN_vkCreateEvent CreateEvent;
81     PFN_vkDestroyEvent DestroyEvent;
82     PFN_vkGetEventStatus GetEventStatus;
83     PFN_vkSetEvent SetEvent;
84     PFN_vkResetEvent ResetEvent;
85     PFN_vkCreateQueryPool CreateQueryPool;
86     PFN_vkDestroyQueryPool DestroyQueryPool;
87     PFN_vkGetQueryPoolResults GetQueryPoolResults;
88     PFN_vkCreateBuffer CreateBuffer;
89     PFN_vkDestroyBuffer DestroyBuffer;
90     PFN_vkCreateBufferView CreateBufferView;
91     PFN_vkDestroyBufferView DestroyBufferView;
92     PFN_vkCreateImage CreateImage;
93     PFN_vkDestroyImage DestroyImage;
94     PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
95     PFN_vkCreateImageView CreateImageView;
96     PFN_vkDestroyImageView DestroyImageView;
97     PFN_vkCreateShaderModule CreateShaderModule;
98     PFN_vkDestroyShaderModule DestroyShaderModule;
99     PFN_vkCreatePipelineCache CreatePipelineCache;
100     PFN_vkDestroyPipelineCache DestroyPipelineCache;
101     PFN_vkGetPipelineCacheData GetPipelineCacheData;
102     PFN_vkMergePipelineCaches MergePipelineCaches;
103     PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
104     PFN_vkCreateComputePipelines CreateComputePipelines;
105     PFN_vkDestroyPipeline DestroyPipeline;
106     PFN_vkCreatePipelineLayout CreatePipelineLayout;
107     PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
108     PFN_vkCreateSampler CreateSampler;
109     PFN_vkDestroySampler DestroySampler;
110     PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
111     PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
112     PFN_vkCreateDescriptorPool CreateDescriptorPool;
113     PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
114     PFN_vkResetDescriptorPool ResetDescriptorPool;
115     PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
116     PFN_vkFreeDescriptorSets FreeDescriptorSets;
117     PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
118     PFN_vkCreateFramebuffer CreateFramebuffer;
119     PFN_vkDestroyFramebuffer DestroyFramebuffer;
120     PFN_vkCreateRenderPass CreateRenderPass;
121     PFN_vkDestroyRenderPass DestroyRenderPass;
122     PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
123     PFN_vkCreateCommandPool CreateCommandPool;
124     PFN_vkDestroyCommandPool DestroyCommandPool;
125     PFN_vkResetCommandPool ResetCommandPool;
126     PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
127     PFN_vkFreeCommandBuffers FreeCommandBuffers;
128     PFN_vkBeginCommandBuffer BeginCommandBuffer;
129     PFN_vkEndCommandBuffer EndCommandBuffer;
130     PFN_vkResetCommandBuffer ResetCommandBuffer;
131     PFN_vkCmdBindPipeline CmdBindPipeline;
132     PFN_vkCmdSetViewport CmdSetViewport;
133     PFN_vkCmdSetScissor CmdSetScissor;
134     PFN_vkCmdSetLineWidth CmdSetLineWidth;
135     PFN_vkCmdSetDepthBias CmdSetDepthBias;
136     PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
137     PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
138     PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
139     PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
140     PFN_vkCmdSetStencilReference CmdSetStencilReference;
141     PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
142     PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
143     PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
144     PFN_vkCmdDraw CmdDraw;
145     PFN_vkCmdDrawIndexed CmdDrawIndexed;
146     PFN_vkCmdDrawIndirect CmdDrawIndirect;
147     PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
148     PFN_vkCmdDispatch CmdDispatch;
149     PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
150     PFN_vkCmdCopyBuffer CmdCopyBuffer;
151     PFN_vkCmdCopyImage CmdCopyImage;
152     PFN_vkCmdBlitImage CmdBlitImage;
153     PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
154     PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
155     PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
156     PFN_vkCmdFillBuffer CmdFillBuffer;
157     PFN_vkCmdClearColorImage CmdClearColorImage;
158     PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
159     PFN_vkCmdClearAttachments CmdClearAttachments;
160     PFN_vkCmdResolveImage CmdResolveImage;
161     PFN_vkCmdSetEvent CmdSetEvent;
162     PFN_vkCmdResetEvent CmdResetEvent;
163     PFN_vkCmdWaitEvents CmdWaitEvents;
164     PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
165     PFN_vkCmdBeginQuery CmdBeginQuery;
166     PFN_vkCmdEndQuery CmdEndQuery;
167     PFN_vkCmdResetQueryPool CmdResetQueryPool;
168     PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
169     PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
170     PFN_vkCmdPushConstants CmdPushConstants;
171     PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
172     PFN_vkCmdNextSubpass CmdNextSubpass;
173     PFN_vkCmdEndRenderPass CmdEndRenderPass;
174     PFN_vkCmdExecuteCommands CmdExecuteCommands;
175     PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
176     PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
177     PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
178     PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
179     PFN_vkQueuePresentKHR QueuePresentKHR;
180     // clang-format on
181 };
182 
183 bool InitDispatchTable(
184     VkInstance instance,
185     PFN_vkGetInstanceProcAddr get_proc,
186     const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions);
187 bool InitDispatchTable(
188     VkDevice dev,
189     PFN_vkGetDeviceProcAddr get_proc,
190     const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions);
191 
192 }  // namespace api
193 }  // namespace vulkan
194 
195 #endif  // LIBVULKAN_API_GEN_H
196