blob: 8a5f8df33ee593b241254918aad4eaec0e9057b5 [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 Ashburn3ebf1252016-04-19 11:30:31 -06008 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
Jon Ashburnd55a3942015-05-06 09:02:10 -060011 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -060012 * http://www.apache.org/licenses/LICENSE-2.0
Jon Ashburnd55a3942015-05-06 09:02:10 -060013 *
Jon Ashburn3ebf1252016-04-19 11:30:31 -060014 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
Jon Ashburn23d36b12016-02-02 17:47:28 -070019 *
20 * Author: Courtney Goeltzenleuchter <courtney@lunarg.com>
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060021 * Author: Jon Ashburn <jon@lunarg.com>
Jon Ashburn23d36b12016-02-02 17:47:28 -070022 * Author: Ian Elliott <ian@LunarG.com>
Courtney Goeltzenleuchter05559522015-10-30 11:14:30 -060023 * Author: Tony Barbour <tony@LunarG.com>
Jon Ashburnd55a3942015-05-06 09:02:10 -060024 */
25
David Pinedo9316d3b2015-11-06 12:54:48 -070026#include <vulkan/vulkan.h>
27#include <vulkan/vk_layer.h>
Jon Ashburnd55a3942015-05-06 09:02:10 -060028#include <string.h>
Jon Ashburn27cd5842015-05-12 17:26:48 -060029#include "loader.h"
Tobin Ehlisb835d1b2015-07-03 10:34:49 -060030#include "vk_loader_platform.h"
Jon Ashburnd55a3942015-05-06 09:02:10 -060031
Jon Ashburn23d36b12016-02-02 17:47:28 -070032static VkResult vkDevExtError(VkDevice dev) {
Jon Ashburn2e37d752016-02-12 08:20:06 -070033 struct loader_device *found_dev;
34 struct loader_icd *icd = loader_get_icd_and_device(dev, &found_dev);
35
36 if (icd)
37 loader_log(icd->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
38 "Bad destination in loader trampoline dispatch,"
39 "Are layers and extensions that you are calling enabled?");
40 return VK_ERROR_EXTENSION_NOT_PRESENT;
Jon Ashburnfc1031e2015-11-17 15:31:02 -070041}
42
Jon Ashburn23d36b12016-02-02 17:47:28 -070043static inline void
44loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table,
45 PFN_vkGetDeviceProcAddr gpa, VkDevice dev) {
Jon Ashburnfc1031e2015-11-17 15:31:02 -070046 VkLayerDispatchTable *table = &dev_table->core_dispatch;
47 for (uint32_t i = 0; i < MAX_NUM_DEV_EXTS; i++)
Jon Ashburn23d36b12016-02-02 17:47:28 -070048 dev_table->ext_dispatch.DevExt[i] = (PFN_vkDevExt)vkDevExtError;
Jon Ashburn8fd08252015-05-28 16:25:02 -060049
Jon Ashburn23d36b12016-02-02 17:47:28 -070050 table->GetDeviceProcAddr =
51 (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr");
52 table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice");
53 table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue");
54 table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit");
55 table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle");
56 table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle");
57 table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory");
58 table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory");
59 table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory");
60 table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory");
61 table->FlushMappedMemoryRanges =
62 (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges");
63 table->InvalidateMappedMemoryRanges =
64 (PFN_vkInvalidateMappedMemoryRanges)gpa(
65 dev, "vkInvalidateMappedMemoryRanges");
66 table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa(
67 dev, "vkGetDeviceMemoryCommitment");
68 table->GetImageSparseMemoryRequirements =
69 (PFN_vkGetImageSparseMemoryRequirements)gpa(
70 dev, "vkGetImageSparseMemoryRequirements");
71 table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa(
72 dev, "vkGetBufferMemoryRequirements");
73 table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa(
74 dev, "vkGetImageMemoryRequirements");
75 table->BindBufferMemory =
76 (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory");
77 table->BindImageMemory =
78 (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory");
79 table->QueueBindSparse =
80 (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse");
81 table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence");
82 table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence");
83 table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences");
84 table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus");
85 table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences");
86 table->CreateSemaphore =
87 (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore");
88 table->DestroySemaphore =
89 (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore");
90 table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent");
91 table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent");
92 table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus");
93 table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent");
94 table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent");
95 table->CreateQueryPool =
96 (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool");
97 table->DestroyQueryPool =
98 (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool");
99 table->GetQueryPoolResults =
100 (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults");
101 table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer");
102 table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer");
103 table->CreateBufferView =
104 (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView");
105 table->DestroyBufferView =
106 (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView");
107 table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage");
108 table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage");
109 table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa(
110 dev, "vkGetImageSubresourceLayout");
111 table->CreateImageView =
112 (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView");
113 table->DestroyImageView =
114 (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView");
115 table->CreateShaderModule =
116 (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule");
117 table->DestroyShaderModule =
118 (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule");
119 table->CreatePipelineCache =
120 (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache");
121 table->DestroyPipelineCache =
122 (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache");
123 table->GetPipelineCacheData =
124 (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData");
125 table->MergePipelineCaches =
126 (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches");
127 table->CreateGraphicsPipelines =
128 (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines");
129 table->CreateComputePipelines =
130 (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines");
131 table->DestroyPipeline =
132 (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline");
133 table->CreatePipelineLayout =
134 (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout");
135 table->DestroyPipelineLayout =
136 (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout");
137 table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler");
138 table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler");
139 table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa(
140 dev, "vkCreateDescriptorSetLayout");
141 table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa(
142 dev, "vkDestroyDescriptorSetLayout");
143 table->CreateDescriptorPool =
144 (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool");
145 table->DestroyDescriptorPool =
146 (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool");
147 table->ResetDescriptorPool =
148 (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool");
149 table->AllocateDescriptorSets =
150 (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets");
151 table->FreeDescriptorSets =
152 (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets");
153 table->UpdateDescriptorSets =
154 (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets");
155 table->CreateFramebuffer =
156 (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer");
157 table->DestroyFramebuffer =
158 (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer");
159 table->CreateRenderPass =
160 (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass");
161 table->DestroyRenderPass =
162 (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass");
163 table->GetRenderAreaGranularity =
164 (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity");
165 table->CreateCommandPool =
166 (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool");
167 table->DestroyCommandPool =
168 (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool");
169 table->ResetCommandPool =
170 (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool");
171 table->AllocateCommandBuffers =
172 (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers");
173 table->FreeCommandBuffers =
174 (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers");
175 table->BeginCommandBuffer =
176 (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer");
177 table->EndCommandBuffer =
178 (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer");
179 table->ResetCommandBuffer =
180 (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer");
181 table->CmdBindPipeline =
182 (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline");
183 table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport");
184 table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor");
185 table->CmdSetLineWidth =
186 (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth");
187 table->CmdSetDepthBias =
188 (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias");
189 table->CmdSetBlendConstants =
190 (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants");
191 table->CmdSetDepthBounds =
192 (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds");
193 table->CmdSetStencilCompareMask =
194 (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask");
195 table->CmdSetStencilWriteMask =
196 (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask");
197 table->CmdSetStencilReference =
198 (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference");
199 table->CmdBindDescriptorSets =
200 (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets");
201 table->CmdBindVertexBuffers =
202 (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers");
203 table->CmdBindIndexBuffer =
204 (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer");
205 table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw");
206 table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed");
207 table->CmdDrawIndirect =
208 (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect");
209 table->CmdDrawIndexedIndirect =
210 (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect");
211 table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch");
212 table->CmdDispatchIndirect =
213 (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect");
214 table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer");
215 table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage");
216 table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage");
217 table->CmdCopyBufferToImage =
218 (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage");
219 table->CmdCopyImageToBuffer =
220 (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer");
221 table->CmdUpdateBuffer =
222 (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer");
223 table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer");
224 table->CmdClearColorImage =
225 (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage");
226 table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa(
227 dev, "vkCmdClearDepthStencilImage");
228 table->CmdClearAttachments =
229 (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments");
230 table->CmdResolveImage =
231 (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage");
232 table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent");
233 table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent");
234 table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents");
235 table->CmdPipelineBarrier =
236 (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier");
237 table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery");
238 table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery");
239 table->CmdResetQueryPool =
240 (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool");
241 table->CmdWriteTimestamp =
242 (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp");
243 table->CmdCopyQueryPoolResults =
244 (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults");
245 table->CmdPushConstants =
246 (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants");
247 table->CmdBeginRenderPass =
248 (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass");
249 table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass");
250 table->CmdEndRenderPass =
251 (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass");
252 table->CmdExecuteCommands =
253 (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands");
Jon Ashburn232e3af2015-11-30 17:21:25 -0700254}
255
Jon Ashburn23d36b12016-02-02 17:47:28 -0700256static inline void loader_init_device_extension_dispatch_table(
257 struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,
258 VkDevice dev) {
Jon Ashburn232e3af2015-11-30 17:21:25 -0700259 VkLayerDispatchTable *table = &dev_table->core_dispatch;
Jon Ashburn23d36b12016-02-02 17:47:28 -0700260 table->AcquireNextImageKHR =
261 (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR");
262 table->CreateSwapchainKHR =
263 (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR");
264 table->DestroySwapchainKHR =
265 (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR");
266 table->GetSwapchainImagesKHR =
267 (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR");
268 table->QueuePresentKHR =
269 (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR");
Jon Ashburnd55a3942015-05-06 09:02:10 -0600270}
271
Jon Ashburn23d36b12016-02-02 17:47:28 -0700272static inline void *
273loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table,
274 const char *name) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600275 if (!name || name[0] != 'v' || name[1] != 'k')
276 return NULL;
277
278 name += 2;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600279 if (!strcmp(name, "GetDeviceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700280 return (void *)table->GetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600281 if (!strcmp(name, "DestroyDevice"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700282 return (void *)table->DestroyDevice;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600283 if (!strcmp(name, "GetDeviceQueue"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700284 return (void *)table->GetDeviceQueue;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600285 if (!strcmp(name, "QueueSubmit"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700286 return (void *)table->QueueSubmit;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600287 if (!strcmp(name, "QueueWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700288 return (void *)table->QueueWaitIdle;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600289 if (!strcmp(name, "DeviceWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700290 return (void *)table->DeviceWaitIdle;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800291 if (!strcmp(name, "AllocateMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700292 return (void *)table->AllocateMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600293 if (!strcmp(name, "FreeMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700294 return (void *)table->FreeMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600295 if (!strcmp(name, "MapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700296 return (void *)table->MapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600297 if (!strcmp(name, "UnmapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700298 return (void *)table->UnmapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600299 if (!strcmp(name, "FlushMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700300 return (void *)table->FlushMappedMemoryRanges;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600301 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700302 return (void *)table->InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600303 if (!strcmp(name, "GetDeviceMemoryCommitment"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700304 return (void *)table->GetDeviceMemoryCommitment;
Jon Ashburn754864f2015-07-23 18:49:07 -0600305 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700306 return (void *)table->GetImageSparseMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600307 if (!strcmp(name, "GetBufferMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700308 return (void *)table->GetBufferMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600309 if (!strcmp(name, "GetImageMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700310 return (void *)table->GetImageMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600311 if (!strcmp(name, "BindBufferMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700312 return (void *)table->BindBufferMemory;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600313 if (!strcmp(name, "BindImageMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700314 return (void *)table->BindImageMemory;
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800315 if (!strcmp(name, "QueueBindSparse"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700316 return (void *)table->QueueBindSparse;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600317 if (!strcmp(name, "CreateFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700318 return (void *)table->CreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600319 if (!strcmp(name, "DestroyFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700320 return (void *)table->DestroyFence;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600321 if (!strcmp(name, "ResetFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700322 return (void *)table->ResetFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600323 if (!strcmp(name, "GetFenceStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700324 return (void *)table->GetFenceStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600325 if (!strcmp(name, "WaitForFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700326 return (void *)table->WaitForFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600327 if (!strcmp(name, "CreateSemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700328 return (void *)table->CreateSemaphore;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600329 if (!strcmp(name, "DestroySemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700330 return (void *)table->DestroySemaphore;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600331 if (!strcmp(name, "CreateEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700332 return (void *)table->CreateEvent;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600333 if (!strcmp(name, "DestroyEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700334 return (void *)table->DestroyEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600335 if (!strcmp(name, "GetEventStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700336 return (void *)table->GetEventStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600337 if (!strcmp(name, "SetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700338 return (void *)table->SetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600339 if (!strcmp(name, "ResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700340 return (void *)table->ResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600341 if (!strcmp(name, "CreateQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700342 return (void *)table->CreateQueryPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600343 if (!strcmp(name, "DestroyQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700344 return (void *)table->DestroyQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600345 if (!strcmp(name, "GetQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700346 return (void *)table->GetQueryPoolResults;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600347 if (!strcmp(name, "CreateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700348 return (void *)table->CreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600349 if (!strcmp(name, "DestroyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700350 return (void *)table->DestroyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600351 if (!strcmp(name, "CreateBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700352 return (void *)table->CreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600353 if (!strcmp(name, "DestroyBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700354 return (void *)table->DestroyBufferView;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600355 if (!strcmp(name, "CreateImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700356 return (void *)table->CreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600357 if (!strcmp(name, "DestroyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700358 return (void *)table->DestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -0600359 if (!strcmp(name, "GetImageSubresourceLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700360 return (void *)table->GetImageSubresourceLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600361 if (!strcmp(name, "CreateImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700362 return (void *)table->CreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600363 if (!strcmp(name, "DestroyImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700364 return (void *)table->DestroyImageView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600365 if (!strcmp(name, "CreateShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700366 return (void *)table->CreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600367 if (!strcmp(name, "DestroyShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700368 return (void *)table->DestroyShaderModule;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600369 if (!strcmp(name, "CreatePipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700370 return (void *)vkCreatePipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600371 if (!strcmp(name, "DestroyPipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700372 return (void *)vkDestroyPipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600373 if (!strcmp(name, "GetPipelineCacheData"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700374 return (void *)vkGetPipelineCacheData;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600375 if (!strcmp(name, "MergePipelineCaches"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700376 return (void *)vkMergePipelineCaches;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600377 if (!strcmp(name, "CreateGraphicsPipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700378 return (void *)vkCreateGraphicsPipelines;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600379 if (!strcmp(name, "CreateComputePipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700380 return (void *)vkCreateComputePipelines;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600381 if (!strcmp(name, "DestroyPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700382 return (void *)table->DestroyPipeline;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600383 if (!strcmp(name, "CreatePipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700384 return (void *)table->CreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600385 if (!strcmp(name, "DestroyPipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700386 return (void *)table->DestroyPipelineLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600387 if (!strcmp(name, "CreateSampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700388 return (void *)table->CreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600389 if (!strcmp(name, "DestroySampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700390 return (void *)table->DestroySampler;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600391 if (!strcmp(name, "CreateDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700392 return (void *)table->CreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600393 if (!strcmp(name, "DestroyDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700394 return (void *)table->DestroyDescriptorSetLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600395 if (!strcmp(name, "CreateDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700396 return (void *)table->CreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600397 if (!strcmp(name, "DestroyDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700398 return (void *)table->DestroyDescriptorPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600399 if (!strcmp(name, "ResetDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700400 return (void *)table->ResetDescriptorPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800401 if (!strcmp(name, "AllocateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700402 return (void *)table->AllocateDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600403 if (!strcmp(name, "FreeDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700404 return (void *)table->FreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800405 if (!strcmp(name, "UpdateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700406 return (void *)table->UpdateDescriptorSets;
Jon Ashburn754864f2015-07-23 18:49:07 -0600407 if (!strcmp(name, "CreateFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700408 return (void *)table->CreateFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600409 if (!strcmp(name, "DestroyFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700410 return (void *)table->DestroyFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600411 if (!strcmp(name, "CreateRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700412 return (void *)table->CreateRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600413 if (!strcmp(name, "DestroyRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700414 return (void *)table->DestroyRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600415 if (!strcmp(name, "GetRenderAreaGranularity"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700416 return (void *)table->GetRenderAreaGranularity;
Cody Northrope62183e2015-07-09 18:08:05 -0600417 if (!strcmp(name, "CreateCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700418 return (void *)table->CreateCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600419 if (!strcmp(name, "DestroyCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700420 return (void *)table->DestroyCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600421 if (!strcmp(name, "ResetCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700422 return (void *)table->ResetCommandPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800423 if (!strcmp(name, "AllocateCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700424 return (void *)table->AllocateCommandBuffers;
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600425 if (!strcmp(name, "FreeCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700426 return (void *)table->FreeCommandBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600427 if (!strcmp(name, "BeginCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700428 return (void *)table->BeginCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600429 if (!strcmp(name, "EndCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700430 return (void *)table->EndCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600431 if (!strcmp(name, "ResetCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700432 return (void *)table->ResetCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600433 if (!strcmp(name, "CmdBindPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700434 return (void *)table->CmdBindPipeline;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600435 if (!strcmp(name, "CmdSetViewport"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700436 return (void *)table->CmdSetViewport;
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -0600437 if (!strcmp(name, "CmdSetScissor"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700438 return (void *)table->CmdSetScissor;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600439 if (!strcmp(name, "CmdSetLineWidth"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700440 return (void *)table->CmdSetLineWidth;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600441 if (!strcmp(name, "CmdSetDepthBias"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700442 return (void *)table->CmdSetDepthBias;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600443 if (!strcmp(name, "CmdSetBlendConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700444 return (void *)table->CmdSetBlendConstants;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600445 if (!strcmp(name, "CmdSetDepthBounds"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700446 return (void *)table->CmdSetDepthBounds;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600447 if (!strcmp(name, "CmdSetStencilCompareMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700448 return (void *)table->CmdSetStencilCompareMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600449 if (!strcmp(name, "CmdSetStencilwriteMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700450 return (void *)table->CmdSetStencilWriteMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600451 if (!strcmp(name, "CmdSetStencilReference"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700452 return (void *)table->CmdSetStencilReference;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600453 if (!strcmp(name, "CmdBindDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700454 return (void *)table->CmdBindDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600455 if (!strcmp(name, "CmdBindVertexBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700456 return (void *)table->CmdBindVertexBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600457 if (!strcmp(name, "CmdBindIndexBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700458 return (void *)table->CmdBindIndexBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600459 if (!strcmp(name, "CmdDraw"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700460 return (void *)table->CmdDraw;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600461 if (!strcmp(name, "CmdDrawIndexed"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700462 return (void *)table->CmdDrawIndexed;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600463 if (!strcmp(name, "CmdDrawIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700464 return (void *)table->CmdDrawIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600465 if (!strcmp(name, "CmdDrawIndexedIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700466 return (void *)table->CmdDrawIndexedIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600467 if (!strcmp(name, "CmdDispatch"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700468 return (void *)table->CmdDispatch;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600469 if (!strcmp(name, "CmdDispatchIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700470 return (void *)table->CmdDispatchIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600471 if (!strcmp(name, "CmdCopyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700472 return (void *)table->CmdCopyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600473 if (!strcmp(name, "CmdCopyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700474 return (void *)table->CmdCopyImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600475 if (!strcmp(name, "CmdBlitImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700476 return (void *)table->CmdBlitImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600477 if (!strcmp(name, "CmdCopyBufferToImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700478 return (void *)table->CmdCopyBufferToImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600479 if (!strcmp(name, "CmdCopyImageToBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700480 return (void *)table->CmdCopyImageToBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600481 if (!strcmp(name, "CmdUpdateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700482 return (void *)table->CmdUpdateBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600483 if (!strcmp(name, "CmdFillBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700484 return (void *)table->CmdFillBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600485 if (!strcmp(name, "CmdClearColorImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700486 return (void *)table->CmdClearColorImage;
Chris Forbesd9be82b2015-06-22 17:21:59 +1200487 if (!strcmp(name, "CmdClearDepthStencilImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700488 return (void *)table->CmdClearDepthStencilImage;
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -0600489 if (!strcmp(name, "CmdClearAttachments"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700490 return (void *)table->CmdClearAttachments;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600491 if (!strcmp(name, "CmdResolveImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700492 return (void *)table->CmdResolveImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600493 if (!strcmp(name, "CmdSetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700494 return (void *)table->CmdSetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600495 if (!strcmp(name, "CmdResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700496 return (void *)table->CmdResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600497 if (!strcmp(name, "CmdWaitEvents"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700498 return (void *)table->CmdWaitEvents;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600499 if (!strcmp(name, "CmdPipelineBarrier"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700500 return (void *)table->CmdPipelineBarrier;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600501 if (!strcmp(name, "CmdBeginQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700502 return (void *)table->CmdBeginQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600503 if (!strcmp(name, "CmdEndQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700504 return (void *)table->CmdEndQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600505 if (!strcmp(name, "CmdResetQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700506 return (void *)table->CmdResetQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600507 if (!strcmp(name, "CmdWriteTimestamp"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700508 return (void *)table->CmdWriteTimestamp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600509 if (!strcmp(name, "CmdCopyQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700510 return (void *)table->CmdCopyQueryPoolResults;
Jon Ashburn754864f2015-07-23 18:49:07 -0600511 if (!strcmp(name, "CmdPushConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700512 return (void *)table->CmdPushConstants;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600513 if (!strcmp(name, "CmdBeginRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700514 return (void *)table->CmdBeginRenderPass;
Chia-I Wu08accc62015-07-07 11:50:03 +0800515 if (!strcmp(name, "CmdNextSubpass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700516 return (void *)table->CmdNextSubpass;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600517 if (!strcmp(name, "CmdEndRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700518 return (void *)table->CmdEndRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600519 if (!strcmp(name, "CmdExecuteCommands"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700520 return (void *)table->CmdExecuteCommands;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600521
522 return NULL;
523}
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600524
Jon Ashburn23d36b12016-02-02 17:47:28 -0700525static inline void
526loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table,
527 PFN_vkGetInstanceProcAddr gpa,
528 VkInstance inst) {
529 table->GetInstanceProcAddr =
530 (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr");
531 table->DestroyInstance =
532 (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance");
533 table->EnumeratePhysicalDevices =
534 (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices");
535 table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa(
536 inst, "vkGetPhysicalDeviceFeatures");
537 table->GetPhysicalDeviceImageFormatProperties =
538 (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa(
539 inst, "vkGetPhysicalDeviceImageFormatProperties");
540 table->GetPhysicalDeviceFormatProperties =
541 (PFN_vkGetPhysicalDeviceFormatProperties)gpa(
542 inst, "vkGetPhysicalDeviceFormatProperties");
543 table->GetPhysicalDeviceSparseImageFormatProperties =
544 (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa(
545 inst, "vkGetPhysicalDeviceSparseImageFormatProperties");
546 table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa(
547 inst, "vkGetPhysicalDeviceProperties");
548 table->GetPhysicalDeviceQueueFamilyProperties =
549 (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa(
550 inst, "vkGetPhysicalDeviceQueueFamilyProperties");
551 table->GetPhysicalDeviceMemoryProperties =
552 (PFN_vkGetPhysicalDeviceMemoryProperties)gpa(
553 inst, "vkGetPhysicalDeviceMemoryProperties");
554 table->EnumerateDeviceExtensionProperties =
555 (PFN_vkEnumerateDeviceExtensionProperties)gpa(
556 inst, "vkEnumerateDeviceExtensionProperties");
557 table->EnumerateDeviceLayerProperties =
558 (PFN_vkEnumerateDeviceLayerProperties)gpa(
559 inst, "vkEnumerateDeviceLayerProperties");
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600560}
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600561
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600562static inline void loader_init_instance_extension_dispatch_table(
Jon Ashburn23d36b12016-02-02 17:47:28 -0700563 VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
564 VkInstance inst) {
565 table->DestroySurfaceKHR =
566 (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR");
567 table->CreateDebugReportCallbackEXT =
568 (PFN_vkCreateDebugReportCallbackEXT)gpa(
569 inst, "vkCreateDebugReportCallbackEXT");
570 table->DestroyDebugReportCallbackEXT =
571 (PFN_vkDestroyDebugReportCallbackEXT)gpa(
572 inst, "vkDestroyDebugReportCallbackEXT");
573 table->DebugReportMessageEXT =
574 (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT");
575 table->GetPhysicalDeviceSurfaceSupportKHR =
576 (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa(
577 inst, "vkGetPhysicalDeviceSurfaceSupportKHR");
578 table->GetPhysicalDeviceSurfaceCapabilitiesKHR =
579 (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa(
580 inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
581 table->GetPhysicalDeviceSurfaceFormatsKHR =
582 (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa(
583 inst, "vkGetPhysicalDeviceSurfaceFormatsKHR");
584 table->GetPhysicalDeviceSurfacePresentModesKHR =
585 (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa(
586 inst, "vkGetPhysicalDeviceSurfacePresentModesKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700587#ifdef VK_USE_PLATFORM_MIR_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700588 table->CreateMirSurfaceKHR =
589 (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR");
590 table->GetPhysicalDeviceMirPresentationSupportKHR =
591 (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa(
592 inst, "vkGetPhysicalDeviceMirPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700593#endif
594#ifdef VK_USE_PLATFORM_WAYLAND_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700595 table->CreateWaylandSurfaceKHR =
596 (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR");
597 table->GetPhysicalDeviceWaylandPresentationSupportKHR =
598 (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa(
599 inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700600#endif
601#ifdef VK_USE_PLATFORM_WIN32_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700602 table->CreateWin32SurfaceKHR =
603 (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR");
604 table->GetPhysicalDeviceWin32PresentationSupportKHR =
605 (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa(
606 inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700607#endif
608#ifdef VK_USE_PLATFORM_XCB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700609 table->CreateXcbSurfaceKHR =
610 (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR");
611 table->GetPhysicalDeviceXcbPresentationSupportKHR =
612 (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa(
613 inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700614#endif
615#ifdef VK_USE_PLATFORM_XLIB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700616 table->CreateXlibSurfaceKHR =
617 (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR");
618 table->GetPhysicalDeviceXlibPresentationSupportKHR =
619 (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa(
620 inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700621#endif
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700622 table->GetPhysicalDeviceDisplayPropertiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600623 (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)gpa(
624 inst, "vkGetPhysicalDeviceDisplayPropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700625 table->GetPhysicalDeviceDisplayPlanePropertiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600626 (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)gpa(
627 inst, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700628 table->GetDisplayPlaneSupportedDisplaysKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600629 (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)gpa(
630 inst, "vkGetDisplayPlaneSupportedDisplaysKHR");
631 table->GetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR)gpa(
632 inst, "vkGetDisplayModePropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700633 table->CreateDisplayModeKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600634 (PFN_vkCreateDisplayModeKHR)gpa(inst, "vkCreateDisplayModeKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700635 table->GetDisplayPlaneCapabilitiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600636 (PFN_vkGetDisplayPlaneCapabilitiesKHR)gpa(
637 inst, "vkGetDisplayPlaneCapabilitiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700638 table->CreateDisplayPlaneSurfaceKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600639 (PFN_vkCreateDisplayPlaneSurfaceKHR)gpa(
640 inst, "vkCreateDisplayPlaneSurfaceKHR");
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600641}
Jon Ashburn27cd5842015-05-12 17:26:48 -0600642
Jon Ashburn23d36b12016-02-02 17:47:28 -0700643static inline void *
644loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table,
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700645 const char *name, bool *found_name) {
646 if (!name || name[0] != 'v' || name[1] != 'k') {
647 *found_name = false;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600648 return NULL;
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700649 }
Jon Ashburn27cd5842015-05-12 17:26:48 -0600650
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700651 *found_name = true;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600652 name += 2;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600653 if (!strcmp(name, "DestroyInstance"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700654 return (void *)table->DestroyInstance;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600655 if (!strcmp(name, "EnumeratePhysicalDevices"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700656 return (void *)table->EnumeratePhysicalDevices;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200657 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700658 return (void *)table->GetPhysicalDeviceFeatures;
Jon Ashburn754864f2015-07-23 18:49:07 -0600659 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700660 return (void *)table->GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600661 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700662 return (void *)table->GetPhysicalDeviceFormatProperties;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600663 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700664 return (void *)table->GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600665 if (!strcmp(name, "GetPhysicalDeviceProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700666 return (void *)table->GetPhysicalDeviceProperties;
Cody Northropd0802882015-08-03 17:04:53 -0600667 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700668 return (void *)table->GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600669 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700670 return (void *)table->GetPhysicalDeviceMemoryProperties;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600671 if (!strcmp(name, "GetInstanceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700672 return (void *)table->GetInstanceProcAddr;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600673 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700674 return (void *)table->EnumerateDeviceExtensionProperties;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600675 if (!strcmp(name, "EnumerateDeviceLayerProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700676 return (void *)table->EnumerateDeviceLayerProperties;
Ian Elliottfb42cd72015-11-25 14:43:02 -0700677 if (!strcmp(name, "DestroySurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700678 return (void *)table->DestroySurfaceKHR;
Ian Elliott7e40db92015-08-21 15:09:33 -0600679 if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700680 return (void *)table->GetPhysicalDeviceSurfaceSupportKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700681 if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700682 return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700683 if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700684 return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700685 if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700686 return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700687#ifdef VK_USE_PLATFORM_MIR_KHR
688 if (!strcmp(name, "CreateMirSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700689 return (void *)table->CreateMirSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700690 if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700691 return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700692#endif
693#ifdef VK_USE_PLATFORM_WAYLAND_KHR
694 if (!strcmp(name, "CreateWaylandSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700695 return (void *)table->CreateWaylandSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700696 if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700697 return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700698#endif
699#ifdef VK_USE_PLATFORM_WIN32_KHR
700 if (!strcmp(name, "CreateWin32SurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700701 return (void *)table->CreateWin32SurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700702 if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700703 return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700704#endif
705#ifdef VK_USE_PLATFORM_XCB_KHR
706 if (!strcmp(name, "CreateXcbSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700707 return (void *)table->CreateXcbSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700708 if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700709 return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700710#endif
711#ifdef VK_USE_PLATFORM_XLIB_KHR
712 if (!strcmp(name, "CreateXlibSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700713 return (void *)table->CreateXlibSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700714 if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700715 return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700716#endif
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700717 if (!strcmp(name, "GetPhysicalDeviceDisplayPropertiesKHR"))
718 return (void *)table->GetPhysicalDeviceDisplayPropertiesKHR;
719 if (!strcmp(name, "GetPhysicalDeviceDisplayPlanePropertiesKHR"))
720 return (void *)table->GetPhysicalDeviceDisplayPlanePropertiesKHR;
721 if (!strcmp(name, "GetDisplayPlaneSupportedDisplaysKHR"))
722 return (void *)table->GetDisplayPlaneSupportedDisplaysKHR;
723 if (!strcmp(name, "GetDisplayModePropertiesKHR"))
724 return (void *)table->GetDisplayModePropertiesKHR;
725 if (!strcmp(name, "CreateDisplayModeKHR"))
726 return (void *)table->CreateDisplayModeKHR;
727 if (!strcmp(name, "GetDisplayPlaneCapabilitiesKHR"))
728 return (void *)table->GetDisplayPlaneCapabilitiesKHR;
729 if (!strcmp(name, "CreateDisplayPlaneSurfaceKHR"))
730 return (void *)table->CreateDisplayPlaneSurfaceKHR;
731
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700732 if (!strcmp(name, "CreateDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700733 return (void *)table->CreateDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700734 if (!strcmp(name, "DestroyDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700735 return (void *)table->DestroyDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700736 if (!strcmp(name, "DebugReportMessageEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700737 return (void *)table->DebugReportMessageEXT;
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600738
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700739 *found_name = false;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600740 return NULL;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600741}