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     PFN_vkGetPhysicalDeviceToolProperties GetPhysicalDeviceToolProperties;
64     // clang-format on
65 };
66 
67 struct DeviceDispatchTable {
68     // clang-format off
69     PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
70     PFN_vkDestroyDevice DestroyDevice;
71     PFN_vkGetDeviceQueue GetDeviceQueue;
72     PFN_vkQueueSubmit QueueSubmit;
73     PFN_vkQueueWaitIdle QueueWaitIdle;
74     PFN_vkDeviceWaitIdle DeviceWaitIdle;
75     PFN_vkAllocateMemory AllocateMemory;
76     PFN_vkFreeMemory FreeMemory;
77     PFN_vkMapMemory MapMemory;
78     PFN_vkUnmapMemory UnmapMemory;
79     PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
80     PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
81     PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
82     PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
83     PFN_vkBindBufferMemory BindBufferMemory;
84     PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
85     PFN_vkBindImageMemory BindImageMemory;
86     PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
87     PFN_vkQueueBindSparse QueueBindSparse;
88     PFN_vkCreateFence CreateFence;
89     PFN_vkDestroyFence DestroyFence;
90     PFN_vkResetFences ResetFences;
91     PFN_vkGetFenceStatus GetFenceStatus;
92     PFN_vkWaitForFences WaitForFences;
93     PFN_vkCreateSemaphore CreateSemaphore;
94     PFN_vkDestroySemaphore DestroySemaphore;
95     PFN_vkCreateEvent CreateEvent;
96     PFN_vkDestroyEvent DestroyEvent;
97     PFN_vkGetEventStatus GetEventStatus;
98     PFN_vkSetEvent SetEvent;
99     PFN_vkResetEvent ResetEvent;
100     PFN_vkCreateQueryPool CreateQueryPool;
101     PFN_vkDestroyQueryPool DestroyQueryPool;
102     PFN_vkGetQueryPoolResults GetQueryPoolResults;
103     PFN_vkResetQueryPool ResetQueryPool;
104     PFN_vkCreateBuffer CreateBuffer;
105     PFN_vkDestroyBuffer DestroyBuffer;
106     PFN_vkCreateBufferView CreateBufferView;
107     PFN_vkDestroyBufferView DestroyBufferView;
108     PFN_vkCreateImage CreateImage;
109     PFN_vkDestroyImage DestroyImage;
110     PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
111     PFN_vkCreateImageView CreateImageView;
112     PFN_vkDestroyImageView DestroyImageView;
113     PFN_vkCreateShaderModule CreateShaderModule;
114     PFN_vkDestroyShaderModule DestroyShaderModule;
115     PFN_vkCreatePipelineCache CreatePipelineCache;
116     PFN_vkDestroyPipelineCache DestroyPipelineCache;
117     PFN_vkGetPipelineCacheData GetPipelineCacheData;
118     PFN_vkMergePipelineCaches MergePipelineCaches;
119     PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
120     PFN_vkCreateComputePipelines CreateComputePipelines;
121     PFN_vkDestroyPipeline DestroyPipeline;
122     PFN_vkCreatePipelineLayout CreatePipelineLayout;
123     PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
124     PFN_vkCreateSampler CreateSampler;
125     PFN_vkDestroySampler DestroySampler;
126     PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
127     PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
128     PFN_vkCreateDescriptorPool CreateDescriptorPool;
129     PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
130     PFN_vkResetDescriptorPool ResetDescriptorPool;
131     PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
132     PFN_vkFreeDescriptorSets FreeDescriptorSets;
133     PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
134     PFN_vkCreateFramebuffer CreateFramebuffer;
135     PFN_vkDestroyFramebuffer DestroyFramebuffer;
136     PFN_vkCreateRenderPass CreateRenderPass;
137     PFN_vkDestroyRenderPass DestroyRenderPass;
138     PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
139     PFN_vkCreateCommandPool CreateCommandPool;
140     PFN_vkDestroyCommandPool DestroyCommandPool;
141     PFN_vkResetCommandPool ResetCommandPool;
142     PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
143     PFN_vkFreeCommandBuffers FreeCommandBuffers;
144     PFN_vkBeginCommandBuffer BeginCommandBuffer;
145     PFN_vkEndCommandBuffer EndCommandBuffer;
146     PFN_vkResetCommandBuffer ResetCommandBuffer;
147     PFN_vkCmdBindPipeline CmdBindPipeline;
148     PFN_vkCmdSetViewport CmdSetViewport;
149     PFN_vkCmdSetScissor CmdSetScissor;
150     PFN_vkCmdSetLineWidth CmdSetLineWidth;
151     PFN_vkCmdSetDepthBias CmdSetDepthBias;
152     PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
153     PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
154     PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
155     PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
156     PFN_vkCmdSetStencilReference CmdSetStencilReference;
157     PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
158     PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
159     PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
160     PFN_vkCmdDraw CmdDraw;
161     PFN_vkCmdDrawIndexed CmdDrawIndexed;
162     PFN_vkCmdDrawIndirect CmdDrawIndirect;
163     PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
164     PFN_vkCmdDispatch CmdDispatch;
165     PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
166     PFN_vkCmdCopyBuffer CmdCopyBuffer;
167     PFN_vkCmdCopyImage CmdCopyImage;
168     PFN_vkCmdBlitImage CmdBlitImage;
169     PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
170     PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
171     PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
172     PFN_vkCmdFillBuffer CmdFillBuffer;
173     PFN_vkCmdClearColorImage CmdClearColorImage;
174     PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
175     PFN_vkCmdClearAttachments CmdClearAttachments;
176     PFN_vkCmdResolveImage CmdResolveImage;
177     PFN_vkCmdSetEvent CmdSetEvent;
178     PFN_vkCmdResetEvent CmdResetEvent;
179     PFN_vkCmdWaitEvents CmdWaitEvents;
180     PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
181     PFN_vkCmdBeginQuery CmdBeginQuery;
182     PFN_vkCmdEndQuery CmdEndQuery;
183     PFN_vkCmdResetQueryPool CmdResetQueryPool;
184     PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
185     PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
186     PFN_vkCmdPushConstants CmdPushConstants;
187     PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
188     PFN_vkCmdNextSubpass CmdNextSubpass;
189     PFN_vkCmdEndRenderPass CmdEndRenderPass;
190     PFN_vkCmdExecuteCommands CmdExecuteCommands;
191     PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
192     PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
193     PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
194     PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
195     PFN_vkQueuePresentKHR QueuePresentKHR;
196     PFN_vkTrimCommandPool TrimCommandPool;
197     PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures;
198     PFN_vkBindBufferMemory2 BindBufferMemory2;
199     PFN_vkBindImageMemory2 BindImageMemory2;
200     PFN_vkCmdSetDeviceMask CmdSetDeviceMask;
201     PFN_vkGetDeviceGroupPresentCapabilitiesKHR GetDeviceGroupPresentCapabilitiesKHR;
202     PFN_vkGetDeviceGroupSurfacePresentModesKHR GetDeviceGroupSurfacePresentModesKHR;
203     PFN_vkAcquireNextImage2KHR AcquireNextImage2KHR;
204     PFN_vkCmdDispatchBase CmdDispatchBase;
205     PFN_vkCreateDescriptorUpdateTemplate CreateDescriptorUpdateTemplate;
206     PFN_vkDestroyDescriptorUpdateTemplate DestroyDescriptorUpdateTemplate;
207     PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
208     PFN_vkGetBufferMemoryRequirements2 GetBufferMemoryRequirements2;
209     PFN_vkGetImageMemoryRequirements2 GetImageMemoryRequirements2;
210     PFN_vkGetImageSparseMemoryRequirements2 GetImageSparseMemoryRequirements2;
211     PFN_vkGetDeviceBufferMemoryRequirements GetDeviceBufferMemoryRequirements;
212     PFN_vkGetDeviceImageMemoryRequirements GetDeviceImageMemoryRequirements;
213     PFN_vkGetDeviceImageSparseMemoryRequirements GetDeviceImageSparseMemoryRequirements;
214     PFN_vkCreateSamplerYcbcrConversion CreateSamplerYcbcrConversion;
215     PFN_vkDestroySamplerYcbcrConversion DestroySamplerYcbcrConversion;
216     PFN_vkGetDeviceQueue2 GetDeviceQueue2;
217     PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport;
218     PFN_vkCreateRenderPass2 CreateRenderPass2;
219     PFN_vkCmdBeginRenderPass2 CmdBeginRenderPass2;
220     PFN_vkCmdNextSubpass2 CmdNextSubpass2;
221     PFN_vkCmdEndRenderPass2 CmdEndRenderPass2;
222     PFN_vkGetSemaphoreCounterValue GetSemaphoreCounterValue;
223     PFN_vkWaitSemaphores WaitSemaphores;
224     PFN_vkSignalSemaphore SignalSemaphore;
225     PFN_vkGetAndroidHardwareBufferPropertiesANDROID GetAndroidHardwareBufferPropertiesANDROID;
226     PFN_vkGetMemoryAndroidHardwareBufferANDROID GetMemoryAndroidHardwareBufferANDROID;
227     PFN_vkCmdDrawIndirectCount CmdDrawIndirectCount;
228     PFN_vkCmdDrawIndexedIndirectCount CmdDrawIndexedIndirectCount;
229     PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress;
230     PFN_vkGetBufferDeviceAddress GetBufferDeviceAddress;
231     PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress;
232     PFN_vkCmdSetCullMode CmdSetCullMode;
233     PFN_vkCmdSetFrontFace CmdSetFrontFace;
234     PFN_vkCmdSetPrimitiveTopology CmdSetPrimitiveTopology;
235     PFN_vkCmdSetViewportWithCount CmdSetViewportWithCount;
236     PFN_vkCmdSetScissorWithCount CmdSetScissorWithCount;
237     PFN_vkCmdBindVertexBuffers2 CmdBindVertexBuffers2;
238     PFN_vkCmdSetDepthTestEnable CmdSetDepthTestEnable;
239     PFN_vkCmdSetDepthWriteEnable CmdSetDepthWriteEnable;
240     PFN_vkCmdSetDepthCompareOp CmdSetDepthCompareOp;
241     PFN_vkCmdSetDepthBoundsTestEnable CmdSetDepthBoundsTestEnable;
242     PFN_vkCmdSetStencilTestEnable CmdSetStencilTestEnable;
243     PFN_vkCmdSetStencilOp CmdSetStencilOp;
244     PFN_vkCmdSetRasterizerDiscardEnable CmdSetRasterizerDiscardEnable;
245     PFN_vkCmdSetDepthBiasEnable CmdSetDepthBiasEnable;
246     PFN_vkCmdSetPrimitiveRestartEnable CmdSetPrimitiveRestartEnable;
247     PFN_vkCreatePrivateDataSlot CreatePrivateDataSlot;
248     PFN_vkDestroyPrivateDataSlot DestroyPrivateDataSlot;
249     PFN_vkSetPrivateData SetPrivateData;
250     PFN_vkGetPrivateData GetPrivateData;
251     PFN_vkCmdCopyBuffer2 CmdCopyBuffer2;
252     PFN_vkCmdCopyImage2 CmdCopyImage2;
253     PFN_vkCmdBlitImage2 CmdBlitImage2;
254     PFN_vkCmdCopyBufferToImage2 CmdCopyBufferToImage2;
255     PFN_vkCmdCopyImageToBuffer2 CmdCopyImageToBuffer2;
256     PFN_vkCmdResolveImage2 CmdResolveImage2;
257     PFN_vkCmdSetEvent2 CmdSetEvent2;
258     PFN_vkCmdResetEvent2 CmdResetEvent2;
259     PFN_vkCmdWaitEvents2 CmdWaitEvents2;
260     PFN_vkCmdPipelineBarrier2 CmdPipelineBarrier2;
261     PFN_vkQueueSubmit2 QueueSubmit2;
262     PFN_vkCmdWriteTimestamp2 CmdWriteTimestamp2;
263     PFN_vkCmdBeginRendering CmdBeginRendering;
264     PFN_vkCmdEndRendering CmdEndRendering;
265     // clang-format on
266 };
267 
268 bool InitDispatchTable(
269     VkInstance instance,
270     PFN_vkGetInstanceProcAddr get_proc,
271     const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions);
272 bool InitDispatchTable(
273     VkDevice dev,
274     PFN_vkGetDeviceProcAddr get_proc,
275     const std::bitset<driver::ProcHook::EXTENSION_COUNT>& extensions);
276 
277 }  // namespace api
278 }  // namespace vulkan
279 
280 #endif  // LIBVULKAN_API_GEN_H
281