blob: e4a91bc552b1338ed6ada8fadffd01538f0d6448 [file] [log] [blame]
Jon Ashburnd55a3942015-05-06 09:02:10 -06001/*
Jon Ashburnd55a3942015-05-06 09:02:10 -06002 *
Jon Ashburn23d36b12016-02-02 17:47:28 -07003 * Copyright (c) 2015-2016 The Khronos Group Inc.
4 * Copyright (c) 2015-2016 Valve Corporation
5 * Copyright (c) 2015-2016 LunarG, Inc.
6 * Copyright (C) 2016 Google Inc.
Jon Ashburnd55a3942015-05-06 09:02:10 -06007 *
Jon Ashburn23d36b12016-02-02 17:47:28 -07008 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and/or associated documentation files (the "Materials"), to
10 * deal in the Materials without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Materials, and to permit persons to whom the Materials are
13 * furnished to do so, subject to the following conditions:
Jon Ashburnd55a3942015-05-06 09:02:10 -060014 *
Jon Ashburn23d36b12016-02-02 17:47:28 -070015 * The above copyright notice(s) and this permission notice shall be included in
16 * all copies or substantial portions of the Materials.
Jon Ashburnd55a3942015-05-06 09:02:10 -060017 *
Jon Ashburn23d36b12016-02-02 17:47:28 -070018 * The Materials are Confidential Information as defined by the Khronos
19 * Membership Agreement until designated non-confidential by Khronos, at which
20 * point this condition clause shall be removed.
21 *
22 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Jon Ashburnd55a3942015-05-06 09:02:10 -060023 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Jon Ashburn23d36b12016-02-02 17:47:28 -070024 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060025 *
Jon Ashburn23d36b12016-02-02 17:47:28 -070026 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
29 * USE OR OTHER DEALINGS IN THE MATERIALS.
30 *
31 * Author: Courtney Goeltzenleuchter <courtney@lunarg.com>
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060032 * Author: Jon Ashburn <jon@lunarg.com>
Jon Ashburn23d36b12016-02-02 17:47:28 -070033 * Author: Ian Elliott <ian@LunarG.com>
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060034 * Author: Tony Barbour <tony@LunarG.com>
Jon Ashburnd55a3942015-05-06 09:02:10 -060035 */
36
David Pinedo9316d3b2015-11-06 12:54:48 -070037#include <vulkan/vulkan.h>
38#include <vulkan/vk_layer.h>
Jon Ashburnd55a3942015-05-06 09:02:10 -060039#include <string.h>
Jon Ashburn27cd5842015-05-12 17:26:48 -060040#include "loader.h"
Tobin Ehlisb835d1b2015-07-03 10:34:49 -060041#include "vk_loader_platform.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060042
Jon Ashburn23d36b12016-02-02 17:47:28 -070043static VkResult vkDevExtError(VkDevice dev) {
Jon Ashburnfc1031e2015-11-17 15:31:02 -070044 return VK_ERROR_INITIALIZATION_FAILED;
45}
46
Jon Ashburn23d36b12016-02-02 17:47:28 -070047static inline void
48loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table,
49 PFN_vkGetDeviceProcAddr gpa, VkDevice dev) {
Jon Ashburnfc1031e2015-11-17 15:31:02 -070050 VkLayerDispatchTable *table = &dev_table->core_dispatch;
51 for (uint32_t i = 0; i < MAX_NUM_DEV_EXTS; i++)
Jon Ashburn23d36b12016-02-02 17:47:28 -070052 dev_table->ext_dispatch.DevExt[i] = (PFN_vkDevExt)vkDevExtError;
Jon Ashburn8fd08252015-05-28 16:25:02 -060053
Jon Ashburn23d36b12016-02-02 17:47:28 -070054 table->GetDeviceProcAddr =
55 (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr");
56 table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice");
57 table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue");
58 table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit");
59 table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle");
60 table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle");
61 table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory");
62 table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory");
63 table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory");
64 table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory");
65 table->FlushMappedMemoryRanges =
66 (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges");
67 table->InvalidateMappedMemoryRanges =
68 (PFN_vkInvalidateMappedMemoryRanges)gpa(
69 dev, "vkInvalidateMappedMemoryRanges");
70 table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa(
71 dev, "vkGetDeviceMemoryCommitment");
72 table->GetImageSparseMemoryRequirements =
73 (PFN_vkGetImageSparseMemoryRequirements)gpa(
74 dev, "vkGetImageSparseMemoryRequirements");
75 table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa(
76 dev, "vkGetBufferMemoryRequirements");
77 table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa(
78 dev, "vkGetImageMemoryRequirements");
79 table->BindBufferMemory =
80 (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory");
81 table->BindImageMemory =
82 (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory");
83 table->QueueBindSparse =
84 (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse");
85 table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence");
86 table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence");
87 table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences");
88 table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus");
89 table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences");
90 table->CreateSemaphore =
91 (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore");
92 table->DestroySemaphore =
93 (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore");
94 table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent");
95 table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent");
96 table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus");
97 table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent");
98 table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent");
99 table->CreateQueryPool =
100 (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool");
101 table->DestroyQueryPool =
102 (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool");
103 table->GetQueryPoolResults =
104 (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults");
105 table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer");
106 table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer");
107 table->CreateBufferView =
108 (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView");
109 table->DestroyBufferView =
110 (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView");
111 table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage");
112 table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage");
113 table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa(
114 dev, "vkGetImageSubresourceLayout");
115 table->CreateImageView =
116 (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView");
117 table->DestroyImageView =
118 (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView");
119 table->CreateShaderModule =
120 (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule");
121 table->DestroyShaderModule =
122 (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule");
123 table->CreatePipelineCache =
124 (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache");
125 table->DestroyPipelineCache =
126 (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache");
127 table->GetPipelineCacheData =
128 (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData");
129 table->MergePipelineCaches =
130 (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches");
131 table->CreateGraphicsPipelines =
132 (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines");
133 table->CreateComputePipelines =
134 (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines");
135 table->DestroyPipeline =
136 (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline");
137 table->CreatePipelineLayout =
138 (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout");
139 table->DestroyPipelineLayout =
140 (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout");
141 table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler");
142 table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler");
143 table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa(
144 dev, "vkCreateDescriptorSetLayout");
145 table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa(
146 dev, "vkDestroyDescriptorSetLayout");
147 table->CreateDescriptorPool =
148 (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool");
149 table->DestroyDescriptorPool =
150 (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool");
151 table->ResetDescriptorPool =
152 (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool");
153 table->AllocateDescriptorSets =
154 (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets");
155 table->FreeDescriptorSets =
156 (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets");
157 table->UpdateDescriptorSets =
158 (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets");
159 table->CreateFramebuffer =
160 (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer");
161 table->DestroyFramebuffer =
162 (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer");
163 table->CreateRenderPass =
164 (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass");
165 table->DestroyRenderPass =
166 (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass");
167 table->GetRenderAreaGranularity =
168 (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity");
169 table->CreateCommandPool =
170 (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool");
171 table->DestroyCommandPool =
172 (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool");
173 table->ResetCommandPool =
174 (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool");
175 table->AllocateCommandBuffers =
176 (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers");
177 table->FreeCommandBuffers =
178 (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers");
179 table->BeginCommandBuffer =
180 (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer");
181 table->EndCommandBuffer =
182 (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer");
183 table->ResetCommandBuffer =
184 (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer");
185 table->CmdBindPipeline =
186 (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline");
187 table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport");
188 table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor");
189 table->CmdSetLineWidth =
190 (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth");
191 table->CmdSetDepthBias =
192 (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias");
193 table->CmdSetBlendConstants =
194 (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants");
195 table->CmdSetDepthBounds =
196 (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds");
197 table->CmdSetStencilCompareMask =
198 (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask");
199 table->CmdSetStencilWriteMask =
200 (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask");
201 table->CmdSetStencilReference =
202 (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference");
203 table->CmdBindDescriptorSets =
204 (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets");
205 table->CmdBindVertexBuffers =
206 (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers");
207 table->CmdBindIndexBuffer =
208 (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer");
209 table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw");
210 table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed");
211 table->CmdDrawIndirect =
212 (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect");
213 table->CmdDrawIndexedIndirect =
214 (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect");
215 table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch");
216 table->CmdDispatchIndirect =
217 (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect");
218 table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer");
219 table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage");
220 table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage");
221 table->CmdCopyBufferToImage =
222 (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage");
223 table->CmdCopyImageToBuffer =
224 (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer");
225 table->CmdUpdateBuffer =
226 (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer");
227 table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer");
228 table->CmdClearColorImage =
229 (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage");
230 table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa(
231 dev, "vkCmdClearDepthStencilImage");
232 table->CmdClearAttachments =
233 (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments");
234 table->CmdResolveImage =
235 (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage");
236 table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent");
237 table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent");
238 table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents");
239 table->CmdPipelineBarrier =
240 (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier");
241 table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery");
242 table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery");
243 table->CmdResetQueryPool =
244 (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool");
245 table->CmdWriteTimestamp =
246 (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp");
247 table->CmdCopyQueryPoolResults =
248 (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults");
249 table->CmdPushConstants =
250 (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants");
251 table->CmdBeginRenderPass =
252 (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass");
253 table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass");
254 table->CmdEndRenderPass =
255 (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass");
256 table->CmdExecuteCommands =
257 (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands");
Jon Ashburn232e3af2015-11-30 17:21:25 -0700258}
259
Jon Ashburn23d36b12016-02-02 17:47:28 -0700260static inline void loader_init_device_extension_dispatch_table(
261 struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,
262 VkDevice dev) {
Jon Ashburn232e3af2015-11-30 17:21:25 -0700263 VkLayerDispatchTable *table = &dev_table->core_dispatch;
Jon Ashburn23d36b12016-02-02 17:47:28 -0700264 table->AcquireNextImageKHR =
265 (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR");
266 table->CreateSwapchainKHR =
267 (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR");
268 table->DestroySwapchainKHR =
269 (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR");
270 table->GetSwapchainImagesKHR =
271 (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR");
272 table->QueuePresentKHR =
273 (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR");
Jon Ashburnd55a3942015-05-06 09:02:10 -0600274}
275
Jon Ashburn23d36b12016-02-02 17:47:28 -0700276static inline void *
277loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table,
278 const char *name) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600279 if (!name || name[0] != 'v' || name[1] != 'k')
280 return NULL;
281
282 name += 2;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600283 if (!strcmp(name, "GetDeviceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700284 return (void *)table->GetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600285 if (!strcmp(name, "DestroyDevice"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700286 return (void *)table->DestroyDevice;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600287 if (!strcmp(name, "GetDeviceQueue"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700288 return (void *)table->GetDeviceQueue;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600289 if (!strcmp(name, "QueueSubmit"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700290 return (void *)table->QueueSubmit;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600291 if (!strcmp(name, "QueueWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700292 return (void *)table->QueueWaitIdle;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600293 if (!strcmp(name, "DeviceWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700294 return (void *)table->DeviceWaitIdle;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800295 if (!strcmp(name, "AllocateMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700296 return (void *)table->AllocateMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600297 if (!strcmp(name, "FreeMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700298 return (void *)table->FreeMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600299 if (!strcmp(name, "MapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700300 return (void *)table->MapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600301 if (!strcmp(name, "UnmapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700302 return (void *)table->UnmapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600303 if (!strcmp(name, "FlushMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700304 return (void *)table->FlushMappedMemoryRanges;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600305 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700306 return (void *)table->InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600307 if (!strcmp(name, "GetDeviceMemoryCommitment"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700308 return (void *)table->GetDeviceMemoryCommitment;
Jon Ashburn754864f2015-07-23 18:49:07 -0600309 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700310 return (void *)table->GetImageSparseMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600311 if (!strcmp(name, "GetBufferMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700312 return (void *)table->GetBufferMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600313 if (!strcmp(name, "GetImageMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700314 return (void *)table->GetImageMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600315 if (!strcmp(name, "BindBufferMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700316 return (void *)table->BindBufferMemory;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600317 if (!strcmp(name, "BindImageMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700318 return (void *)table->BindImageMemory;
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800319 if (!strcmp(name, "QueueBindSparse"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700320 return (void *)table->QueueBindSparse;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600321 if (!strcmp(name, "CreateFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700322 return (void *)table->CreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600323 if (!strcmp(name, "DestroyFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700324 return (void *)table->DestroyFence;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600325 if (!strcmp(name, "ResetFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700326 return (void *)table->ResetFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600327 if (!strcmp(name, "GetFenceStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700328 return (void *)table->GetFenceStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600329 if (!strcmp(name, "WaitForFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700330 return (void *)table->WaitForFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600331 if (!strcmp(name, "CreateSemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700332 return (void *)table->CreateSemaphore;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600333 if (!strcmp(name, "DestroySemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700334 return (void *)table->DestroySemaphore;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600335 if (!strcmp(name, "CreateEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700336 return (void *)table->CreateEvent;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600337 if (!strcmp(name, "DestroyEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700338 return (void *)table->DestroyEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600339 if (!strcmp(name, "GetEventStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700340 return (void *)table->GetEventStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600341 if (!strcmp(name, "SetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700342 return (void *)table->SetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600343 if (!strcmp(name, "ResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700344 return (void *)table->ResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600345 if (!strcmp(name, "CreateQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700346 return (void *)table->CreateQueryPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600347 if (!strcmp(name, "DestroyQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700348 return (void *)table->DestroyQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600349 if (!strcmp(name, "GetQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700350 return (void *)table->GetQueryPoolResults;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600351 if (!strcmp(name, "CreateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700352 return (void *)table->CreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600353 if (!strcmp(name, "DestroyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700354 return (void *)table->DestroyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600355 if (!strcmp(name, "CreateBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700356 return (void *)table->CreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600357 if (!strcmp(name, "DestroyBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700358 return (void *)table->DestroyBufferView;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600359 if (!strcmp(name, "CreateImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700360 return (void *)table->CreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600361 if (!strcmp(name, "DestroyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700362 return (void *)table->DestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -0600363 if (!strcmp(name, "GetImageSubresourceLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700364 return (void *)table->GetImageSubresourceLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600365 if (!strcmp(name, "CreateImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700366 return (void *)table->CreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600367 if (!strcmp(name, "DestroyImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700368 return (void *)table->DestroyImageView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600369 if (!strcmp(name, "CreateShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700370 return (void *)table->CreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600371 if (!strcmp(name, "DestroyShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700372 return (void *)table->DestroyShaderModule;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600373 if (!strcmp(name, "CreatePipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700374 return (void *)vkCreatePipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600375 if (!strcmp(name, "DestroyPipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700376 return (void *)vkDestroyPipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600377 if (!strcmp(name, "GetPipelineCacheData"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700378 return (void *)vkGetPipelineCacheData;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600379 if (!strcmp(name, "MergePipelineCaches"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700380 return (void *)vkMergePipelineCaches;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600381 if (!strcmp(name, "CreateGraphicsPipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700382 return (void *)vkCreateGraphicsPipelines;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600383 if (!strcmp(name, "CreateComputePipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700384 return (void *)vkCreateComputePipelines;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600385 if (!strcmp(name, "DestroyPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700386 return (void *)table->DestroyPipeline;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600387 if (!strcmp(name, "CreatePipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700388 return (void *)table->CreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600389 if (!strcmp(name, "DestroyPipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700390 return (void *)table->DestroyPipelineLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600391 if (!strcmp(name, "CreateSampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700392 return (void *)table->CreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600393 if (!strcmp(name, "DestroySampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700394 return (void *)table->DestroySampler;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600395 if (!strcmp(name, "CreateDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700396 return (void *)table->CreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600397 if (!strcmp(name, "DestroyDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700398 return (void *)table->DestroyDescriptorSetLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600399 if (!strcmp(name, "CreateDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700400 return (void *)table->CreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600401 if (!strcmp(name, "DestroyDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700402 return (void *)table->DestroyDescriptorPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600403 if (!strcmp(name, "ResetDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700404 return (void *)table->ResetDescriptorPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800405 if (!strcmp(name, "AllocateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700406 return (void *)table->AllocateDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600407 if (!strcmp(name, "FreeDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700408 return (void *)table->FreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800409 if (!strcmp(name, "UpdateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700410 return (void *)table->UpdateDescriptorSets;
Jon Ashburn754864f2015-07-23 18:49:07 -0600411 if (!strcmp(name, "CreateFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700412 return (void *)table->CreateFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600413 if (!strcmp(name, "DestroyFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700414 return (void *)table->DestroyFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600415 if (!strcmp(name, "CreateRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700416 return (void *)table->CreateRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600417 if (!strcmp(name, "DestroyRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700418 return (void *)table->DestroyRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600419 if (!strcmp(name, "GetRenderAreaGranularity"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700420 return (void *)table->GetRenderAreaGranularity;
Cody Northrope62183e2015-07-09 18:08:05 -0600421 if (!strcmp(name, "CreateCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700422 return (void *)table->CreateCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600423 if (!strcmp(name, "DestroyCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700424 return (void *)table->DestroyCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600425 if (!strcmp(name, "ResetCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700426 return (void *)table->ResetCommandPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800427 if (!strcmp(name, "AllocateCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700428 return (void *)table->AllocateCommandBuffers;
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600429 if (!strcmp(name, "FreeCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700430 return (void *)table->FreeCommandBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600431 if (!strcmp(name, "BeginCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700432 return (void *)table->BeginCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600433 if (!strcmp(name, "EndCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700434 return (void *)table->EndCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600435 if (!strcmp(name, "ResetCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700436 return (void *)table->ResetCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600437 if (!strcmp(name, "CmdBindPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700438 return (void *)table->CmdBindPipeline;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600439 if (!strcmp(name, "CmdSetViewport"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700440 return (void *)table->CmdSetViewport;
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -0600441 if (!strcmp(name, "CmdSetScissor"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700442 return (void *)table->CmdSetScissor;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600443 if (!strcmp(name, "CmdSetLineWidth"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700444 return (void *)table->CmdSetLineWidth;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600445 if (!strcmp(name, "CmdSetDepthBias"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700446 return (void *)table->CmdSetDepthBias;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600447 if (!strcmp(name, "CmdSetBlendConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700448 return (void *)table->CmdSetBlendConstants;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600449 if (!strcmp(name, "CmdSetDepthBounds"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700450 return (void *)table->CmdSetDepthBounds;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600451 if (!strcmp(name, "CmdSetStencilCompareMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700452 return (void *)table->CmdSetStencilCompareMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600453 if (!strcmp(name, "CmdSetStencilwriteMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700454 return (void *)table->CmdSetStencilWriteMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600455 if (!strcmp(name, "CmdSetStencilReference"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700456 return (void *)table->CmdSetStencilReference;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600457 if (!strcmp(name, "CmdBindDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700458 return (void *)table->CmdBindDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600459 if (!strcmp(name, "CmdBindVertexBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700460 return (void *)table->CmdBindVertexBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600461 if (!strcmp(name, "CmdBindIndexBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700462 return (void *)table->CmdBindIndexBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600463 if (!strcmp(name, "CmdDraw"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700464 return (void *)table->CmdDraw;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600465 if (!strcmp(name, "CmdDrawIndexed"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700466 return (void *)table->CmdDrawIndexed;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600467 if (!strcmp(name, "CmdDrawIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700468 return (void *)table->CmdDrawIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600469 if (!strcmp(name, "CmdDrawIndexedIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700470 return (void *)table->CmdDrawIndexedIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600471 if (!strcmp(name, "CmdDispatch"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700472 return (void *)table->CmdDispatch;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600473 if (!strcmp(name, "CmdDispatchIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700474 return (void *)table->CmdDispatchIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600475 if (!strcmp(name, "CmdCopyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700476 return (void *)table->CmdCopyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600477 if (!strcmp(name, "CmdCopyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700478 return (void *)table->CmdCopyImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600479 if (!strcmp(name, "CmdBlitImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700480 return (void *)table->CmdBlitImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600481 if (!strcmp(name, "CmdCopyBufferToImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700482 return (void *)table->CmdCopyBufferToImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600483 if (!strcmp(name, "CmdCopyImageToBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700484 return (void *)table->CmdCopyImageToBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600485 if (!strcmp(name, "CmdUpdateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700486 return (void *)table->CmdUpdateBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600487 if (!strcmp(name, "CmdFillBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700488 return (void *)table->CmdFillBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600489 if (!strcmp(name, "CmdClearColorImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700490 return (void *)table->CmdClearColorImage;
Chris Forbesd9be82b2015-06-22 17:21:59 +1200491 if (!strcmp(name, "CmdClearDepthStencilImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700492 return (void *)table->CmdClearDepthStencilImage;
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -0600493 if (!strcmp(name, "CmdClearAttachments"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700494 return (void *)table->CmdClearAttachments;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600495 if (!strcmp(name, "CmdResolveImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700496 return (void *)table->CmdResolveImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600497 if (!strcmp(name, "CmdSetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700498 return (void *)table->CmdSetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600499 if (!strcmp(name, "CmdResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700500 return (void *)table->CmdResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600501 if (!strcmp(name, "CmdWaitEvents"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700502 return (void *)table->CmdWaitEvents;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600503 if (!strcmp(name, "CmdPipelineBarrier"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700504 return (void *)table->CmdPipelineBarrier;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600505 if (!strcmp(name, "CmdBeginQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700506 return (void *)table->CmdBeginQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600507 if (!strcmp(name, "CmdEndQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700508 return (void *)table->CmdEndQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600509 if (!strcmp(name, "CmdResetQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700510 return (void *)table->CmdResetQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600511 if (!strcmp(name, "CmdWriteTimestamp"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700512 return (void *)table->CmdWriteTimestamp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600513 if (!strcmp(name, "CmdCopyQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700514 return (void *)table->CmdCopyQueryPoolResults;
Jon Ashburn754864f2015-07-23 18:49:07 -0600515 if (!strcmp(name, "CmdPushConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700516 return (void *)table->CmdPushConstants;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600517 if (!strcmp(name, "CmdBeginRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700518 return (void *)table->CmdBeginRenderPass;
Chia-I Wu08accc62015-07-07 11:50:03 +0800519 if (!strcmp(name, "CmdNextSubpass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700520 return (void *)table->CmdNextSubpass;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600521 if (!strcmp(name, "CmdEndRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700522 return (void *)table->CmdEndRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600523 if (!strcmp(name, "CmdExecuteCommands"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700524 return (void *)table->CmdExecuteCommands;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600525
526 return NULL;
527}
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600528
Jon Ashburn23d36b12016-02-02 17:47:28 -0700529static inline void
530loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table,
531 PFN_vkGetInstanceProcAddr gpa,
532 VkInstance inst) {
533 table->GetInstanceProcAddr =
534 (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr");
535 table->DestroyInstance =
536 (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance");
537 table->EnumeratePhysicalDevices =
538 (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices");
539 table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa(
540 inst, "vkGetPhysicalDeviceFeatures");
541 table->GetPhysicalDeviceImageFormatProperties =
542 (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa(
543 inst, "vkGetPhysicalDeviceImageFormatProperties");
544 table->GetPhysicalDeviceFormatProperties =
545 (PFN_vkGetPhysicalDeviceFormatProperties)gpa(
546 inst, "vkGetPhysicalDeviceFormatProperties");
547 table->GetPhysicalDeviceSparseImageFormatProperties =
548 (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa(
549 inst, "vkGetPhysicalDeviceSparseImageFormatProperties");
550 table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa(
551 inst, "vkGetPhysicalDeviceProperties");
552 table->GetPhysicalDeviceQueueFamilyProperties =
553 (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa(
554 inst, "vkGetPhysicalDeviceQueueFamilyProperties");
555 table->GetPhysicalDeviceMemoryProperties =
556 (PFN_vkGetPhysicalDeviceMemoryProperties)gpa(
557 inst, "vkGetPhysicalDeviceMemoryProperties");
558 table->EnumerateDeviceExtensionProperties =
559 (PFN_vkEnumerateDeviceExtensionProperties)gpa(
560 inst, "vkEnumerateDeviceExtensionProperties");
561 table->EnumerateDeviceLayerProperties =
562 (PFN_vkEnumerateDeviceLayerProperties)gpa(
563 inst, "vkEnumerateDeviceLayerProperties");
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600564}
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600565
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600566static inline void loader_init_instance_extension_dispatch_table(
Jon Ashburn23d36b12016-02-02 17:47:28 -0700567 VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
568 VkInstance inst) {
569 table->DestroySurfaceKHR =
570 (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR");
571 table->CreateDebugReportCallbackEXT =
572 (PFN_vkCreateDebugReportCallbackEXT)gpa(
573 inst, "vkCreateDebugReportCallbackEXT");
574 table->DestroyDebugReportCallbackEXT =
575 (PFN_vkDestroyDebugReportCallbackEXT)gpa(
576 inst, "vkDestroyDebugReportCallbackEXT");
577 table->DebugReportMessageEXT =
578 (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT");
579 table->GetPhysicalDeviceSurfaceSupportKHR =
580 (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa(
581 inst, "vkGetPhysicalDeviceSurfaceSupportKHR");
582 table->GetPhysicalDeviceSurfaceCapabilitiesKHR =
583 (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa(
584 inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
585 table->GetPhysicalDeviceSurfaceFormatsKHR =
586 (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa(
587 inst, "vkGetPhysicalDeviceSurfaceFormatsKHR");
588 table->GetPhysicalDeviceSurfacePresentModesKHR =
589 (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa(
590 inst, "vkGetPhysicalDeviceSurfacePresentModesKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700591#ifdef VK_USE_PLATFORM_MIR_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700592 table->CreateMirSurfaceKHR =
593 (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR");
594 table->GetPhysicalDeviceMirPresentationSupportKHR =
595 (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa(
596 inst, "vkGetPhysicalDeviceMirPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700597#endif
598#ifdef VK_USE_PLATFORM_WAYLAND_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700599 table->CreateWaylandSurfaceKHR =
600 (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR");
601 table->GetPhysicalDeviceWaylandPresentationSupportKHR =
602 (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa(
603 inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700604#endif
605#ifdef VK_USE_PLATFORM_WIN32_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700606 table->CreateWin32SurfaceKHR =
607 (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR");
608 table->GetPhysicalDeviceWin32PresentationSupportKHR =
609 (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa(
610 inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700611#endif
612#ifdef VK_USE_PLATFORM_XCB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700613 table->CreateXcbSurfaceKHR =
614 (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR");
615 table->GetPhysicalDeviceXcbPresentationSupportKHR =
616 (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa(
617 inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700618#endif
619#ifdef VK_USE_PLATFORM_XLIB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700620 table->CreateXlibSurfaceKHR =
621 (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR");
622 table->GetPhysicalDeviceXlibPresentationSupportKHR =
623 (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa(
624 inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700625#endif
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600626}
Jon Ashburn27cd5842015-05-12 17:26:48 -0600627
Jon Ashburn23d36b12016-02-02 17:47:28 -0700628static inline void *
629loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table,
630 const char *name) {
Jon Ashburn27cd5842015-05-12 17:26:48 -0600631 if (!name || name[0] != 'v' || name[1] != 'k')
632 return NULL;
633
634 name += 2;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600635 if (!strcmp(name, "DestroyInstance"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700636 return (void *)table->DestroyInstance;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600637 if (!strcmp(name, "EnumeratePhysicalDevices"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700638 return (void *)table->EnumeratePhysicalDevices;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200639 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700640 return (void *)table->GetPhysicalDeviceFeatures;
Jon Ashburn754864f2015-07-23 18:49:07 -0600641 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700642 return (void *)table->GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600643 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700644 return (void *)table->GetPhysicalDeviceFormatProperties;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600645 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700646 return (void *)table->GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600647 if (!strcmp(name, "GetPhysicalDeviceProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700648 return (void *)table->GetPhysicalDeviceProperties;
Cody Northropd0802882015-08-03 17:04:53 -0600649 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700650 return (void *)table->GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600651 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700652 return (void *)table->GetPhysicalDeviceMemoryProperties;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600653 if (!strcmp(name, "GetInstanceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700654 return (void *)table->GetInstanceProcAddr;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600655 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700656 return (void *)table->EnumerateDeviceExtensionProperties;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600657 if (!strcmp(name, "EnumerateDeviceLayerProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700658 return (void *)table->EnumerateDeviceLayerProperties;
Ian Elliottfb42cd72015-11-25 14:43:02 -0700659 if (!strcmp(name, "DestroySurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700660 return (void *)table->DestroySurfaceKHR;
Ian Elliott7e40db92015-08-21 15:09:33 -0600661 if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700662 return (void *)table->GetPhysicalDeviceSurfaceSupportKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700663 if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700664 return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700665 if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700666 return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700667 if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700668 return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700669#ifdef VK_USE_PLATFORM_MIR_KHR
670 if (!strcmp(name, "CreateMirSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700671 return (void *)table->CreateMirSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700672 if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700673 return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700674#endif
675#ifdef VK_USE_PLATFORM_WAYLAND_KHR
676 if (!strcmp(name, "CreateWaylandSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700677 return (void *)table->CreateWaylandSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700678 if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700679 return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700680#endif
681#ifdef VK_USE_PLATFORM_WIN32_KHR
682 if (!strcmp(name, "CreateWin32SurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700683 return (void *)table->CreateWin32SurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700684 if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700685 return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700686#endif
687#ifdef VK_USE_PLATFORM_XCB_KHR
688 if (!strcmp(name, "CreateXcbSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700689 return (void *)table->CreateXcbSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700690 if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700691 return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700692#endif
693#ifdef VK_USE_PLATFORM_XLIB_KHR
694 if (!strcmp(name, "CreateXlibSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700695 return (void *)table->CreateXlibSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700696 if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700697 return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700698#endif
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700699 if (!strcmp(name, "CreateDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700700 return (void *)table->CreateDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700701 if (!strcmp(name, "DestroyDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700702 return (void *)table->DestroyDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700703 if (!strcmp(name, "DebugReportMessageEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700704 return (void *)table->DebugReportMessageEXT;
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600705
Jon Ashburn27cd5842015-05-12 17:26:48 -0600706 return NULL;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600707}