blob: 60da7493f6f1501e7b8ef68b5dcc01272f99d10c [file] [log] [blame]
Jesse Hall1f91d392015-12-11 16:28:44 -08001/*
2 * Copyright 2015 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#include <log/log.h>
18#include <algorithm>
19#include "loader.h"
20
21#define UNLIKELY(expr) __builtin_expect((expr), 0)
22
23using namespace vulkan;
24
25namespace {
26
27struct NameProc {
28 const char* name;
29 PFN_vkVoidFunction proc;
30};
31
32PFN_vkVoidFunction Lookup(const char* name,
33 const NameProc* begin,
34 const NameProc* end) {
35 const auto& entry = std::lower_bound(
36 begin, end, name,
37 [](const NameProc& e, const char* n) { return strcmp(e.name, n) < 0; });
38 if (entry == end || strcmp(entry->name, name) != 0)
39 return nullptr;
40 return entry->proc;
41}
42
43template <size_t N>
44PFN_vkVoidFunction Lookup(const char* name, const NameProc (&procs)[N]) {
45 return Lookup(name, procs, procs + N);
46}
47
48const NameProc kLoaderExportProcs[] = {
49 // clang-format off
50 {"vkAcquireNextImageKHR", reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR)},
51 {"vkAllocateCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(vkAllocateCommandBuffers)},
52 {"vkAllocateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkAllocateDescriptorSets)},
53 {"vkAllocateMemory", reinterpret_cast<PFN_vkVoidFunction>(vkAllocateMemory)},
54 {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkBeginCommandBuffer)},
55 {"vkBindBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(vkBindBufferMemory)},
56 {"vkBindImageMemory", reinterpret_cast<PFN_vkVoidFunction>(vkBindImageMemory)},
57 {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginQuery)},
58 {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginRenderPass)},
59 {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDescriptorSets)},
60 {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindIndexBuffer)},
61 {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindPipeline)},
62 {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindVertexBuffers)},
63 {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBlitImage)},
64 {"vkCmdClearAttachments", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearAttachments)},
65 {"vkCmdClearColorImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearColorImage)},
66 {"vkCmdClearDepthStencilImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearDepthStencilImage)},
67 {"vkCmdCopyBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyBuffer)},
68 {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyBufferToImage)},
69 {"vkCmdCopyImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyImage)},
70 {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyImageToBuffer)},
71 {"vkCmdCopyQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyQueryPoolResults)},
72 {"vkCmdDispatch", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDispatch)},
73 {"vkCmdDispatchIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDispatchIndirect)},
74 {"vkCmdDraw", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDraw)},
75 {"vkCmdDrawIndexed", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndexed)},
76 {"vkCmdDrawIndexedIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndexedIndirect)},
77 {"vkCmdDrawIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndirect)},
78 {"vkCmdEndQuery", reinterpret_cast<PFN_vkVoidFunction>(vkCmdEndQuery)},
79 {"vkCmdEndRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdEndRenderPass)},
80 {"vkCmdExecuteCommands", reinterpret_cast<PFN_vkVoidFunction>(vkCmdExecuteCommands)},
81 {"vkCmdFillBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdFillBuffer)},
82 {"vkCmdNextSubpass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdNextSubpass)},
83 {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(vkCmdPipelineBarrier)},
84 {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(vkCmdPushConstants)},
85 {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetEvent)},
86 {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetQueryPool)},
87 {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResolveImage)},
88 {"vkCmdSetBlendConstants", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetBlendConstants)},
89 {"vkCmdSetDepthBias", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetDepthBias)},
90 {"vkCmdSetDepthBounds", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetDepthBounds)},
91 {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetEvent)},
92 {"vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetLineWidth)},
93 {"vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetScissor)},
94 {"vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilCompareMask)},
95 {"vkCmdSetStencilReference", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilReference)},
96 {"vkCmdSetStencilWriteMask", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilWriteMask)},
97 {"vkCmdSetViewport", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetViewport)},
98 {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdUpdateBuffer)},
99 {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWaitEvents)},
100 {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWriteTimestamp)},
101 {"vkCreateAndroidSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(vkCreateAndroidSurfaceKHR)},
102 {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBuffer)},
103 {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBufferView)},
104 {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateCommandPool)},
105 {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(vkCreateComputePipelines)},
106 {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorPool)},
107 {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorSetLayout)},
108 {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDevice)},
109 {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCreateEvent)},
110 {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFence)},
111 {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFramebuffer)},
112 {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(vkCreateGraphicsPipelines)},
113 {"vkCreateImage", reinterpret_cast<PFN_vkVoidFunction>(vkCreateImage)},
114 {"vkCreateImageView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateImageView)},
115 {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(vkCreateInstance)},
116 {"vkCreatePipelineCache", reinterpret_cast<PFN_vkVoidFunction>(vkCreatePipelineCache)},
117 {"vkCreatePipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(vkCreatePipelineLayout)},
118 {"vkCreateQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateQueryPool)},
119 {"vkCreateRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCreateRenderPass)},
120 {"vkCreateSampler", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSampler)},
121 {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSemaphore)},
122 {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkCreateShaderModule)},
123 {"vkCreateSwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR)},
124 {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBuffer)},
125 {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBufferView)},
126 {"vkDestroyCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyCommandPool)},
127 {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorPool)},
128 {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorSetLayout)},
129 {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDevice)},
130 {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyEvent)},
131 {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFence)},
132 {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFramebuffer)},
133 {"vkDestroyImage", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyImage)},
134 {"vkDestroyImageView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyImageView)},
135 {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyInstance)},
136 {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipeline)},
137 {"vkDestroyPipelineCache", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipelineCache)},
138 {"vkDestroyPipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipelineLayout)},
139 {"vkDestroyQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyQueryPool)},
140 {"vkDestroyRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyRenderPass)},
141 {"vkDestroySampler", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySampler)},
142 {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySemaphore)},
143 {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyShaderModule)},
144 {"vkDestroySurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySurfaceKHR)},
145 {"vkDestroySwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR)},
146 {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkDeviceWaitIdle)},
147 {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkEndCommandBuffer)},
148 {"vkEnumerateDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateDeviceExtensionProperties)},
149 {"vkEnumerateDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateDeviceLayerProperties)},
150 {"vkEnumerateInstanceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateInstanceExtensionProperties)},
151 {"vkEnumerateInstanceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateInstanceLayerProperties)},
152 {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(vkEnumeratePhysicalDevices)},
153 {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkFlushMappedMemoryRanges)},
154 {"vkFreeCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(vkFreeCommandBuffers)},
155 {"vkFreeDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkFreeDescriptorSets)},
156 {"vkFreeMemory", reinterpret_cast<PFN_vkVoidFunction>(vkFreeMemory)},
157 {"vkGetBufferMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetBufferMemoryRequirements)},
158 {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceMemoryCommitment)},
159 {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceProcAddr)},
160 {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceQueue)},
161 {"vkGetEventStatus", reinterpret_cast<PFN_vkVoidFunction>(vkGetEventStatus)},
162 {"vkGetFenceStatus", reinterpret_cast<PFN_vkVoidFunction>(vkGetFenceStatus)},
163 {"vkGetImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageMemoryRequirements)},
164 {"vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageSparseMemoryRequirements)},
165 {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageSubresourceLayout)},
166 {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(vkGetInstanceProcAddr)},
167 {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFeatures)},
168 {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFormatProperties)},
169 {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceImageFormatProperties)},
170 {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceMemoryProperties)},
171 {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceProperties)},
172 {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueFamilyProperties)},
173 {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSparseImageFormatProperties)},
174 {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)},
175 {"vkGetPhysicalDeviceSurfaceFormatsKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceFormatsKHR)},
176 {"vkGetPhysicalDeviceSurfacePresentModesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfacePresentModesKHR)},
177 {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceSupportKHR)},
178 {"vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(vkGetPipelineCacheData)},
179 {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(vkGetQueryPoolResults)},
180 {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(vkGetRenderAreaGranularity)},
181 {"vkGetSwapchainImagesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR)},
182 {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkInvalidateMappedMemoryRanges)},
183 {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(vkMapMemory)},
184 {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(vkMergePipelineCaches)},
185 {"vkQueueBindSparse", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparse)},
186 {"vkQueuePresentKHR", reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR)},
187 {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(vkQueueSubmit)},
188 {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkQueueWaitIdle)},
189 {"vkResetCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkResetCommandBuffer)},
190 {"vkResetCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkResetCommandPool)},
191 {"vkResetDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkResetDescriptorPool)},
192 {"vkResetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkResetEvent)},
193 {"vkResetFences", reinterpret_cast<PFN_vkVoidFunction>(vkResetFences)},
194 {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkSetEvent)},
195 {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(vkUnmapMemory)},
196 {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkUpdateDescriptorSets)},
197 {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(vkWaitForFences)},
198 // clang-format on
199};
200
201const NameProc kLoaderGlobalProcs[] = {
202 // clang-format off
203 {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateInstance>(CreateInstance_Top))},
204 {"vkEnumerateInstanceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateInstanceExtensionProperties>(EnumerateInstanceExtensionProperties_Top))},
205 {"vkEnumerateInstanceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateInstanceLayerProperties>(EnumerateInstanceLayerProperties_Top))},
206 // clang-format on
207};
208
209const NameProc kLoaderTopProcs[] = {
210 // clang-format off
211 {"vkAllocateCommandBuffers", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkAllocateCommandBuffers>(AllocateCommandBuffers_Top))},
212 {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateInstance>(CreateInstance_Top))},
213 {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDevice>(DestroyDevice_Top))},
214 {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyInstance>(DestroyInstance_Top))},
215 {"vkEnumerateInstanceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateInstanceExtensionProperties>(EnumerateInstanceExtensionProperties_Top))},
216 {"vkEnumerateInstanceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateInstanceLayerProperties>(EnumerateInstanceLayerProperties_Top))},
217 {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceProcAddr>(GetDeviceProcAddr_Top))},
218 {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceQueue>(GetDeviceQueue_Top))},
219 {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetInstanceProcAddr>(GetInstanceProcAddr_Top))},
220 // clang-format on
221};
222
223const NameProc kLoaderBottomProcs[] = {
224 // clang-format off
225 {"vkAcquireNextImageKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkAcquireNextImageKHR>(AcquireNextImageKHR_Bottom))},
226 {"vkCreateAndroidSurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateAndroidSurfaceKHR>(CreateAndroidSurfaceKHR_Bottom))},
Jesse Hall715b86a2016-01-16 16:34:29 -0800227 {"vkCreateDebugReportCallbackEXT", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDebugReportCallbackEXT>(CreateDebugReportCallbackEXT_Bottom))},
Jesse Hall1f91d392015-12-11 16:28:44 -0800228 {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDevice>(CreateDevice_Bottom))},
229 {"vkCreateInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateInstance>(CreateInstance_Bottom))},
230 {"vkCreateSwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateSwapchainKHR>(CreateSwapchainKHR_Bottom))},
Jesse Hall715b86a2016-01-16 16:34:29 -0800231 {"vkDebugReportMessageEXT", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDebugReportMessageEXT>(DebugReportMessageEXT_Bottom))},
232 {"vkDestroyDebugReportCallbackEXT", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDebugReportCallbackEXT>(DestroyDebugReportCallbackEXT_Bottom))},
Jesse Hall1f91d392015-12-11 16:28:44 -0800233 {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyInstance>(DestroyInstance_Bottom))},
234 {"vkDestroySurfaceKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroySurfaceKHR>(DestroySurfaceKHR_Bottom))},
235 {"vkDestroySwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroySwapchainKHR>(DestroySwapchainKHR_Bottom))},
236 {"vkEnumerateDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateDeviceExtensionProperties>(EnumerateDeviceExtensionProperties_Bottom))},
237 {"vkEnumerateDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateDeviceLayerProperties>(EnumerateDeviceLayerProperties_Bottom))},
238 {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumeratePhysicalDevices>(EnumeratePhysicalDevices_Bottom))},
239 {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceProcAddr>(GetDeviceProcAddr_Bottom))},
240 {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetInstanceProcAddr>(GetInstanceProcAddr_Bottom))},
241 {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceFeatures>(GetPhysicalDeviceFeatures_Bottom))},
242 {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceFormatProperties>(GetPhysicalDeviceFormatProperties_Bottom))},
243 {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(GetPhysicalDeviceImageFormatProperties_Bottom))},
244 {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(GetPhysicalDeviceMemoryProperties_Bottom))},
245 {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceProperties>(GetPhysicalDeviceProperties_Bottom))},
246 {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(GetPhysicalDeviceQueueFamilyProperties_Bottom))},
247 {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(GetPhysicalDeviceSparseImageFormatProperties_Bottom))},
248 {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>(GetPhysicalDeviceSurfaceCapabilitiesKHR_Bottom))},
249 {"vkGetPhysicalDeviceSurfaceFormatsKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>(GetPhysicalDeviceSurfaceFormatsKHR_Bottom))},
250 {"vkGetPhysicalDeviceSurfacePresentModesKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR>(GetPhysicalDeviceSurfacePresentModesKHR_Bottom))},
251 {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(GetPhysicalDeviceSurfaceSupportKHR_Bottom))},
252 {"vkGetSwapchainImagesKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetSwapchainImagesKHR>(GetSwapchainImagesKHR_Bottom))},
253 {"vkQueuePresentKHR", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueuePresentKHR>(QueuePresentKHR_Bottom))},
254 // clang-format on
255};
256
257struct NameOffset {
258 const char* name;
259 size_t offset;
260};
261
262ssize_t Lookup(const char* name,
263 const NameOffset* begin,
264 const NameOffset* end) {
265 const auto& entry = std::lower_bound(
266 begin, end, name, [](const NameOffset& e, const char* n) {
267 return strcmp(e.name, n) < 0;
268 });
269 if (entry == end || strcmp(entry->name, name) != 0)
270 return -1;
271 return static_cast<ssize_t>(entry->offset);
272}
273
274template <size_t N, class Table>
275PFN_vkVoidFunction Lookup(const char* name,
276 const NameOffset (&offsets)[N],
277 const Table& table) {
278 ssize_t offset = Lookup(name, offsets, offsets + N);
279 if (offset < 0)
280 return nullptr;
281 uintptr_t base = reinterpret_cast<uintptr_t>(&table);
282 return *reinterpret_cast<PFN_vkVoidFunction*>(base +
283 static_cast<size_t>(offset));
284}
285
286const NameOffset kInstanceDispatchOffsets[] = {
287 // clang-format off
288 {"vkCreateAndroidSurfaceKHR", offsetof(InstanceDispatchTable, CreateAndroidSurfaceKHR)},
Jesse Hall715b86a2016-01-16 16:34:29 -0800289 {"vkCreateDebugReportCallbackEXT", offsetof(InstanceDispatchTable, CreateDebugReportCallbackEXT)},
Jesse Hall1f91d392015-12-11 16:28:44 -0800290 {"vkCreateDevice", offsetof(InstanceDispatchTable, CreateDevice)},
Jesse Hall715b86a2016-01-16 16:34:29 -0800291 {"vkDebugReportMessageEXT", offsetof(InstanceDispatchTable, DebugReportMessageEXT)},
292 {"vkDestroyDebugReportCallbackEXT", offsetof(InstanceDispatchTable, DestroyDebugReportCallbackEXT)},
Jesse Hall1f91d392015-12-11 16:28:44 -0800293 {"vkDestroyInstance", offsetof(InstanceDispatchTable, DestroyInstance)},
294 {"vkDestroySurfaceKHR", offsetof(InstanceDispatchTable, DestroySurfaceKHR)},
295 {"vkEnumerateDeviceExtensionProperties", offsetof(InstanceDispatchTable, EnumerateDeviceExtensionProperties)},
296 {"vkEnumerateDeviceLayerProperties", offsetof(InstanceDispatchTable, EnumerateDeviceLayerProperties)},
297 {"vkEnumeratePhysicalDevices", offsetof(InstanceDispatchTable, EnumeratePhysicalDevices)},
298 {"vkGetPhysicalDeviceFeatures", offsetof(InstanceDispatchTable, GetPhysicalDeviceFeatures)},
299 {"vkGetPhysicalDeviceFormatProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceFormatProperties)},
300 {"vkGetPhysicalDeviceImageFormatProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceImageFormatProperties)},
301 {"vkGetPhysicalDeviceMemoryProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceMemoryProperties)},
302 {"vkGetPhysicalDeviceProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceProperties)},
303 {"vkGetPhysicalDeviceQueueFamilyProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceQueueFamilyProperties)},
304 {"vkGetPhysicalDeviceSparseImageFormatProperties", offsetof(InstanceDispatchTable, GetPhysicalDeviceSparseImageFormatProperties)},
305 {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", offsetof(InstanceDispatchTable, GetPhysicalDeviceSurfaceCapabilitiesKHR)},
306 {"vkGetPhysicalDeviceSurfaceFormatsKHR", offsetof(InstanceDispatchTable, GetPhysicalDeviceSurfaceFormatsKHR)},
307 {"vkGetPhysicalDeviceSurfacePresentModesKHR", offsetof(InstanceDispatchTable, GetPhysicalDeviceSurfacePresentModesKHR)},
308 {"vkGetPhysicalDeviceSurfaceSupportKHR", offsetof(InstanceDispatchTable, GetPhysicalDeviceSurfaceSupportKHR)},
309 // clang-format on
310};
311
312const NameOffset kDeviceDispatchOffsets[] = {
313 // clang-format off
314 {"vkAcquireNextImageKHR", offsetof(DeviceDispatchTable, AcquireNextImageKHR)},
315 {"vkAllocateCommandBuffers", offsetof(DeviceDispatchTable, AllocateCommandBuffers)},
316 {"vkAllocateDescriptorSets", offsetof(DeviceDispatchTable, AllocateDescriptorSets)},
317 {"vkAllocateMemory", offsetof(DeviceDispatchTable, AllocateMemory)},
318 {"vkBeginCommandBuffer", offsetof(DeviceDispatchTable, BeginCommandBuffer)},
319 {"vkBindBufferMemory", offsetof(DeviceDispatchTable, BindBufferMemory)},
320 {"vkBindImageMemory", offsetof(DeviceDispatchTable, BindImageMemory)},
321 {"vkCmdBeginQuery", offsetof(DeviceDispatchTable, CmdBeginQuery)},
322 {"vkCmdBeginRenderPass", offsetof(DeviceDispatchTable, CmdBeginRenderPass)},
323 {"vkCmdBindDescriptorSets", offsetof(DeviceDispatchTable, CmdBindDescriptorSets)},
324 {"vkCmdBindIndexBuffer", offsetof(DeviceDispatchTable, CmdBindIndexBuffer)},
325 {"vkCmdBindPipeline", offsetof(DeviceDispatchTable, CmdBindPipeline)},
326 {"vkCmdBindVertexBuffers", offsetof(DeviceDispatchTable, CmdBindVertexBuffers)},
327 {"vkCmdBlitImage", offsetof(DeviceDispatchTable, CmdBlitImage)},
328 {"vkCmdClearAttachments", offsetof(DeviceDispatchTable, CmdClearAttachments)},
329 {"vkCmdClearColorImage", offsetof(DeviceDispatchTable, CmdClearColorImage)},
330 {"vkCmdClearDepthStencilImage", offsetof(DeviceDispatchTable, CmdClearDepthStencilImage)},
331 {"vkCmdCopyBuffer", offsetof(DeviceDispatchTable, CmdCopyBuffer)},
332 {"vkCmdCopyBufferToImage", offsetof(DeviceDispatchTable, CmdCopyBufferToImage)},
333 {"vkCmdCopyImage", offsetof(DeviceDispatchTable, CmdCopyImage)},
334 {"vkCmdCopyImageToBuffer", offsetof(DeviceDispatchTable, CmdCopyImageToBuffer)},
335 {"vkCmdCopyQueryPoolResults", offsetof(DeviceDispatchTable, CmdCopyQueryPoolResults)},
336 {"vkCmdDispatch", offsetof(DeviceDispatchTable, CmdDispatch)},
337 {"vkCmdDispatchIndirect", offsetof(DeviceDispatchTable, CmdDispatchIndirect)},
338 {"vkCmdDraw", offsetof(DeviceDispatchTable, CmdDraw)},
339 {"vkCmdDrawIndexed", offsetof(DeviceDispatchTable, CmdDrawIndexed)},
340 {"vkCmdDrawIndexedIndirect", offsetof(DeviceDispatchTable, CmdDrawIndexedIndirect)},
341 {"vkCmdDrawIndirect", offsetof(DeviceDispatchTable, CmdDrawIndirect)},
342 {"vkCmdEndQuery", offsetof(DeviceDispatchTable, CmdEndQuery)},
343 {"vkCmdEndRenderPass", offsetof(DeviceDispatchTable, CmdEndRenderPass)},
344 {"vkCmdExecuteCommands", offsetof(DeviceDispatchTable, CmdExecuteCommands)},
345 {"vkCmdFillBuffer", offsetof(DeviceDispatchTable, CmdFillBuffer)},
346 {"vkCmdNextSubpass", offsetof(DeviceDispatchTable, CmdNextSubpass)},
347 {"vkCmdPipelineBarrier", offsetof(DeviceDispatchTable, CmdPipelineBarrier)},
348 {"vkCmdPushConstants", offsetof(DeviceDispatchTable, CmdPushConstants)},
349 {"vkCmdResetEvent", offsetof(DeviceDispatchTable, CmdResetEvent)},
350 {"vkCmdResetQueryPool", offsetof(DeviceDispatchTable, CmdResetQueryPool)},
351 {"vkCmdResolveImage", offsetof(DeviceDispatchTable, CmdResolveImage)},
352 {"vkCmdSetBlendConstants", offsetof(DeviceDispatchTable, CmdSetBlendConstants)},
353 {"vkCmdSetDepthBias", offsetof(DeviceDispatchTable, CmdSetDepthBias)},
354 {"vkCmdSetDepthBounds", offsetof(DeviceDispatchTable, CmdSetDepthBounds)},
355 {"vkCmdSetEvent", offsetof(DeviceDispatchTable, CmdSetEvent)},
356 {"vkCmdSetLineWidth", offsetof(DeviceDispatchTable, CmdSetLineWidth)},
357 {"vkCmdSetScissor", offsetof(DeviceDispatchTable, CmdSetScissor)},
358 {"vkCmdSetStencilCompareMask", offsetof(DeviceDispatchTable, CmdSetStencilCompareMask)},
359 {"vkCmdSetStencilReference", offsetof(DeviceDispatchTable, CmdSetStencilReference)},
360 {"vkCmdSetStencilWriteMask", offsetof(DeviceDispatchTable, CmdSetStencilWriteMask)},
361 {"vkCmdSetViewport", offsetof(DeviceDispatchTable, CmdSetViewport)},
362 {"vkCmdUpdateBuffer", offsetof(DeviceDispatchTable, CmdUpdateBuffer)},
363 {"vkCmdWaitEvents", offsetof(DeviceDispatchTable, CmdWaitEvents)},
364 {"vkCmdWriteTimestamp", offsetof(DeviceDispatchTable, CmdWriteTimestamp)},
365 {"vkCreateBuffer", offsetof(DeviceDispatchTable, CreateBuffer)},
366 {"vkCreateBufferView", offsetof(DeviceDispatchTable, CreateBufferView)},
367 {"vkCreateCommandPool", offsetof(DeviceDispatchTable, CreateCommandPool)},
368 {"vkCreateComputePipelines", offsetof(DeviceDispatchTable, CreateComputePipelines)},
369 {"vkCreateDescriptorPool", offsetof(DeviceDispatchTable, CreateDescriptorPool)},
370 {"vkCreateDescriptorSetLayout", offsetof(DeviceDispatchTable, CreateDescriptorSetLayout)},
371 {"vkCreateEvent", offsetof(DeviceDispatchTable, CreateEvent)},
372 {"vkCreateFence", offsetof(DeviceDispatchTable, CreateFence)},
373 {"vkCreateFramebuffer", offsetof(DeviceDispatchTable, CreateFramebuffer)},
374 {"vkCreateGraphicsPipelines", offsetof(DeviceDispatchTable, CreateGraphicsPipelines)},
375 {"vkCreateImage", offsetof(DeviceDispatchTable, CreateImage)},
376 {"vkCreateImageView", offsetof(DeviceDispatchTable, CreateImageView)},
377 {"vkCreatePipelineCache", offsetof(DeviceDispatchTable, CreatePipelineCache)},
378 {"vkCreatePipelineLayout", offsetof(DeviceDispatchTable, CreatePipelineLayout)},
379 {"vkCreateQueryPool", offsetof(DeviceDispatchTable, CreateQueryPool)},
380 {"vkCreateRenderPass", offsetof(DeviceDispatchTable, CreateRenderPass)},
381 {"vkCreateSampler", offsetof(DeviceDispatchTable, CreateSampler)},
382 {"vkCreateSemaphore", offsetof(DeviceDispatchTable, CreateSemaphore)},
383 {"vkCreateShaderModule", offsetof(DeviceDispatchTable, CreateShaderModule)},
384 {"vkCreateSwapchainKHR", offsetof(DeviceDispatchTable, CreateSwapchainKHR)},
385 {"vkDestroyBuffer", offsetof(DeviceDispatchTable, DestroyBuffer)},
386 {"vkDestroyBufferView", offsetof(DeviceDispatchTable, DestroyBufferView)},
387 {"vkDestroyCommandPool", offsetof(DeviceDispatchTable, DestroyCommandPool)},
388 {"vkDestroyDescriptorPool", offsetof(DeviceDispatchTable, DestroyDescriptorPool)},
389 {"vkDestroyDescriptorSetLayout", offsetof(DeviceDispatchTable, DestroyDescriptorSetLayout)},
390 {"vkDestroyDevice", offsetof(DeviceDispatchTable, DestroyDevice)},
391 {"vkDestroyEvent", offsetof(DeviceDispatchTable, DestroyEvent)},
392 {"vkDestroyFence", offsetof(DeviceDispatchTable, DestroyFence)},
393 {"vkDestroyFramebuffer", offsetof(DeviceDispatchTable, DestroyFramebuffer)},
394 {"vkDestroyImage", offsetof(DeviceDispatchTable, DestroyImage)},
395 {"vkDestroyImageView", offsetof(DeviceDispatchTable, DestroyImageView)},
396 {"vkDestroyPipeline", offsetof(DeviceDispatchTable, DestroyPipeline)},
397 {"vkDestroyPipelineCache", offsetof(DeviceDispatchTable, DestroyPipelineCache)},
398 {"vkDestroyPipelineLayout", offsetof(DeviceDispatchTable, DestroyPipelineLayout)},
399 {"vkDestroyQueryPool", offsetof(DeviceDispatchTable, DestroyQueryPool)},
400 {"vkDestroyRenderPass", offsetof(DeviceDispatchTable, DestroyRenderPass)},
401 {"vkDestroySampler", offsetof(DeviceDispatchTable, DestroySampler)},
402 {"vkDestroySemaphore", offsetof(DeviceDispatchTable, DestroySemaphore)},
403 {"vkDestroyShaderModule", offsetof(DeviceDispatchTable, DestroyShaderModule)},
404 {"vkDestroySwapchainKHR", offsetof(DeviceDispatchTable, DestroySwapchainKHR)},
405 {"vkDeviceWaitIdle", offsetof(DeviceDispatchTable, DeviceWaitIdle)},
406 {"vkEndCommandBuffer", offsetof(DeviceDispatchTable, EndCommandBuffer)},
407 {"vkFlushMappedMemoryRanges", offsetof(DeviceDispatchTable, FlushMappedMemoryRanges)},
408 {"vkFreeCommandBuffers", offsetof(DeviceDispatchTable, FreeCommandBuffers)},
409 {"vkFreeDescriptorSets", offsetof(DeviceDispatchTable, FreeDescriptorSets)},
410 {"vkFreeMemory", offsetof(DeviceDispatchTable, FreeMemory)},
411 {"vkGetBufferMemoryRequirements", offsetof(DeviceDispatchTable, GetBufferMemoryRequirements)},
412 {"vkGetDeviceMemoryCommitment", offsetof(DeviceDispatchTable, GetDeviceMemoryCommitment)},
413 {"vkGetDeviceQueue", offsetof(DeviceDispatchTable, GetDeviceQueue)},
414 {"vkGetEventStatus", offsetof(DeviceDispatchTable, GetEventStatus)},
415 {"vkGetFenceStatus", offsetof(DeviceDispatchTable, GetFenceStatus)},
416 {"vkGetImageMemoryRequirements", offsetof(DeviceDispatchTable, GetImageMemoryRequirements)},
417 {"vkGetImageSparseMemoryRequirements", offsetof(DeviceDispatchTable, GetImageSparseMemoryRequirements)},
418 {"vkGetImageSubresourceLayout", offsetof(DeviceDispatchTable, GetImageSubresourceLayout)},
419 {"vkGetPipelineCacheData", offsetof(DeviceDispatchTable, GetPipelineCacheData)},
420 {"vkGetQueryPoolResults", offsetof(DeviceDispatchTable, GetQueryPoolResults)},
421 {"vkGetRenderAreaGranularity", offsetof(DeviceDispatchTable, GetRenderAreaGranularity)},
422 {"vkGetSwapchainImagesKHR", offsetof(DeviceDispatchTable, GetSwapchainImagesKHR)},
423 {"vkInvalidateMappedMemoryRanges", offsetof(DeviceDispatchTable, InvalidateMappedMemoryRanges)},
424 {"vkMapMemory", offsetof(DeviceDispatchTable, MapMemory)},
425 {"vkMergePipelineCaches", offsetof(DeviceDispatchTable, MergePipelineCaches)},
426 {"vkQueueBindSparse", offsetof(DeviceDispatchTable, QueueBindSparse)},
427 {"vkQueuePresentKHR", offsetof(DeviceDispatchTable, QueuePresentKHR)},
428 {"vkQueueSubmit", offsetof(DeviceDispatchTable, QueueSubmit)},
429 {"vkQueueWaitIdle", offsetof(DeviceDispatchTable, QueueWaitIdle)},
430 {"vkResetCommandBuffer", offsetof(DeviceDispatchTable, ResetCommandBuffer)},
431 {"vkResetCommandPool", offsetof(DeviceDispatchTable, ResetCommandPool)},
432 {"vkResetDescriptorPool", offsetof(DeviceDispatchTable, ResetDescriptorPool)},
433 {"vkResetEvent", offsetof(DeviceDispatchTable, ResetEvent)},
434 {"vkResetFences", offsetof(DeviceDispatchTable, ResetFences)},
435 {"vkSetEvent", offsetof(DeviceDispatchTable, SetEvent)},
436 {"vkUnmapMemory", offsetof(DeviceDispatchTable, UnmapMemory)},
437 {"vkUpdateDescriptorSets", offsetof(DeviceDispatchTable, UpdateDescriptorSets)},
438 {"vkWaitForFences", offsetof(DeviceDispatchTable, WaitForFences)},
439 // clang-format on
440};
441
442} // anonymous namespace
443
444namespace vulkan {
445
446PFN_vkVoidFunction GetLoaderExportProcAddr(const char* name) {
447 return Lookup(name, kLoaderExportProcs);
448}
449
450PFN_vkVoidFunction GetLoaderGlobalProcAddr(const char* name) {
451 return Lookup(name, kLoaderGlobalProcs);
452}
453
454PFN_vkVoidFunction GetLoaderTopProcAddr(const char* name) {
455 return Lookup(name, kLoaderTopProcs);
456}
457
458PFN_vkVoidFunction GetLoaderBottomProcAddr(const char* name) {
459 return Lookup(name, kLoaderBottomProcs);
460}
461
462PFN_vkVoidFunction GetDispatchProcAddr(const InstanceDispatchTable& dispatch,
463 const char* name) {
464 return Lookup(name, kInstanceDispatchOffsets, dispatch);
465}
466
467PFN_vkVoidFunction GetDispatchProcAddr(const DeviceDispatchTable& dispatch,
468 const char* name) {
469 return Lookup(name, kDeviceDispatchOffsets, dispatch);
470}
471
472bool LoadInstanceDispatchTable(VkInstance instance,
473 PFN_vkGetInstanceProcAddr get_proc_addr,
474 InstanceDispatchTable& dispatch) {
475 bool success = true;
476 // clang-format off
477 dispatch.DestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(get_proc_addr(instance, "vkDestroyInstance"));
478 if (UNLIKELY(!dispatch.DestroyInstance)) {
479 ALOGE("missing instance proc: %s", "vkDestroyInstance");
480 success = false;
481 }
482 dispatch.EnumeratePhysicalDevices = reinterpret_cast<PFN_vkEnumeratePhysicalDevices>(get_proc_addr(instance, "vkEnumeratePhysicalDevices"));
483 if (UNLIKELY(!dispatch.EnumeratePhysicalDevices)) {
484 ALOGE("missing instance proc: %s", "vkEnumeratePhysicalDevices");
485 success = false;
486 }
487 dispatch.GetPhysicalDeviceProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceProperties"));
488 if (UNLIKELY(!dispatch.GetPhysicalDeviceProperties)) {
489 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceProperties");
490 success = false;
491 }
492 dispatch.GetPhysicalDeviceQueueFamilyProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueFamilyProperties"));
493 if (UNLIKELY(!dispatch.GetPhysicalDeviceQueueFamilyProperties)) {
494 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueFamilyProperties");
495 success = false;
496 }
497 dispatch.GetPhysicalDeviceMemoryProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceMemoryProperties"));
498 if (UNLIKELY(!dispatch.GetPhysicalDeviceMemoryProperties)) {
499 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceMemoryProperties");
500 success = false;
501 }
502 dispatch.GetPhysicalDeviceFeatures = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures>(get_proc_addr(instance, "vkGetPhysicalDeviceFeatures"));
503 if (UNLIKELY(!dispatch.GetPhysicalDeviceFeatures)) {
504 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceFeatures");
505 success = false;
506 }
507 dispatch.GetPhysicalDeviceFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceFormatProperties"));
508 if (UNLIKELY(!dispatch.GetPhysicalDeviceFormatProperties)) {
509 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceFormatProperties");
510 success = false;
511 }
512 dispatch.GetPhysicalDeviceImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceImageFormatProperties"));
513 if (UNLIKELY(!dispatch.GetPhysicalDeviceImageFormatProperties)) {
514 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceImageFormatProperties");
515 success = false;
516 }
517 dispatch.CreateDevice = reinterpret_cast<PFN_vkCreateDevice>(get_proc_addr(instance, "vkCreateDevice"));
518 if (UNLIKELY(!dispatch.CreateDevice)) {
519 ALOGE("missing instance proc: %s", "vkCreateDevice");
520 success = false;
521 }
522 dispatch.EnumerateDeviceLayerProperties = reinterpret_cast<PFN_vkEnumerateDeviceLayerProperties>(get_proc_addr(instance, "vkEnumerateDeviceLayerProperties"));
523 if (UNLIKELY(!dispatch.EnumerateDeviceLayerProperties)) {
524 ALOGE("missing instance proc: %s", "vkEnumerateDeviceLayerProperties");
525 success = false;
526 }
527 dispatch.EnumerateDeviceExtensionProperties = reinterpret_cast<PFN_vkEnumerateDeviceExtensionProperties>(get_proc_addr(instance, "vkEnumerateDeviceExtensionProperties"));
528 if (UNLIKELY(!dispatch.EnumerateDeviceExtensionProperties)) {
529 ALOGE("missing instance proc: %s", "vkEnumerateDeviceExtensionProperties");
530 success = false;
531 }
532 dispatch.GetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties"));
533 if (UNLIKELY(!dispatch.GetPhysicalDeviceSparseImageFormatProperties)) {
534 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSparseImageFormatProperties");
535 success = false;
536 }
537 dispatch.DestroySurfaceKHR = reinterpret_cast<PFN_vkDestroySurfaceKHR>(get_proc_addr(instance, "vkDestroySurfaceKHR"));
538 if (UNLIKELY(!dispatch.DestroySurfaceKHR)) {
539 ALOGE("missing instance proc: %s", "vkDestroySurfaceKHR");
540 success = false;
541 }
542 dispatch.GetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(get_proc_addr(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"));
543 if (UNLIKELY(!dispatch.GetPhysicalDeviceSurfaceSupportKHR)) {
544 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSurfaceSupportKHR");
545 success = false;
546 }
547 dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>(get_proc_addr(instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"));
548 if (UNLIKELY(!dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR)) {
549 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
550 success = false;
551 }
552 dispatch.GetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>(get_proc_addr(instance, "vkGetPhysicalDeviceSurfaceFormatsKHR"));
553 if (UNLIKELY(!dispatch.GetPhysicalDeviceSurfaceFormatsKHR)) {
554 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSurfaceFormatsKHR");
555 success = false;
556 }
557 dispatch.GetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR>(get_proc_addr(instance, "vkGetPhysicalDeviceSurfacePresentModesKHR"));
558 if (UNLIKELY(!dispatch.GetPhysicalDeviceSurfacePresentModesKHR)) {
559 ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSurfacePresentModesKHR");
560 success = false;
561 }
562 dispatch.CreateAndroidSurfaceKHR = reinterpret_cast<PFN_vkCreateAndroidSurfaceKHR>(get_proc_addr(instance, "vkCreateAndroidSurfaceKHR"));
563 if (UNLIKELY(!dispatch.CreateAndroidSurfaceKHR)) {
564 ALOGE("missing instance proc: %s", "vkCreateAndroidSurfaceKHR");
565 success = false;
566 }
Jesse Hall715b86a2016-01-16 16:34:29 -0800567 dispatch.CreateDebugReportCallbackEXT = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(get_proc_addr(instance, "vkCreateDebugReportCallbackEXT"));
568 if (UNLIKELY(!dispatch.CreateDebugReportCallbackEXT)) {
569 ALOGE("missing instance proc: %s", "vkCreateDebugReportCallbackEXT");
570 success = false;
571 }
572 dispatch.DestroyDebugReportCallbackEXT = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(get_proc_addr(instance, "vkDestroyDebugReportCallbackEXT"));
573 if (UNLIKELY(!dispatch.DestroyDebugReportCallbackEXT)) {
574 ALOGE("missing instance proc: %s", "vkDestroyDebugReportCallbackEXT");
575 success = false;
576 }
577 dispatch.DebugReportMessageEXT = reinterpret_cast<PFN_vkDebugReportMessageEXT>(get_proc_addr(instance, "vkDebugReportMessageEXT"));
578 if (UNLIKELY(!dispatch.DebugReportMessageEXT)) {
579 ALOGE("missing instance proc: %s", "vkDebugReportMessageEXT");
580 success = false;
581 }
Jesse Hall1f91d392015-12-11 16:28:44 -0800582 // clang-format on
583 return success;
584}
585
586bool LoadDeviceDispatchTable(VkDevice device,
587 PFN_vkGetDeviceProcAddr get_proc_addr,
588 DeviceDispatchTable& dispatch) {
589 bool success = true;
590 // clang-format off
591 dispatch.DestroyDevice = reinterpret_cast<PFN_vkDestroyDevice>(get_proc_addr(device, "vkDestroyDevice"));
592 if (UNLIKELY(!dispatch.DestroyDevice)) {
593 ALOGE("missing device proc: %s", "vkDestroyDevice");
594 success = false;
595 }
596 dispatch.GetDeviceQueue = reinterpret_cast<PFN_vkGetDeviceQueue>(get_proc_addr(device, "vkGetDeviceQueue"));
597 if (UNLIKELY(!dispatch.GetDeviceQueue)) {
598 ALOGE("missing device proc: %s", "vkGetDeviceQueue");
599 success = false;
600 }
601 dispatch.QueueSubmit = reinterpret_cast<PFN_vkQueueSubmit>(get_proc_addr(device, "vkQueueSubmit"));
602 if (UNLIKELY(!dispatch.QueueSubmit)) {
603 ALOGE("missing device proc: %s", "vkQueueSubmit");
604 success = false;
605 }
606 dispatch.QueueWaitIdle = reinterpret_cast<PFN_vkQueueWaitIdle>(get_proc_addr(device, "vkQueueWaitIdle"));
607 if (UNLIKELY(!dispatch.QueueWaitIdle)) {
608 ALOGE("missing device proc: %s", "vkQueueWaitIdle");
609 success = false;
610 }
611 dispatch.DeviceWaitIdle = reinterpret_cast<PFN_vkDeviceWaitIdle>(get_proc_addr(device, "vkDeviceWaitIdle"));
612 if (UNLIKELY(!dispatch.DeviceWaitIdle)) {
613 ALOGE("missing device proc: %s", "vkDeviceWaitIdle");
614 success = false;
615 }
616 dispatch.AllocateMemory = reinterpret_cast<PFN_vkAllocateMemory>(get_proc_addr(device, "vkAllocateMemory"));
617 if (UNLIKELY(!dispatch.AllocateMemory)) {
618 ALOGE("missing device proc: %s", "vkAllocateMemory");
619 success = false;
620 }
621 dispatch.FreeMemory = reinterpret_cast<PFN_vkFreeMemory>(get_proc_addr(device, "vkFreeMemory"));
622 if (UNLIKELY(!dispatch.FreeMemory)) {
623 ALOGE("missing device proc: %s", "vkFreeMemory");
624 success = false;
625 }
626 dispatch.MapMemory = reinterpret_cast<PFN_vkMapMemory>(get_proc_addr(device, "vkMapMemory"));
627 if (UNLIKELY(!dispatch.MapMemory)) {
628 ALOGE("missing device proc: %s", "vkMapMemory");
629 success = false;
630 }
631 dispatch.UnmapMemory = reinterpret_cast<PFN_vkUnmapMemory>(get_proc_addr(device, "vkUnmapMemory"));
632 if (UNLIKELY(!dispatch.UnmapMemory)) {
633 ALOGE("missing device proc: %s", "vkUnmapMemory");
634 success = false;
635 }
636 dispatch.FlushMappedMemoryRanges = reinterpret_cast<PFN_vkFlushMappedMemoryRanges>(get_proc_addr(device, "vkFlushMappedMemoryRanges"));
637 if (UNLIKELY(!dispatch.FlushMappedMemoryRanges)) {
638 ALOGE("missing device proc: %s", "vkFlushMappedMemoryRanges");
639 success = false;
640 }
641 dispatch.InvalidateMappedMemoryRanges = reinterpret_cast<PFN_vkInvalidateMappedMemoryRanges>(get_proc_addr(device, "vkInvalidateMappedMemoryRanges"));
642 if (UNLIKELY(!dispatch.InvalidateMappedMemoryRanges)) {
643 ALOGE("missing device proc: %s", "vkInvalidateMappedMemoryRanges");
644 success = false;
645 }
646 dispatch.GetDeviceMemoryCommitment = reinterpret_cast<PFN_vkGetDeviceMemoryCommitment>(get_proc_addr(device, "vkGetDeviceMemoryCommitment"));
647 if (UNLIKELY(!dispatch.GetDeviceMemoryCommitment)) {
648 ALOGE("missing device proc: %s", "vkGetDeviceMemoryCommitment");
649 success = false;
650 }
651 dispatch.GetBufferMemoryRequirements = reinterpret_cast<PFN_vkGetBufferMemoryRequirements>(get_proc_addr(device, "vkGetBufferMemoryRequirements"));
652 if (UNLIKELY(!dispatch.GetBufferMemoryRequirements)) {
653 ALOGE("missing device proc: %s", "vkGetBufferMemoryRequirements");
654 success = false;
655 }
656 dispatch.BindBufferMemory = reinterpret_cast<PFN_vkBindBufferMemory>(get_proc_addr(device, "vkBindBufferMemory"));
657 if (UNLIKELY(!dispatch.BindBufferMemory)) {
658 ALOGE("missing device proc: %s", "vkBindBufferMemory");
659 success = false;
660 }
661 dispatch.GetImageMemoryRequirements = reinterpret_cast<PFN_vkGetImageMemoryRequirements>(get_proc_addr(device, "vkGetImageMemoryRequirements"));
662 if (UNLIKELY(!dispatch.GetImageMemoryRequirements)) {
663 ALOGE("missing device proc: %s", "vkGetImageMemoryRequirements");
664 success = false;
665 }
666 dispatch.BindImageMemory = reinterpret_cast<PFN_vkBindImageMemory>(get_proc_addr(device, "vkBindImageMemory"));
667 if (UNLIKELY(!dispatch.BindImageMemory)) {
668 ALOGE("missing device proc: %s", "vkBindImageMemory");
669 success = false;
670 }
671 dispatch.GetImageSparseMemoryRequirements = reinterpret_cast<PFN_vkGetImageSparseMemoryRequirements>(get_proc_addr(device, "vkGetImageSparseMemoryRequirements"));
672 if (UNLIKELY(!dispatch.GetImageSparseMemoryRequirements)) {
673 ALOGE("missing device proc: %s", "vkGetImageSparseMemoryRequirements");
674 success = false;
675 }
676 dispatch.QueueBindSparse = reinterpret_cast<PFN_vkQueueBindSparse>(get_proc_addr(device, "vkQueueBindSparse"));
677 if (UNLIKELY(!dispatch.QueueBindSparse)) {
678 ALOGE("missing device proc: %s", "vkQueueBindSparse");
679 success = false;
680 }
681 dispatch.CreateFence = reinterpret_cast<PFN_vkCreateFence>(get_proc_addr(device, "vkCreateFence"));
682 if (UNLIKELY(!dispatch.CreateFence)) {
683 ALOGE("missing device proc: %s", "vkCreateFence");
684 success = false;
685 }
686 dispatch.DestroyFence = reinterpret_cast<PFN_vkDestroyFence>(get_proc_addr(device, "vkDestroyFence"));
687 if (UNLIKELY(!dispatch.DestroyFence)) {
688 ALOGE("missing device proc: %s", "vkDestroyFence");
689 success = false;
690 }
691 dispatch.ResetFences = reinterpret_cast<PFN_vkResetFences>(get_proc_addr(device, "vkResetFences"));
692 if (UNLIKELY(!dispatch.ResetFences)) {
693 ALOGE("missing device proc: %s", "vkResetFences");
694 success = false;
695 }
696 dispatch.GetFenceStatus = reinterpret_cast<PFN_vkGetFenceStatus>(get_proc_addr(device, "vkGetFenceStatus"));
697 if (UNLIKELY(!dispatch.GetFenceStatus)) {
698 ALOGE("missing device proc: %s", "vkGetFenceStatus");
699 success = false;
700 }
701 dispatch.WaitForFences = reinterpret_cast<PFN_vkWaitForFences>(get_proc_addr(device, "vkWaitForFences"));
702 if (UNLIKELY(!dispatch.WaitForFences)) {
703 ALOGE("missing device proc: %s", "vkWaitForFences");
704 success = false;
705 }
706 dispatch.CreateSemaphore = reinterpret_cast<PFN_vkCreateSemaphore>(get_proc_addr(device, "vkCreateSemaphore"));
707 if (UNLIKELY(!dispatch.CreateSemaphore)) {
708 ALOGE("missing device proc: %s", "vkCreateSemaphore");
709 success = false;
710 }
711 dispatch.DestroySemaphore = reinterpret_cast<PFN_vkDestroySemaphore>(get_proc_addr(device, "vkDestroySemaphore"));
712 if (UNLIKELY(!dispatch.DestroySemaphore)) {
713 ALOGE("missing device proc: %s", "vkDestroySemaphore");
714 success = false;
715 }
716 dispatch.CreateEvent = reinterpret_cast<PFN_vkCreateEvent>(get_proc_addr(device, "vkCreateEvent"));
717 if (UNLIKELY(!dispatch.CreateEvent)) {
718 ALOGE("missing device proc: %s", "vkCreateEvent");
719 success = false;
720 }
721 dispatch.DestroyEvent = reinterpret_cast<PFN_vkDestroyEvent>(get_proc_addr(device, "vkDestroyEvent"));
722 if (UNLIKELY(!dispatch.DestroyEvent)) {
723 ALOGE("missing device proc: %s", "vkDestroyEvent");
724 success = false;
725 }
726 dispatch.GetEventStatus = reinterpret_cast<PFN_vkGetEventStatus>(get_proc_addr(device, "vkGetEventStatus"));
727 if (UNLIKELY(!dispatch.GetEventStatus)) {
728 ALOGE("missing device proc: %s", "vkGetEventStatus");
729 success = false;
730 }
731 dispatch.SetEvent = reinterpret_cast<PFN_vkSetEvent>(get_proc_addr(device, "vkSetEvent"));
732 if (UNLIKELY(!dispatch.SetEvent)) {
733 ALOGE("missing device proc: %s", "vkSetEvent");
734 success = false;
735 }
736 dispatch.ResetEvent = reinterpret_cast<PFN_vkResetEvent>(get_proc_addr(device, "vkResetEvent"));
737 if (UNLIKELY(!dispatch.ResetEvent)) {
738 ALOGE("missing device proc: %s", "vkResetEvent");
739 success = false;
740 }
741 dispatch.CreateQueryPool = reinterpret_cast<PFN_vkCreateQueryPool>(get_proc_addr(device, "vkCreateQueryPool"));
742 if (UNLIKELY(!dispatch.CreateQueryPool)) {
743 ALOGE("missing device proc: %s", "vkCreateQueryPool");
744 success = false;
745 }
746 dispatch.DestroyQueryPool = reinterpret_cast<PFN_vkDestroyQueryPool>(get_proc_addr(device, "vkDestroyQueryPool"));
747 if (UNLIKELY(!dispatch.DestroyQueryPool)) {
748 ALOGE("missing device proc: %s", "vkDestroyQueryPool");
749 success = false;
750 }
751 dispatch.GetQueryPoolResults = reinterpret_cast<PFN_vkGetQueryPoolResults>(get_proc_addr(device, "vkGetQueryPoolResults"));
752 if (UNLIKELY(!dispatch.GetQueryPoolResults)) {
753 ALOGE("missing device proc: %s", "vkGetQueryPoolResults");
754 success = false;
755 }
756 dispatch.CreateBuffer = reinterpret_cast<PFN_vkCreateBuffer>(get_proc_addr(device, "vkCreateBuffer"));
757 if (UNLIKELY(!dispatch.CreateBuffer)) {
758 ALOGE("missing device proc: %s", "vkCreateBuffer");
759 success = false;
760 }
761 dispatch.DestroyBuffer = reinterpret_cast<PFN_vkDestroyBuffer>(get_proc_addr(device, "vkDestroyBuffer"));
762 if (UNLIKELY(!dispatch.DestroyBuffer)) {
763 ALOGE("missing device proc: %s", "vkDestroyBuffer");
764 success = false;
765 }
766 dispatch.CreateBufferView = reinterpret_cast<PFN_vkCreateBufferView>(get_proc_addr(device, "vkCreateBufferView"));
767 if (UNLIKELY(!dispatch.CreateBufferView)) {
768 ALOGE("missing device proc: %s", "vkCreateBufferView");
769 success = false;
770 }
771 dispatch.DestroyBufferView = reinterpret_cast<PFN_vkDestroyBufferView>(get_proc_addr(device, "vkDestroyBufferView"));
772 if (UNLIKELY(!dispatch.DestroyBufferView)) {
773 ALOGE("missing device proc: %s", "vkDestroyBufferView");
774 success = false;
775 }
776 dispatch.CreateImage = reinterpret_cast<PFN_vkCreateImage>(get_proc_addr(device, "vkCreateImage"));
777 if (UNLIKELY(!dispatch.CreateImage)) {
778 ALOGE("missing device proc: %s", "vkCreateImage");
779 success = false;
780 }
781 dispatch.DestroyImage = reinterpret_cast<PFN_vkDestroyImage>(get_proc_addr(device, "vkDestroyImage"));
782 if (UNLIKELY(!dispatch.DestroyImage)) {
783 ALOGE("missing device proc: %s", "vkDestroyImage");
784 success = false;
785 }
786 dispatch.GetImageSubresourceLayout = reinterpret_cast<PFN_vkGetImageSubresourceLayout>(get_proc_addr(device, "vkGetImageSubresourceLayout"));
787 if (UNLIKELY(!dispatch.GetImageSubresourceLayout)) {
788 ALOGE("missing device proc: %s", "vkGetImageSubresourceLayout");
789 success = false;
790 }
791 dispatch.CreateImageView = reinterpret_cast<PFN_vkCreateImageView>(get_proc_addr(device, "vkCreateImageView"));
792 if (UNLIKELY(!dispatch.CreateImageView)) {
793 ALOGE("missing device proc: %s", "vkCreateImageView");
794 success = false;
795 }
796 dispatch.DestroyImageView = reinterpret_cast<PFN_vkDestroyImageView>(get_proc_addr(device, "vkDestroyImageView"));
797 if (UNLIKELY(!dispatch.DestroyImageView)) {
798 ALOGE("missing device proc: %s", "vkDestroyImageView");
799 success = false;
800 }
801 dispatch.CreateShaderModule = reinterpret_cast<PFN_vkCreateShaderModule>(get_proc_addr(device, "vkCreateShaderModule"));
802 if (UNLIKELY(!dispatch.CreateShaderModule)) {
803 ALOGE("missing device proc: %s", "vkCreateShaderModule");
804 success = false;
805 }
806 dispatch.DestroyShaderModule = reinterpret_cast<PFN_vkDestroyShaderModule>(get_proc_addr(device, "vkDestroyShaderModule"));
807 if (UNLIKELY(!dispatch.DestroyShaderModule)) {
808 ALOGE("missing device proc: %s", "vkDestroyShaderModule");
809 success = false;
810 }
811 dispatch.CreatePipelineCache = reinterpret_cast<PFN_vkCreatePipelineCache>(get_proc_addr(device, "vkCreatePipelineCache"));
812 if (UNLIKELY(!dispatch.CreatePipelineCache)) {
813 ALOGE("missing device proc: %s", "vkCreatePipelineCache");
814 success = false;
815 }
816 dispatch.DestroyPipelineCache = reinterpret_cast<PFN_vkDestroyPipelineCache>(get_proc_addr(device, "vkDestroyPipelineCache"));
817 if (UNLIKELY(!dispatch.DestroyPipelineCache)) {
818 ALOGE("missing device proc: %s", "vkDestroyPipelineCache");
819 success = false;
820 }
821 dispatch.GetPipelineCacheData = reinterpret_cast<PFN_vkGetPipelineCacheData>(get_proc_addr(device, "vkGetPipelineCacheData"));
822 if (UNLIKELY(!dispatch.GetPipelineCacheData)) {
823 ALOGE("missing device proc: %s", "vkGetPipelineCacheData");
824 success = false;
825 }
826 dispatch.MergePipelineCaches = reinterpret_cast<PFN_vkMergePipelineCaches>(get_proc_addr(device, "vkMergePipelineCaches"));
827 if (UNLIKELY(!dispatch.MergePipelineCaches)) {
828 ALOGE("missing device proc: %s", "vkMergePipelineCaches");
829 success = false;
830 }
831 dispatch.CreateGraphicsPipelines = reinterpret_cast<PFN_vkCreateGraphicsPipelines>(get_proc_addr(device, "vkCreateGraphicsPipelines"));
832 if (UNLIKELY(!dispatch.CreateGraphicsPipelines)) {
833 ALOGE("missing device proc: %s", "vkCreateGraphicsPipelines");
834 success = false;
835 }
836 dispatch.CreateComputePipelines = reinterpret_cast<PFN_vkCreateComputePipelines>(get_proc_addr(device, "vkCreateComputePipelines"));
837 if (UNLIKELY(!dispatch.CreateComputePipelines)) {
838 ALOGE("missing device proc: %s", "vkCreateComputePipelines");
839 success = false;
840 }
841 dispatch.DestroyPipeline = reinterpret_cast<PFN_vkDestroyPipeline>(get_proc_addr(device, "vkDestroyPipeline"));
842 if (UNLIKELY(!dispatch.DestroyPipeline)) {
843 ALOGE("missing device proc: %s", "vkDestroyPipeline");
844 success = false;
845 }
846 dispatch.CreatePipelineLayout = reinterpret_cast<PFN_vkCreatePipelineLayout>(get_proc_addr(device, "vkCreatePipelineLayout"));
847 if (UNLIKELY(!dispatch.CreatePipelineLayout)) {
848 ALOGE("missing device proc: %s", "vkCreatePipelineLayout");
849 success = false;
850 }
851 dispatch.DestroyPipelineLayout = reinterpret_cast<PFN_vkDestroyPipelineLayout>(get_proc_addr(device, "vkDestroyPipelineLayout"));
852 if (UNLIKELY(!dispatch.DestroyPipelineLayout)) {
853 ALOGE("missing device proc: %s", "vkDestroyPipelineLayout");
854 success = false;
855 }
856 dispatch.CreateSampler = reinterpret_cast<PFN_vkCreateSampler>(get_proc_addr(device, "vkCreateSampler"));
857 if (UNLIKELY(!dispatch.CreateSampler)) {
858 ALOGE("missing device proc: %s", "vkCreateSampler");
859 success = false;
860 }
861 dispatch.DestroySampler = reinterpret_cast<PFN_vkDestroySampler>(get_proc_addr(device, "vkDestroySampler"));
862 if (UNLIKELY(!dispatch.DestroySampler)) {
863 ALOGE("missing device proc: %s", "vkDestroySampler");
864 success = false;
865 }
866 dispatch.CreateDescriptorSetLayout = reinterpret_cast<PFN_vkCreateDescriptorSetLayout>(get_proc_addr(device, "vkCreateDescriptorSetLayout"));
867 if (UNLIKELY(!dispatch.CreateDescriptorSetLayout)) {
868 ALOGE("missing device proc: %s", "vkCreateDescriptorSetLayout");
869 success = false;
870 }
871 dispatch.DestroyDescriptorSetLayout = reinterpret_cast<PFN_vkDestroyDescriptorSetLayout>(get_proc_addr(device, "vkDestroyDescriptorSetLayout"));
872 if (UNLIKELY(!dispatch.DestroyDescriptorSetLayout)) {
873 ALOGE("missing device proc: %s", "vkDestroyDescriptorSetLayout");
874 success = false;
875 }
876 dispatch.CreateDescriptorPool = reinterpret_cast<PFN_vkCreateDescriptorPool>(get_proc_addr(device, "vkCreateDescriptorPool"));
877 if (UNLIKELY(!dispatch.CreateDescriptorPool)) {
878 ALOGE("missing device proc: %s", "vkCreateDescriptorPool");
879 success = false;
880 }
881 dispatch.DestroyDescriptorPool = reinterpret_cast<PFN_vkDestroyDescriptorPool>(get_proc_addr(device, "vkDestroyDescriptorPool"));
882 if (UNLIKELY(!dispatch.DestroyDescriptorPool)) {
883 ALOGE("missing device proc: %s", "vkDestroyDescriptorPool");
884 success = false;
885 }
886 dispatch.ResetDescriptorPool = reinterpret_cast<PFN_vkResetDescriptorPool>(get_proc_addr(device, "vkResetDescriptorPool"));
887 if (UNLIKELY(!dispatch.ResetDescriptorPool)) {
888 ALOGE("missing device proc: %s", "vkResetDescriptorPool");
889 success = false;
890 }
891 dispatch.AllocateDescriptorSets = reinterpret_cast<PFN_vkAllocateDescriptorSets>(get_proc_addr(device, "vkAllocateDescriptorSets"));
892 if (UNLIKELY(!dispatch.AllocateDescriptorSets)) {
893 ALOGE("missing device proc: %s", "vkAllocateDescriptorSets");
894 success = false;
895 }
896 dispatch.FreeDescriptorSets = reinterpret_cast<PFN_vkFreeDescriptorSets>(get_proc_addr(device, "vkFreeDescriptorSets"));
897 if (UNLIKELY(!dispatch.FreeDescriptorSets)) {
898 ALOGE("missing device proc: %s", "vkFreeDescriptorSets");
899 success = false;
900 }
901 dispatch.UpdateDescriptorSets = reinterpret_cast<PFN_vkUpdateDescriptorSets>(get_proc_addr(device, "vkUpdateDescriptorSets"));
902 if (UNLIKELY(!dispatch.UpdateDescriptorSets)) {
903 ALOGE("missing device proc: %s", "vkUpdateDescriptorSets");
904 success = false;
905 }
906 dispatch.CreateFramebuffer = reinterpret_cast<PFN_vkCreateFramebuffer>(get_proc_addr(device, "vkCreateFramebuffer"));
907 if (UNLIKELY(!dispatch.CreateFramebuffer)) {
908 ALOGE("missing device proc: %s", "vkCreateFramebuffer");
909 success = false;
910 }
911 dispatch.DestroyFramebuffer = reinterpret_cast<PFN_vkDestroyFramebuffer>(get_proc_addr(device, "vkDestroyFramebuffer"));
912 if (UNLIKELY(!dispatch.DestroyFramebuffer)) {
913 ALOGE("missing device proc: %s", "vkDestroyFramebuffer");
914 success = false;
915 }
916 dispatch.CreateRenderPass = reinterpret_cast<PFN_vkCreateRenderPass>(get_proc_addr(device, "vkCreateRenderPass"));
917 if (UNLIKELY(!dispatch.CreateRenderPass)) {
918 ALOGE("missing device proc: %s", "vkCreateRenderPass");
919 success = false;
920 }
921 dispatch.DestroyRenderPass = reinterpret_cast<PFN_vkDestroyRenderPass>(get_proc_addr(device, "vkDestroyRenderPass"));
922 if (UNLIKELY(!dispatch.DestroyRenderPass)) {
923 ALOGE("missing device proc: %s", "vkDestroyRenderPass");
924 success = false;
925 }
926 dispatch.GetRenderAreaGranularity = reinterpret_cast<PFN_vkGetRenderAreaGranularity>(get_proc_addr(device, "vkGetRenderAreaGranularity"));
927 if (UNLIKELY(!dispatch.GetRenderAreaGranularity)) {
928 ALOGE("missing device proc: %s", "vkGetRenderAreaGranularity");
929 success = false;
930 }
931 dispatch.CreateCommandPool = reinterpret_cast<PFN_vkCreateCommandPool>(get_proc_addr(device, "vkCreateCommandPool"));
932 if (UNLIKELY(!dispatch.CreateCommandPool)) {
933 ALOGE("missing device proc: %s", "vkCreateCommandPool");
934 success = false;
935 }
936 dispatch.DestroyCommandPool = reinterpret_cast<PFN_vkDestroyCommandPool>(get_proc_addr(device, "vkDestroyCommandPool"));
937 if (UNLIKELY(!dispatch.DestroyCommandPool)) {
938 ALOGE("missing device proc: %s", "vkDestroyCommandPool");
939 success = false;
940 }
941 dispatch.ResetCommandPool = reinterpret_cast<PFN_vkResetCommandPool>(get_proc_addr(device, "vkResetCommandPool"));
942 if (UNLIKELY(!dispatch.ResetCommandPool)) {
943 ALOGE("missing device proc: %s", "vkResetCommandPool");
944 success = false;
945 }
946 dispatch.AllocateCommandBuffers = reinterpret_cast<PFN_vkAllocateCommandBuffers>(get_proc_addr(device, "vkAllocateCommandBuffers"));
947 if (UNLIKELY(!dispatch.AllocateCommandBuffers)) {
948 ALOGE("missing device proc: %s", "vkAllocateCommandBuffers");
949 success = false;
950 }
951 dispatch.FreeCommandBuffers = reinterpret_cast<PFN_vkFreeCommandBuffers>(get_proc_addr(device, "vkFreeCommandBuffers"));
952 if (UNLIKELY(!dispatch.FreeCommandBuffers)) {
953 ALOGE("missing device proc: %s", "vkFreeCommandBuffers");
954 success = false;
955 }
956 dispatch.BeginCommandBuffer = reinterpret_cast<PFN_vkBeginCommandBuffer>(get_proc_addr(device, "vkBeginCommandBuffer"));
957 if (UNLIKELY(!dispatch.BeginCommandBuffer)) {
958 ALOGE("missing device proc: %s", "vkBeginCommandBuffer");
959 success = false;
960 }
961 dispatch.EndCommandBuffer = reinterpret_cast<PFN_vkEndCommandBuffer>(get_proc_addr(device, "vkEndCommandBuffer"));
962 if (UNLIKELY(!dispatch.EndCommandBuffer)) {
963 ALOGE("missing device proc: %s", "vkEndCommandBuffer");
964 success = false;
965 }
966 dispatch.ResetCommandBuffer = reinterpret_cast<PFN_vkResetCommandBuffer>(get_proc_addr(device, "vkResetCommandBuffer"));
967 if (UNLIKELY(!dispatch.ResetCommandBuffer)) {
968 ALOGE("missing device proc: %s", "vkResetCommandBuffer");
969 success = false;
970 }
971 dispatch.CmdBindPipeline = reinterpret_cast<PFN_vkCmdBindPipeline>(get_proc_addr(device, "vkCmdBindPipeline"));
972 if (UNLIKELY(!dispatch.CmdBindPipeline)) {
973 ALOGE("missing device proc: %s", "vkCmdBindPipeline");
974 success = false;
975 }
976 dispatch.CmdSetViewport = reinterpret_cast<PFN_vkCmdSetViewport>(get_proc_addr(device, "vkCmdSetViewport"));
977 if (UNLIKELY(!dispatch.CmdSetViewport)) {
978 ALOGE("missing device proc: %s", "vkCmdSetViewport");
979 success = false;
980 }
981 dispatch.CmdSetScissor = reinterpret_cast<PFN_vkCmdSetScissor>(get_proc_addr(device, "vkCmdSetScissor"));
982 if (UNLIKELY(!dispatch.CmdSetScissor)) {
983 ALOGE("missing device proc: %s", "vkCmdSetScissor");
984 success = false;
985 }
986 dispatch.CmdSetLineWidth = reinterpret_cast<PFN_vkCmdSetLineWidth>(get_proc_addr(device, "vkCmdSetLineWidth"));
987 if (UNLIKELY(!dispatch.CmdSetLineWidth)) {
988 ALOGE("missing device proc: %s", "vkCmdSetLineWidth");
989 success = false;
990 }
991 dispatch.CmdSetDepthBias = reinterpret_cast<PFN_vkCmdSetDepthBias>(get_proc_addr(device, "vkCmdSetDepthBias"));
992 if (UNLIKELY(!dispatch.CmdSetDepthBias)) {
993 ALOGE("missing device proc: %s", "vkCmdSetDepthBias");
994 success = false;
995 }
996 dispatch.CmdSetBlendConstants = reinterpret_cast<PFN_vkCmdSetBlendConstants>(get_proc_addr(device, "vkCmdSetBlendConstants"));
997 if (UNLIKELY(!dispatch.CmdSetBlendConstants)) {
998 ALOGE("missing device proc: %s", "vkCmdSetBlendConstants");
999 success = false;
1000 }
1001 dispatch.CmdSetDepthBounds = reinterpret_cast<PFN_vkCmdSetDepthBounds>(get_proc_addr(device, "vkCmdSetDepthBounds"));
1002 if (UNLIKELY(!dispatch.CmdSetDepthBounds)) {
1003 ALOGE("missing device proc: %s", "vkCmdSetDepthBounds");
1004 success = false;
1005 }
1006 dispatch.CmdSetStencilCompareMask = reinterpret_cast<PFN_vkCmdSetStencilCompareMask>(get_proc_addr(device, "vkCmdSetStencilCompareMask"));
1007 if (UNLIKELY(!dispatch.CmdSetStencilCompareMask)) {
1008 ALOGE("missing device proc: %s", "vkCmdSetStencilCompareMask");
1009 success = false;
1010 }
1011 dispatch.CmdSetStencilWriteMask = reinterpret_cast<PFN_vkCmdSetStencilWriteMask>(get_proc_addr(device, "vkCmdSetStencilWriteMask"));
1012 if (UNLIKELY(!dispatch.CmdSetStencilWriteMask)) {
1013 ALOGE("missing device proc: %s", "vkCmdSetStencilWriteMask");
1014 success = false;
1015 }
1016 dispatch.CmdSetStencilReference = reinterpret_cast<PFN_vkCmdSetStencilReference>(get_proc_addr(device, "vkCmdSetStencilReference"));
1017 if (UNLIKELY(!dispatch.CmdSetStencilReference)) {
1018 ALOGE("missing device proc: %s", "vkCmdSetStencilReference");
1019 success = false;
1020 }
1021 dispatch.CmdBindDescriptorSets = reinterpret_cast<PFN_vkCmdBindDescriptorSets>(get_proc_addr(device, "vkCmdBindDescriptorSets"));
1022 if (UNLIKELY(!dispatch.CmdBindDescriptorSets)) {
1023 ALOGE("missing device proc: %s", "vkCmdBindDescriptorSets");
1024 success = false;
1025 }
1026 dispatch.CmdBindIndexBuffer = reinterpret_cast<PFN_vkCmdBindIndexBuffer>(get_proc_addr(device, "vkCmdBindIndexBuffer"));
1027 if (UNLIKELY(!dispatch.CmdBindIndexBuffer)) {
1028 ALOGE("missing device proc: %s", "vkCmdBindIndexBuffer");
1029 success = false;
1030 }
1031 dispatch.CmdBindVertexBuffers = reinterpret_cast<PFN_vkCmdBindVertexBuffers>(get_proc_addr(device, "vkCmdBindVertexBuffers"));
1032 if (UNLIKELY(!dispatch.CmdBindVertexBuffers)) {
1033 ALOGE("missing device proc: %s", "vkCmdBindVertexBuffers");
1034 success = false;
1035 }
1036 dispatch.CmdDraw = reinterpret_cast<PFN_vkCmdDraw>(get_proc_addr(device, "vkCmdDraw"));
1037 if (UNLIKELY(!dispatch.CmdDraw)) {
1038 ALOGE("missing device proc: %s", "vkCmdDraw");
1039 success = false;
1040 }
1041 dispatch.CmdDrawIndexed = reinterpret_cast<PFN_vkCmdDrawIndexed>(get_proc_addr(device, "vkCmdDrawIndexed"));
1042 if (UNLIKELY(!dispatch.CmdDrawIndexed)) {
1043 ALOGE("missing device proc: %s", "vkCmdDrawIndexed");
1044 success = false;
1045 }
1046 dispatch.CmdDrawIndirect = reinterpret_cast<PFN_vkCmdDrawIndirect>(get_proc_addr(device, "vkCmdDrawIndirect"));
1047 if (UNLIKELY(!dispatch.CmdDrawIndirect)) {
1048 ALOGE("missing device proc: %s", "vkCmdDrawIndirect");
1049 success = false;
1050 }
1051 dispatch.CmdDrawIndexedIndirect = reinterpret_cast<PFN_vkCmdDrawIndexedIndirect>(get_proc_addr(device, "vkCmdDrawIndexedIndirect"));
1052 if (UNLIKELY(!dispatch.CmdDrawIndexedIndirect)) {
1053 ALOGE("missing device proc: %s", "vkCmdDrawIndexedIndirect");
1054 success = false;
1055 }
1056 dispatch.CmdDispatch = reinterpret_cast<PFN_vkCmdDispatch>(get_proc_addr(device, "vkCmdDispatch"));
1057 if (UNLIKELY(!dispatch.CmdDispatch)) {
1058 ALOGE("missing device proc: %s", "vkCmdDispatch");
1059 success = false;
1060 }
1061 dispatch.CmdDispatchIndirect = reinterpret_cast<PFN_vkCmdDispatchIndirect>(get_proc_addr(device, "vkCmdDispatchIndirect"));
1062 if (UNLIKELY(!dispatch.CmdDispatchIndirect)) {
1063 ALOGE("missing device proc: %s", "vkCmdDispatchIndirect");
1064 success = false;
1065 }
1066 dispatch.CmdCopyBuffer = reinterpret_cast<PFN_vkCmdCopyBuffer>(get_proc_addr(device, "vkCmdCopyBuffer"));
1067 if (UNLIKELY(!dispatch.CmdCopyBuffer)) {
1068 ALOGE("missing device proc: %s", "vkCmdCopyBuffer");
1069 success = false;
1070 }
1071 dispatch.CmdCopyImage = reinterpret_cast<PFN_vkCmdCopyImage>(get_proc_addr(device, "vkCmdCopyImage"));
1072 if (UNLIKELY(!dispatch.CmdCopyImage)) {
1073 ALOGE("missing device proc: %s", "vkCmdCopyImage");
1074 success = false;
1075 }
1076 dispatch.CmdBlitImage = reinterpret_cast<PFN_vkCmdBlitImage>(get_proc_addr(device, "vkCmdBlitImage"));
1077 if (UNLIKELY(!dispatch.CmdBlitImage)) {
1078 ALOGE("missing device proc: %s", "vkCmdBlitImage");
1079 success = false;
1080 }
1081 dispatch.CmdCopyBufferToImage = reinterpret_cast<PFN_vkCmdCopyBufferToImage>(get_proc_addr(device, "vkCmdCopyBufferToImage"));
1082 if (UNLIKELY(!dispatch.CmdCopyBufferToImage)) {
1083 ALOGE("missing device proc: %s", "vkCmdCopyBufferToImage");
1084 success = false;
1085 }
1086 dispatch.CmdCopyImageToBuffer = reinterpret_cast<PFN_vkCmdCopyImageToBuffer>(get_proc_addr(device, "vkCmdCopyImageToBuffer"));
1087 if (UNLIKELY(!dispatch.CmdCopyImageToBuffer)) {
1088 ALOGE("missing device proc: %s", "vkCmdCopyImageToBuffer");
1089 success = false;
1090 }
1091 dispatch.CmdUpdateBuffer = reinterpret_cast<PFN_vkCmdUpdateBuffer>(get_proc_addr(device, "vkCmdUpdateBuffer"));
1092 if (UNLIKELY(!dispatch.CmdUpdateBuffer)) {
1093 ALOGE("missing device proc: %s", "vkCmdUpdateBuffer");
1094 success = false;
1095 }
1096 dispatch.CmdFillBuffer = reinterpret_cast<PFN_vkCmdFillBuffer>(get_proc_addr(device, "vkCmdFillBuffer"));
1097 if (UNLIKELY(!dispatch.CmdFillBuffer)) {
1098 ALOGE("missing device proc: %s", "vkCmdFillBuffer");
1099 success = false;
1100 }
1101 dispatch.CmdClearColorImage = reinterpret_cast<PFN_vkCmdClearColorImage>(get_proc_addr(device, "vkCmdClearColorImage"));
1102 if (UNLIKELY(!dispatch.CmdClearColorImage)) {
1103 ALOGE("missing device proc: %s", "vkCmdClearColorImage");
1104 success = false;
1105 }
1106 dispatch.CmdClearDepthStencilImage = reinterpret_cast<PFN_vkCmdClearDepthStencilImage>(get_proc_addr(device, "vkCmdClearDepthStencilImage"));
1107 if (UNLIKELY(!dispatch.CmdClearDepthStencilImage)) {
1108 ALOGE("missing device proc: %s", "vkCmdClearDepthStencilImage");
1109 success = false;
1110 }
1111 dispatch.CmdClearAttachments = reinterpret_cast<PFN_vkCmdClearAttachments>(get_proc_addr(device, "vkCmdClearAttachments"));
1112 if (UNLIKELY(!dispatch.CmdClearAttachments)) {
1113 ALOGE("missing device proc: %s", "vkCmdClearAttachments");
1114 success = false;
1115 }
1116 dispatch.CmdResolveImage = reinterpret_cast<PFN_vkCmdResolveImage>(get_proc_addr(device, "vkCmdResolveImage"));
1117 if (UNLIKELY(!dispatch.CmdResolveImage)) {
1118 ALOGE("missing device proc: %s", "vkCmdResolveImage");
1119 success = false;
1120 }
1121 dispatch.CmdSetEvent = reinterpret_cast<PFN_vkCmdSetEvent>(get_proc_addr(device, "vkCmdSetEvent"));
1122 if (UNLIKELY(!dispatch.CmdSetEvent)) {
1123 ALOGE("missing device proc: %s", "vkCmdSetEvent");
1124 success = false;
1125 }
1126 dispatch.CmdResetEvent = reinterpret_cast<PFN_vkCmdResetEvent>(get_proc_addr(device, "vkCmdResetEvent"));
1127 if (UNLIKELY(!dispatch.CmdResetEvent)) {
1128 ALOGE("missing device proc: %s", "vkCmdResetEvent");
1129 success = false;
1130 }
1131 dispatch.CmdWaitEvents = reinterpret_cast<PFN_vkCmdWaitEvents>(get_proc_addr(device, "vkCmdWaitEvents"));
1132 if (UNLIKELY(!dispatch.CmdWaitEvents)) {
1133 ALOGE("missing device proc: %s", "vkCmdWaitEvents");
1134 success = false;
1135 }
1136 dispatch.CmdPipelineBarrier = reinterpret_cast<PFN_vkCmdPipelineBarrier>(get_proc_addr(device, "vkCmdPipelineBarrier"));
1137 if (UNLIKELY(!dispatch.CmdPipelineBarrier)) {
1138 ALOGE("missing device proc: %s", "vkCmdPipelineBarrier");
1139 success = false;
1140 }
1141 dispatch.CmdBeginQuery = reinterpret_cast<PFN_vkCmdBeginQuery>(get_proc_addr(device, "vkCmdBeginQuery"));
1142 if (UNLIKELY(!dispatch.CmdBeginQuery)) {
1143 ALOGE("missing device proc: %s", "vkCmdBeginQuery");
1144 success = false;
1145 }
1146 dispatch.CmdEndQuery = reinterpret_cast<PFN_vkCmdEndQuery>(get_proc_addr(device, "vkCmdEndQuery"));
1147 if (UNLIKELY(!dispatch.CmdEndQuery)) {
1148 ALOGE("missing device proc: %s", "vkCmdEndQuery");
1149 success = false;
1150 }
1151 dispatch.CmdResetQueryPool = reinterpret_cast<PFN_vkCmdResetQueryPool>(get_proc_addr(device, "vkCmdResetQueryPool"));
1152 if (UNLIKELY(!dispatch.CmdResetQueryPool)) {
1153 ALOGE("missing device proc: %s", "vkCmdResetQueryPool");
1154 success = false;
1155 }
1156 dispatch.CmdWriteTimestamp = reinterpret_cast<PFN_vkCmdWriteTimestamp>(get_proc_addr(device, "vkCmdWriteTimestamp"));
1157 if (UNLIKELY(!dispatch.CmdWriteTimestamp)) {
1158 ALOGE("missing device proc: %s", "vkCmdWriteTimestamp");
1159 success = false;
1160 }
1161 dispatch.CmdCopyQueryPoolResults = reinterpret_cast<PFN_vkCmdCopyQueryPoolResults>(get_proc_addr(device, "vkCmdCopyQueryPoolResults"));
1162 if (UNLIKELY(!dispatch.CmdCopyQueryPoolResults)) {
1163 ALOGE("missing device proc: %s", "vkCmdCopyQueryPoolResults");
1164 success = false;
1165 }
1166 dispatch.CmdPushConstants = reinterpret_cast<PFN_vkCmdPushConstants>(get_proc_addr(device, "vkCmdPushConstants"));
1167 if (UNLIKELY(!dispatch.CmdPushConstants)) {
1168 ALOGE("missing device proc: %s", "vkCmdPushConstants");
1169 success = false;
1170 }
1171 dispatch.CmdBeginRenderPass = reinterpret_cast<PFN_vkCmdBeginRenderPass>(get_proc_addr(device, "vkCmdBeginRenderPass"));
1172 if (UNLIKELY(!dispatch.CmdBeginRenderPass)) {
1173 ALOGE("missing device proc: %s", "vkCmdBeginRenderPass");
1174 success = false;
1175 }
1176 dispatch.CmdNextSubpass = reinterpret_cast<PFN_vkCmdNextSubpass>(get_proc_addr(device, "vkCmdNextSubpass"));
1177 if (UNLIKELY(!dispatch.CmdNextSubpass)) {
1178 ALOGE("missing device proc: %s", "vkCmdNextSubpass");
1179 success = false;
1180 }
1181 dispatch.CmdEndRenderPass = reinterpret_cast<PFN_vkCmdEndRenderPass>(get_proc_addr(device, "vkCmdEndRenderPass"));
1182 if (UNLIKELY(!dispatch.CmdEndRenderPass)) {
1183 ALOGE("missing device proc: %s", "vkCmdEndRenderPass");
1184 success = false;
1185 }
1186 dispatch.CmdExecuteCommands = reinterpret_cast<PFN_vkCmdExecuteCommands>(get_proc_addr(device, "vkCmdExecuteCommands"));
1187 if (UNLIKELY(!dispatch.CmdExecuteCommands)) {
1188 ALOGE("missing device proc: %s", "vkCmdExecuteCommands");
1189 success = false;
1190 }
1191 dispatch.CreateSwapchainKHR = reinterpret_cast<PFN_vkCreateSwapchainKHR>(get_proc_addr(device, "vkCreateSwapchainKHR"));
1192 if (UNLIKELY(!dispatch.CreateSwapchainKHR)) {
1193 ALOGE("missing device proc: %s", "vkCreateSwapchainKHR");
1194 success = false;
1195 }
1196 dispatch.DestroySwapchainKHR = reinterpret_cast<PFN_vkDestroySwapchainKHR>(get_proc_addr(device, "vkDestroySwapchainKHR"));
1197 if (UNLIKELY(!dispatch.DestroySwapchainKHR)) {
1198 ALOGE("missing device proc: %s", "vkDestroySwapchainKHR");
1199 success = false;
1200 }
1201 dispatch.GetSwapchainImagesKHR = reinterpret_cast<PFN_vkGetSwapchainImagesKHR>(get_proc_addr(device, "vkGetSwapchainImagesKHR"));
1202 if (UNLIKELY(!dispatch.GetSwapchainImagesKHR)) {
1203 ALOGE("missing device proc: %s", "vkGetSwapchainImagesKHR");
1204 success = false;
1205 }
1206 dispatch.AcquireNextImageKHR = reinterpret_cast<PFN_vkAcquireNextImageKHR>(get_proc_addr(device, "vkAcquireNextImageKHR"));
1207 if (UNLIKELY(!dispatch.AcquireNextImageKHR)) {
1208 ALOGE("missing device proc: %s", "vkAcquireNextImageKHR");
1209 success = false;
1210 }
1211 dispatch.QueuePresentKHR = reinterpret_cast<PFN_vkQueuePresentKHR>(get_proc_addr(device, "vkQueuePresentKHR"));
1212 if (UNLIKELY(!dispatch.QueuePresentKHR)) {
1213 ALOGE("missing device proc: %s", "vkQueuePresentKHR");
1214 success = false;
1215 }
1216 // clang-format on
1217 return success;
1218}
1219
1220bool LoadDriverDispatchTable(VkInstance instance,
1221 PFN_vkGetInstanceProcAddr get_proc_addr,
Jesse Hall6bd5dfa2016-01-16 17:13:30 -08001222 const InstanceExtensionSet& extensions,
Jesse Hall1f91d392015-12-11 16:28:44 -08001223 DriverDispatchTable& dispatch) {
1224 bool success = true;
1225 // clang-format off
1226 dispatch.DestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(get_proc_addr(instance, "vkDestroyInstance"));
1227 if (UNLIKELY(!dispatch.DestroyInstance)) {
1228 ALOGE("missing driver proc: %s", "vkDestroyInstance");
1229 success = false;
1230 }
1231 dispatch.EnumeratePhysicalDevices = reinterpret_cast<PFN_vkEnumeratePhysicalDevices>(get_proc_addr(instance, "vkEnumeratePhysicalDevices"));
1232 if (UNLIKELY(!dispatch.EnumeratePhysicalDevices)) {
1233 ALOGE("missing driver proc: %s", "vkEnumeratePhysicalDevices");
1234 success = false;
1235 }
1236 dispatch.GetPhysicalDeviceProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceProperties"));
1237 if (UNLIKELY(!dispatch.GetPhysicalDeviceProperties)) {
1238 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceProperties");
1239 success = false;
1240 }
1241 dispatch.GetPhysicalDeviceQueueFamilyProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueFamilyProperties"));
1242 if (UNLIKELY(!dispatch.GetPhysicalDeviceQueueFamilyProperties)) {
1243 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceQueueFamilyProperties");
1244 success = false;
1245 }
1246 dispatch.GetPhysicalDeviceMemoryProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceMemoryProperties"));
1247 if (UNLIKELY(!dispatch.GetPhysicalDeviceMemoryProperties)) {
1248 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceMemoryProperties");
1249 success = false;
1250 }
1251 dispatch.GetPhysicalDeviceFeatures = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures>(get_proc_addr(instance, "vkGetPhysicalDeviceFeatures"));
1252 if (UNLIKELY(!dispatch.GetPhysicalDeviceFeatures)) {
1253 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceFeatures");
1254 success = false;
1255 }
1256 dispatch.GetPhysicalDeviceFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceFormatProperties"));
1257 if (UNLIKELY(!dispatch.GetPhysicalDeviceFormatProperties)) {
1258 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceFormatProperties");
1259 success = false;
1260 }
1261 dispatch.GetPhysicalDeviceImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceImageFormatProperties"));
1262 if (UNLIKELY(!dispatch.GetPhysicalDeviceImageFormatProperties)) {
1263 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceImageFormatProperties");
1264 success = false;
1265 }
1266 dispatch.CreateDevice = reinterpret_cast<PFN_vkCreateDevice>(get_proc_addr(instance, "vkCreateDevice"));
1267 if (UNLIKELY(!dispatch.CreateDevice)) {
1268 ALOGE("missing driver proc: %s", "vkCreateDevice");
1269 success = false;
1270 }
1271 dispatch.EnumerateDeviceLayerProperties = reinterpret_cast<PFN_vkEnumerateDeviceLayerProperties>(get_proc_addr(instance, "vkEnumerateDeviceLayerProperties"));
1272 if (UNLIKELY(!dispatch.EnumerateDeviceLayerProperties)) {
1273 ALOGE("missing driver proc: %s", "vkEnumerateDeviceLayerProperties");
1274 success = false;
1275 }
1276 dispatch.EnumerateDeviceExtensionProperties = reinterpret_cast<PFN_vkEnumerateDeviceExtensionProperties>(get_proc_addr(instance, "vkEnumerateDeviceExtensionProperties"));
1277 if (UNLIKELY(!dispatch.EnumerateDeviceExtensionProperties)) {
1278 ALOGE("missing driver proc: %s", "vkEnumerateDeviceExtensionProperties");
1279 success = false;
1280 }
1281 dispatch.GetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties"));
1282 if (UNLIKELY(!dispatch.GetPhysicalDeviceSparseImageFormatProperties)) {
1283 ALOGE("missing driver proc: %s", "vkGetPhysicalDeviceSparseImageFormatProperties");
1284 success = false;
1285 }
Jesse Hall715b86a2016-01-16 16:34:29 -08001286 if (extensions[kEXT_debug_report]) {
1287 dispatch.CreateDebugReportCallbackEXT = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(get_proc_addr(instance, "vkCreateDebugReportCallbackEXT"));
1288 if (UNLIKELY(!dispatch.CreateDebugReportCallbackEXT)) {
1289 ALOGE("missing driver proc: %s", "vkCreateDebugReportCallbackEXT");
1290 success = false;
1291 }
1292 }
1293 if (extensions[kEXT_debug_report]) {
1294 dispatch.DestroyDebugReportCallbackEXT = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(get_proc_addr(instance, "vkDestroyDebugReportCallbackEXT"));
1295 if (UNLIKELY(!dispatch.DestroyDebugReportCallbackEXT)) {
1296 ALOGE("missing driver proc: %s", "vkDestroyDebugReportCallbackEXT");
1297 success = false;
1298 }
1299 }
1300 if (extensions[kEXT_debug_report]) {
1301 dispatch.DebugReportMessageEXT = reinterpret_cast<PFN_vkDebugReportMessageEXT>(get_proc_addr(instance, "vkDebugReportMessageEXT"));
1302 if (UNLIKELY(!dispatch.DebugReportMessageEXT)) {
1303 ALOGE("missing driver proc: %s", "vkDebugReportMessageEXT");
1304 success = false;
1305 }
1306 }
Jesse Hall1f91d392015-12-11 16:28:44 -08001307 dispatch.GetDeviceProcAddr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(get_proc_addr(instance, "vkGetDeviceProcAddr"));
1308 if (UNLIKELY(!dispatch.GetDeviceProcAddr)) {
1309 ALOGE("missing driver proc: %s", "vkGetDeviceProcAddr");
1310 success = false;
1311 }
1312 dispatch.CreateImage = reinterpret_cast<PFN_vkCreateImage>(get_proc_addr(instance, "vkCreateImage"));
1313 if (UNLIKELY(!dispatch.CreateImage)) {
1314 ALOGE("missing driver proc: %s", "vkCreateImage");
1315 success = false;
1316 }
1317 dispatch.DestroyImage = reinterpret_cast<PFN_vkDestroyImage>(get_proc_addr(instance, "vkDestroyImage"));
1318 if (UNLIKELY(!dispatch.DestroyImage)) {
1319 ALOGE("missing driver proc: %s", "vkDestroyImage");
1320 success = false;
1321 }
Jesse Halld9132822016-01-14 15:50:52 -08001322 dispatch.GetSwapchainGrallocUsageANDROID = reinterpret_cast<PFN_vkGetSwapchainGrallocUsageANDROID>(get_proc_addr(instance, "vkGetSwapchainGrallocUsageANDROID"));
1323 if (UNLIKELY(!dispatch.GetSwapchainGrallocUsageANDROID)) {
1324 ALOGE("missing driver proc: %s", "vkGetSwapchainGrallocUsageANDROID");
1325 success = false;
1326 }
Jesse Hall1f91d392015-12-11 16:28:44 -08001327 dispatch.AcquireImageANDROID = reinterpret_cast<PFN_vkAcquireImageANDROID>(get_proc_addr(instance, "vkAcquireImageANDROID"));
1328 if (UNLIKELY(!dispatch.AcquireImageANDROID)) {
1329 ALOGE("missing driver proc: %s", "vkAcquireImageANDROID");
1330 success = false;
1331 }
1332 dispatch.QueueSignalReleaseImageANDROID = reinterpret_cast<PFN_vkQueueSignalReleaseImageANDROID>(get_proc_addr(instance, "vkQueueSignalReleaseImageANDROID"));
1333 if (UNLIKELY(!dispatch.QueueSignalReleaseImageANDROID)) {
1334 ALOGE("missing driver proc: %s", "vkQueueSignalReleaseImageANDROID");
1335 success = false;
1336 }
1337 // clang-format on
1338 return success;
1339}
1340
1341} // namespace vulkan
1342
1343// clang-format off
1344
1345__attribute__((visibility("default")))
1346VKAPI_ATTR VkResult vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) {
1347 return CreateInstance_Top(pCreateInfo, pAllocator, pInstance);
1348}
1349
1350__attribute__((visibility("default")))
1351VKAPI_ATTR void vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) {
1352 DestroyInstance_Top(instance, pAllocator);
1353}
1354
1355__attribute__((visibility("default")))
1356VKAPI_ATTR VkResult vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) {
1357 return GetDispatchTable(instance).EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
1358}
1359
1360__attribute__((visibility("default")))
1361VKAPI_ATTR PFN_vkVoidFunction vkGetDeviceProcAddr(VkDevice device, const char* pName) {
1362 return GetDeviceProcAddr_Top(device, pName);
1363}
1364
1365__attribute__((visibility("default")))
1366VKAPI_ATTR PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance instance, const char* pName) {
1367 return GetInstanceProcAddr_Top(instance, pName);
1368}
1369
1370__attribute__((visibility("default")))
1371VKAPI_ATTR void vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) {
1372 GetDispatchTable(physicalDevice).GetPhysicalDeviceProperties(physicalDevice, pProperties);
1373}
1374
1375__attribute__((visibility("default")))
1376VKAPI_ATTR void vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) {
1377 GetDispatchTable(physicalDevice).GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
1378}
1379
1380__attribute__((visibility("default")))
1381VKAPI_ATTR void vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
1382 GetDispatchTable(physicalDevice).GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
1383}
1384
1385__attribute__((visibility("default")))
1386VKAPI_ATTR void vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {
1387 GetDispatchTable(physicalDevice).GetPhysicalDeviceFeatures(physicalDevice, pFeatures);
1388}
1389
1390__attribute__((visibility("default")))
1391VKAPI_ATTR void vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {
1392 GetDispatchTable(physicalDevice).GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
1393}
1394
1395__attribute__((visibility("default")))
1396VKAPI_ATTR VkResult vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
1397 return GetDispatchTable(physicalDevice).GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
1398}
1399
1400__attribute__((visibility("default")))
1401VKAPI_ATTR VkResult vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
1402 return GetDispatchTable(physicalDevice).CreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice);
1403}
1404
1405__attribute__((visibility("default")))
1406VKAPI_ATTR void vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {
1407 DestroyDevice_Top(device, pAllocator);
1408}
1409
1410__attribute__((visibility("default")))
1411VKAPI_ATTR VkResult vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties) {
1412 return EnumerateInstanceLayerProperties_Top(pPropertyCount, pProperties);
1413}
1414
1415__attribute__((visibility("default")))
1416VKAPI_ATTR VkResult vkEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) {
1417 return EnumerateInstanceExtensionProperties_Top(pLayerName, pPropertyCount, pProperties);
1418}
1419
1420__attribute__((visibility("default")))
1421VKAPI_ATTR VkResult vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties) {
1422 return GetDispatchTable(physicalDevice).EnumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
1423}
1424
1425__attribute__((visibility("default")))
1426VKAPI_ATTR VkResult vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) {
1427 return GetDispatchTable(physicalDevice).EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pPropertyCount, pProperties);
1428}
1429
1430__attribute__((visibility("default")))
1431VKAPI_ATTR void vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) {
1432 GetDeviceQueue_Top(device, queueFamilyIndex, queueIndex, pQueue);
1433}
1434
1435__attribute__((visibility("default")))
1436VKAPI_ATTR VkResult vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) {
1437 return GetDispatchTable(queue).QueueSubmit(queue, submitCount, pSubmits, fence);
1438}
1439
1440__attribute__((visibility("default")))
1441VKAPI_ATTR VkResult vkQueueWaitIdle(VkQueue queue) {
1442 return GetDispatchTable(queue).QueueWaitIdle(queue);
1443}
1444
1445__attribute__((visibility("default")))
1446VKAPI_ATTR VkResult vkDeviceWaitIdle(VkDevice device) {
1447 return GetDispatchTable(device).DeviceWaitIdle(device);
1448}
1449
1450__attribute__((visibility("default")))
1451VKAPI_ATTR VkResult vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) {
1452 return GetDispatchTable(device).AllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
1453}
1454
1455__attribute__((visibility("default")))
1456VKAPI_ATTR void vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) {
1457 GetDispatchTable(device).FreeMemory(device, memory, pAllocator);
1458}
1459
1460__attribute__((visibility("default")))
1461VKAPI_ATTR VkResult vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) {
1462 return GetDispatchTable(device).MapMemory(device, memory, offset, size, flags, ppData);
1463}
1464
1465__attribute__((visibility("default")))
1466VKAPI_ATTR void vkUnmapMemory(VkDevice device, VkDeviceMemory memory) {
1467 GetDispatchTable(device).UnmapMemory(device, memory);
1468}
1469
1470__attribute__((visibility("default")))
1471VKAPI_ATTR VkResult vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) {
1472 return GetDispatchTable(device).FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1473}
1474
1475__attribute__((visibility("default")))
1476VKAPI_ATTR VkResult vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) {
1477 return GetDispatchTable(device).InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
1478}
1479
1480__attribute__((visibility("default")))
1481VKAPI_ATTR void vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {
1482 GetDispatchTable(device).GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes);
1483}
1484
1485__attribute__((visibility("default")))
1486VKAPI_ATTR void vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) {
1487 GetDispatchTable(device).GetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
1488}
1489
1490__attribute__((visibility("default")))
1491VKAPI_ATTR VkResult vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) {
1492 return GetDispatchTable(device).BindBufferMemory(device, buffer, memory, memoryOffset);
1493}
1494
1495__attribute__((visibility("default")))
1496VKAPI_ATTR void vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) {
1497 GetDispatchTable(device).GetImageMemoryRequirements(device, image, pMemoryRequirements);
1498}
1499
1500__attribute__((visibility("default")))
1501VKAPI_ATTR VkResult vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) {
1502 return GetDispatchTable(device).BindImageMemory(device, image, memory, memoryOffset);
1503}
1504
1505__attribute__((visibility("default")))
1506VKAPI_ATTR void vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
1507 GetDispatchTable(device).GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
1508}
1509
1510__attribute__((visibility("default")))
1511VKAPI_ATTR void vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) {
1512 GetDispatchTable(physicalDevice).GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
1513}
1514
1515__attribute__((visibility("default")))
1516VKAPI_ATTR VkResult vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {
1517 return GetDispatchTable(queue).QueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
1518}
1519
1520__attribute__((visibility("default")))
1521VKAPI_ATTR VkResult vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
1522 return GetDispatchTable(device).CreateFence(device, pCreateInfo, pAllocator, pFence);
1523}
1524
1525__attribute__((visibility("default")))
1526VKAPI_ATTR void vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) {
1527 GetDispatchTable(device).DestroyFence(device, fence, pAllocator);
1528}
1529
1530__attribute__((visibility("default")))
1531VKAPI_ATTR VkResult vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
1532 return GetDispatchTable(device).ResetFences(device, fenceCount, pFences);
1533}
1534
1535__attribute__((visibility("default")))
1536VKAPI_ATTR VkResult vkGetFenceStatus(VkDevice device, VkFence fence) {
1537 return GetDispatchTable(device).GetFenceStatus(device, fence);
1538}
1539
1540__attribute__((visibility("default")))
1541VKAPI_ATTR VkResult vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {
1542 return GetDispatchTable(device).WaitForFences(device, fenceCount, pFences, waitAll, timeout);
1543}
1544
1545__attribute__((visibility("default")))
1546VKAPI_ATTR VkResult vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) {
1547 return GetDispatchTable(device).CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore);
1548}
1549
1550__attribute__((visibility("default")))
1551VKAPI_ATTR void vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) {
1552 GetDispatchTable(device).DestroySemaphore(device, semaphore, pAllocator);
1553}
1554
1555__attribute__((visibility("default")))
1556VKAPI_ATTR VkResult vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) {
1557 return GetDispatchTable(device).CreateEvent(device, pCreateInfo, pAllocator, pEvent);
1558}
1559
1560__attribute__((visibility("default")))
1561VKAPI_ATTR void vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) {
1562 GetDispatchTable(device).DestroyEvent(device, event, pAllocator);
1563}
1564
1565__attribute__((visibility("default")))
1566VKAPI_ATTR VkResult vkGetEventStatus(VkDevice device, VkEvent event) {
1567 return GetDispatchTable(device).GetEventStatus(device, event);
1568}
1569
1570__attribute__((visibility("default")))
1571VKAPI_ATTR VkResult vkSetEvent(VkDevice device, VkEvent event) {
1572 return GetDispatchTable(device).SetEvent(device, event);
1573}
1574
1575__attribute__((visibility("default")))
1576VKAPI_ATTR VkResult vkResetEvent(VkDevice device, VkEvent event) {
1577 return GetDispatchTable(device).ResetEvent(device, event);
1578}
1579
1580__attribute__((visibility("default")))
1581VKAPI_ATTR VkResult vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) {
1582 return GetDispatchTable(device).CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool);
1583}
1584
1585__attribute__((visibility("default")))
1586VKAPI_ATTR void vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) {
1587 GetDispatchTable(device).DestroyQueryPool(device, queryPool, pAllocator);
1588}
1589
1590__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001591VKAPI_ATTR VkResult vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) {
1592 return GetDispatchTable(device).GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags);
Jesse Hall1f91d392015-12-11 16:28:44 -08001593}
1594
1595__attribute__((visibility("default")))
1596VKAPI_ATTR VkResult vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) {
1597 return GetDispatchTable(device).CreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
1598}
1599
1600__attribute__((visibility("default")))
1601VKAPI_ATTR void vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) {
1602 GetDispatchTable(device).DestroyBuffer(device, buffer, pAllocator);
1603}
1604
1605__attribute__((visibility("default")))
1606VKAPI_ATTR VkResult vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView) {
1607 return GetDispatchTable(device).CreateBufferView(device, pCreateInfo, pAllocator, pView);
1608}
1609
1610__attribute__((visibility("default")))
1611VKAPI_ATTR void vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) {
1612 GetDispatchTable(device).DestroyBufferView(device, bufferView, pAllocator);
1613}
1614
1615__attribute__((visibility("default")))
1616VKAPI_ATTR VkResult vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) {
1617 return GetDispatchTable(device).CreateImage(device, pCreateInfo, pAllocator, pImage);
1618}
1619
1620__attribute__((visibility("default")))
1621VKAPI_ATTR void vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) {
1622 GetDispatchTable(device).DestroyImage(device, image, pAllocator);
1623}
1624
1625__attribute__((visibility("default")))
1626VKAPI_ATTR void vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
1627 GetDispatchTable(device).GetImageSubresourceLayout(device, image, pSubresource, pLayout);
1628}
1629
1630__attribute__((visibility("default")))
1631VKAPI_ATTR VkResult vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) {
1632 return GetDispatchTable(device).CreateImageView(device, pCreateInfo, pAllocator, pView);
1633}
1634
1635__attribute__((visibility("default")))
1636VKAPI_ATTR void vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) {
1637 GetDispatchTable(device).DestroyImageView(device, imageView, pAllocator);
1638}
1639
1640__attribute__((visibility("default")))
1641VKAPI_ATTR VkResult vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) {
1642 return GetDispatchTable(device).CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
1643}
1644
1645__attribute__((visibility("default")))
1646VKAPI_ATTR void vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) {
1647 GetDispatchTable(device).DestroyShaderModule(device, shaderModule, pAllocator);
1648}
1649
1650__attribute__((visibility("default")))
1651VKAPI_ATTR VkResult vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) {
1652 return GetDispatchTable(device).CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
1653}
1654
1655__attribute__((visibility("default")))
1656VKAPI_ATTR void vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) {
1657 GetDispatchTable(device).DestroyPipelineCache(device, pipelineCache, pAllocator);
1658}
1659
1660__attribute__((visibility("default")))
1661VKAPI_ATTR VkResult vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {
1662 return GetDispatchTable(device).GetPipelineCacheData(device, pipelineCache, pDataSize, pData);
1663}
1664
1665__attribute__((visibility("default")))
1666VKAPI_ATTR VkResult vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {
1667 return GetDispatchTable(device).MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches);
1668}
1669
1670__attribute__((visibility("default")))
1671VKAPI_ATTR VkResult vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {
1672 return GetDispatchTable(device).CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
1673}
1674
1675__attribute__((visibility("default")))
1676VKAPI_ATTR VkResult vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {
1677 return GetDispatchTable(device).CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
1678}
1679
1680__attribute__((visibility("default")))
1681VKAPI_ATTR void vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) {
1682 GetDispatchTable(device).DestroyPipeline(device, pipeline, pAllocator);
1683}
1684
1685__attribute__((visibility("default")))
1686VKAPI_ATTR VkResult vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) {
1687 return GetDispatchTable(device).CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout);
1688}
1689
1690__attribute__((visibility("default")))
1691VKAPI_ATTR void vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) {
1692 GetDispatchTable(device).DestroyPipelineLayout(device, pipelineLayout, pAllocator);
1693}
1694
1695__attribute__((visibility("default")))
1696VKAPI_ATTR VkResult vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) {
1697 return GetDispatchTable(device).CreateSampler(device, pCreateInfo, pAllocator, pSampler);
1698}
1699
1700__attribute__((visibility("default")))
1701VKAPI_ATTR void vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) {
1702 GetDispatchTable(device).DestroySampler(device, sampler, pAllocator);
1703}
1704
1705__attribute__((visibility("default")))
1706VKAPI_ATTR VkResult vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) {
1707 return GetDispatchTable(device).CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
1708}
1709
1710__attribute__((visibility("default")))
1711VKAPI_ATTR void vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) {
1712 GetDispatchTable(device).DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
1713}
1714
1715__attribute__((visibility("default")))
1716VKAPI_ATTR VkResult vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) {
1717 return GetDispatchTable(device).CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
1718}
1719
1720__attribute__((visibility("default")))
1721VKAPI_ATTR void vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) {
1722 GetDispatchTable(device).DestroyDescriptorPool(device, descriptorPool, pAllocator);
1723}
1724
1725__attribute__((visibility("default")))
1726VKAPI_ATTR VkResult vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {
1727 return GetDispatchTable(device).ResetDescriptorPool(device, descriptorPool, flags);
1728}
1729
1730__attribute__((visibility("default")))
1731VKAPI_ATTR VkResult vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) {
1732 return GetDispatchTable(device).AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
1733}
1734
1735__attribute__((visibility("default")))
1736VKAPI_ATTR VkResult vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) {
1737 return GetDispatchTable(device).FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
1738}
1739
1740__attribute__((visibility("default")))
1741VKAPI_ATTR void vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
1742 GetDispatchTable(device).UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
1743}
1744
1745__attribute__((visibility("default")))
1746VKAPI_ATTR VkResult vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) {
1747 return GetDispatchTable(device).CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
1748}
1749
1750__attribute__((visibility("default")))
1751VKAPI_ATTR void vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) {
1752 GetDispatchTable(device).DestroyFramebuffer(device, framebuffer, pAllocator);
1753}
1754
1755__attribute__((visibility("default")))
1756VKAPI_ATTR VkResult vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) {
1757 return GetDispatchTable(device).CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
1758}
1759
1760__attribute__((visibility("default")))
1761VKAPI_ATTR void vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) {
1762 GetDispatchTable(device).DestroyRenderPass(device, renderPass, pAllocator);
1763}
1764
1765__attribute__((visibility("default")))
1766VKAPI_ATTR void vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
1767 GetDispatchTable(device).GetRenderAreaGranularity(device, renderPass, pGranularity);
1768}
1769
1770__attribute__((visibility("default")))
1771VKAPI_ATTR VkResult vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) {
1772 return GetDispatchTable(device).CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
1773}
1774
1775__attribute__((visibility("default")))
1776VKAPI_ATTR void vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) {
1777 GetDispatchTable(device).DestroyCommandPool(device, commandPool, pAllocator);
1778}
1779
1780__attribute__((visibility("default")))
1781VKAPI_ATTR VkResult vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) {
1782 return GetDispatchTable(device).ResetCommandPool(device, commandPool, flags);
1783}
1784
1785__attribute__((visibility("default")))
1786VKAPI_ATTR VkResult vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) {
1787 return AllocateCommandBuffers_Top(device, pAllocateInfo, pCommandBuffers);
1788}
1789
1790__attribute__((visibility("default")))
1791VKAPI_ATTR void vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {
1792 GetDispatchTable(device).FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
1793}
1794
1795__attribute__((visibility("default")))
1796VKAPI_ATTR VkResult vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {
1797 return GetDispatchTable(commandBuffer).BeginCommandBuffer(commandBuffer, pBeginInfo);
1798}
1799
1800__attribute__((visibility("default")))
1801VKAPI_ATTR VkResult vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
1802 return GetDispatchTable(commandBuffer).EndCommandBuffer(commandBuffer);
1803}
1804
1805__attribute__((visibility("default")))
1806VKAPI_ATTR VkResult vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) {
1807 return GetDispatchTable(commandBuffer).ResetCommandBuffer(commandBuffer, flags);
1808}
1809
1810__attribute__((visibility("default")))
1811VKAPI_ATTR void vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
1812 GetDispatchTable(commandBuffer).CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
1813}
1814
1815__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001816VKAPI_ATTR void vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {
1817 GetDispatchTable(commandBuffer).CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports);
Jesse Hall1f91d392015-12-11 16:28:44 -08001818}
1819
1820__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001821VKAPI_ATTR void vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {
1822 GetDispatchTable(commandBuffer).CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors);
Jesse Hall1f91d392015-12-11 16:28:44 -08001823}
1824
1825__attribute__((visibility("default")))
1826VKAPI_ATTR void vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {
1827 GetDispatchTable(commandBuffer).CmdSetLineWidth(commandBuffer, lineWidth);
1828}
1829
1830__attribute__((visibility("default")))
1831VKAPI_ATTR void vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) {
1832 GetDispatchTable(commandBuffer).CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
1833}
1834
1835__attribute__((visibility("default")))
1836VKAPI_ATTR void vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {
1837 GetDispatchTable(commandBuffer).CmdSetBlendConstants(commandBuffer, blendConstants);
1838}
1839
1840__attribute__((visibility("default")))
1841VKAPI_ATTR void vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) {
1842 GetDispatchTable(commandBuffer).CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds);
1843}
1844
1845__attribute__((visibility("default")))
1846VKAPI_ATTR void vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) {
1847 GetDispatchTable(commandBuffer).CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask);
1848}
1849
1850__attribute__((visibility("default")))
1851VKAPI_ATTR void vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) {
1852 GetDispatchTable(commandBuffer).CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask);
1853}
1854
1855__attribute__((visibility("default")))
1856VKAPI_ATTR void vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) {
1857 GetDispatchTable(commandBuffer).CmdSetStencilReference(commandBuffer, faceMask, reference);
1858}
1859
1860__attribute__((visibility("default")))
1861VKAPI_ATTR void vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
1862 GetDispatchTable(commandBuffer).CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
1863}
1864
1865__attribute__((visibility("default")))
1866VKAPI_ATTR void vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {
1867 GetDispatchTable(commandBuffer).CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType);
1868}
1869
1870__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001871VKAPI_ATTR void vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
1872 GetDispatchTable(commandBuffer).CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
Jesse Hall1f91d392015-12-11 16:28:44 -08001873}
1874
1875__attribute__((visibility("default")))
1876VKAPI_ATTR void vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
1877 GetDispatchTable(commandBuffer).CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
1878}
1879
1880__attribute__((visibility("default")))
1881VKAPI_ATTR void vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
1882 GetDispatchTable(commandBuffer).CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
1883}
1884
1885__attribute__((visibility("default")))
1886VKAPI_ATTR void vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
1887 GetDispatchTable(commandBuffer).CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
1888}
1889
1890__attribute__((visibility("default")))
1891VKAPI_ATTR void vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {
1892 GetDispatchTable(commandBuffer).CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
1893}
1894
1895__attribute__((visibility("default")))
1896VKAPI_ATTR void vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) {
1897 GetDispatchTable(commandBuffer).CmdDispatch(commandBuffer, x, y, z);
1898}
1899
1900__attribute__((visibility("default")))
1901VKAPI_ATTR void vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) {
1902 GetDispatchTable(commandBuffer).CmdDispatchIndirect(commandBuffer, buffer, offset);
1903}
1904
1905__attribute__((visibility("default")))
1906VKAPI_ATTR void vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {
1907 GetDispatchTable(commandBuffer).CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
1908}
1909
1910__attribute__((visibility("default")))
1911VKAPI_ATTR void vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {
1912 GetDispatchTable(commandBuffer).CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
1913}
1914
1915__attribute__((visibility("default")))
1916VKAPI_ATTR void vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) {
1917 GetDispatchTable(commandBuffer).CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
1918}
1919
1920__attribute__((visibility("default")))
1921VKAPI_ATTR void vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
1922 GetDispatchTable(commandBuffer).CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
1923}
1924
1925__attribute__((visibility("default")))
1926VKAPI_ATTR void vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {
1927 GetDispatchTable(commandBuffer).CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
1928}
1929
1930__attribute__((visibility("default")))
1931VKAPI_ATTR void vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t* pData) {
1932 GetDispatchTable(commandBuffer).CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData);
1933}
1934
1935__attribute__((visibility("default")))
1936VKAPI_ATTR void vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {
1937 GetDispatchTable(commandBuffer).CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data);
1938}
1939
1940__attribute__((visibility("default")))
1941VKAPI_ATTR void vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
1942 GetDispatchTable(commandBuffer).CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
1943}
1944
1945__attribute__((visibility("default")))
1946VKAPI_ATTR void vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
1947 GetDispatchTable(commandBuffer).CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
1948}
1949
1950__attribute__((visibility("default")))
1951VKAPI_ATTR void vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {
1952 GetDispatchTable(commandBuffer).CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
1953}
1954
1955__attribute__((visibility("default")))
1956VKAPI_ATTR void vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
1957 GetDispatchTable(commandBuffer).CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
1958}
1959
1960__attribute__((visibility("default")))
1961VKAPI_ATTR void vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
1962 GetDispatchTable(commandBuffer).CmdSetEvent(commandBuffer, event, stageMask);
1963}
1964
1965__attribute__((visibility("default")))
1966VKAPI_ATTR void vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {
1967 GetDispatchTable(commandBuffer).CmdResetEvent(commandBuffer, event, stageMask);
1968}
1969
1970__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08001971VKAPI_ATTR void vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
1972 GetDispatchTable(commandBuffer).CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
Jesse Hall1f91d392015-12-11 16:28:44 -08001973}
1974
1975__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08001976VKAPI_ATTR void vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
1977 GetDispatchTable(commandBuffer).CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
Jesse Hall1f91d392015-12-11 16:28:44 -08001978}
1979
1980__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08001981VKAPI_ATTR void vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) {
1982 GetDispatchTable(commandBuffer).CmdBeginQuery(commandBuffer, queryPool, query, flags);
Jesse Hall1f91d392015-12-11 16:28:44 -08001983}
1984
1985__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08001986VKAPI_ATTR void vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) {
1987 GetDispatchTable(commandBuffer).CmdEndQuery(commandBuffer, queryPool, query);
Jesse Hall1f91d392015-12-11 16:28:44 -08001988}
1989
1990__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001991VKAPI_ATTR void vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {
1992 GetDispatchTable(commandBuffer).CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount);
Jesse Hall1f91d392015-12-11 16:28:44 -08001993}
1994
1995__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08001996VKAPI_ATTR void vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) {
1997 GetDispatchTable(commandBuffer).CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query);
Jesse Hall1f91d392015-12-11 16:28:44 -08001998}
1999
2000__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002001VKAPI_ATTR void vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) {
2002 GetDispatchTable(commandBuffer).CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags);
Jesse Hall1f91d392015-12-11 16:28:44 -08002003}
2004
2005__attribute__((visibility("default")))
2006VKAPI_ATTR void vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues) {
2007 GetDispatchTable(commandBuffer).CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues);
2008}
2009
2010__attribute__((visibility("default")))
2011VKAPI_ATTR void vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {
2012 GetDispatchTable(commandBuffer).CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents);
2013}
2014
2015__attribute__((visibility("default")))
2016VKAPI_ATTR void vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {
2017 GetDispatchTable(commandBuffer).CmdNextSubpass(commandBuffer, contents);
2018}
2019
2020__attribute__((visibility("default")))
2021VKAPI_ATTR void vkCmdEndRenderPass(VkCommandBuffer commandBuffer) {
2022 GetDispatchTable(commandBuffer).CmdEndRenderPass(commandBuffer);
2023}
2024
2025__attribute__((visibility("default")))
Jesse Hall3dd678a2016-01-08 21:52:01 -08002026VKAPI_ATTR void vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {
2027 GetDispatchTable(commandBuffer).CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
Jesse Hall1f91d392015-12-11 16:28:44 -08002028}
2029
2030__attribute__((visibility("default")))
2031VKAPI_ATTR void vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) {
2032 GetDispatchTable(instance).DestroySurfaceKHR(instance, surface, pAllocator);
2033}
2034
2035__attribute__((visibility("default")))
2036VKAPI_ATTR VkResult vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) {
2037 return GetDispatchTable(physicalDevice).GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported);
2038}
2039
2040__attribute__((visibility("default")))
2041VKAPI_ATTR VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
2042 return GetDispatchTable(physicalDevice).GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities);
2043}
2044
2045__attribute__((visibility("default")))
2046VKAPI_ATTR VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) {
2047 return GetDispatchTable(physicalDevice).GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
2048}
2049
2050__attribute__((visibility("default")))
2051VKAPI_ATTR VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) {
2052 return GetDispatchTable(physicalDevice).GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes);
2053}
2054
2055__attribute__((visibility("default")))
2056VKAPI_ATTR VkResult vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) {
2057 return GetDispatchTable(device).CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
2058}
2059
2060__attribute__((visibility("default")))
2061VKAPI_ATTR void vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) {
2062 GetDispatchTable(device).DestroySwapchainKHR(device, swapchain, pAllocator);
2063}
2064
2065__attribute__((visibility("default")))
2066VKAPI_ATTR VkResult vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) {
2067 return GetDispatchTable(device).GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
2068}
2069
2070__attribute__((visibility("default")))
2071VKAPI_ATTR VkResult vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) {
2072 return GetDispatchTable(device).AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
2073}
2074
2075__attribute__((visibility("default")))
2076VKAPI_ATTR VkResult vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) {
2077 return GetDispatchTable(queue).QueuePresentKHR(queue, pPresentInfo);
2078}
2079
2080__attribute__((visibility("default")))
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002081VKAPI_ATTR VkResult vkCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
2082 return GetDispatchTable(instance).CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
Jesse Hall1f91d392015-12-11 16:28:44 -08002083}
2084
2085// clang-format on