blob: eecc952a9d42681f8d05e429b17ad488478b663c [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
Jamie Madill3fbf0772016-12-21 13:09:59 -050032static VkResult VKAPI_CALL vkDevExtError(VkDevice dev) {
Jon Ashburn2e37d752016-02-12 08:20:06 -070033 struct loader_device *found_dev;
Mark Young65cb3662016-11-07 13:27:02 -070034 // The device going in is a trampoline device
Mark Young0153e0b2016-11-03 14:27:13 -060035 struct loader_icd_term *icd_term =
36 loader_get_icd_and_device(dev, &found_dev, NULL);
Jon Ashburn2e37d752016-02-12 08:20:06 -070037
Mark Young0153e0b2016-11-03 14:27:13 -060038 if (icd_term)
39 loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
Jon Ashburn2e37d752016-02-12 08:20:06 -070040 "Bad destination in loader trampoline dispatch,"
41 "Are layers and extensions that you are calling enabled?");
42 return VK_ERROR_EXTENSION_NOT_PRESENT;
Jon Ashburnfc1031e2015-11-17 15:31:02 -070043}
44
Jon Ashburn23d36b12016-02-02 17:47:28 -070045static inline void
46loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table,
47 PFN_vkGetDeviceProcAddr gpa, VkDevice dev) {
Jon Ashburnfc1031e2015-11-17 15:31:02 -070048 VkLayerDispatchTable *table = &dev_table->core_dispatch;
49 for (uint32_t i = 0; i < MAX_NUM_DEV_EXTS; i++)
Mark Young8191d9f2016-09-02 11:41:28 -060050 dev_table->ext_dispatch.dev_ext[i] = (PFN_vkDevExt)vkDevExtError;
Jon Ashburn8fd08252015-05-28 16:25:02 -060051
Jon Ashburn23d36b12016-02-02 17:47:28 -070052 table->GetDeviceProcAddr =
53 (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr");
54 table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice");
55 table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue");
56 table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit");
57 table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle");
58 table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle");
59 table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory");
60 table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory");
61 table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory");
62 table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory");
63 table->FlushMappedMemoryRanges =
64 (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges");
65 table->InvalidateMappedMemoryRanges =
66 (PFN_vkInvalidateMappedMemoryRanges)gpa(
67 dev, "vkInvalidateMappedMemoryRanges");
68 table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa(
69 dev, "vkGetDeviceMemoryCommitment");
70 table->GetImageSparseMemoryRequirements =
71 (PFN_vkGetImageSparseMemoryRequirements)gpa(
72 dev, "vkGetImageSparseMemoryRequirements");
73 table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa(
74 dev, "vkGetBufferMemoryRequirements");
75 table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa(
76 dev, "vkGetImageMemoryRequirements");
77 table->BindBufferMemory =
78 (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory");
79 table->BindImageMemory =
80 (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory");
81 table->QueueBindSparse =
82 (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse");
83 table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence");
84 table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence");
85 table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences");
86 table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus");
87 table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences");
88 table->CreateSemaphore =
89 (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore");
90 table->DestroySemaphore =
91 (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore");
92 table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent");
93 table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent");
94 table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus");
95 table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent");
96 table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent");
97 table->CreateQueryPool =
98 (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool");
99 table->DestroyQueryPool =
100 (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool");
101 table->GetQueryPoolResults =
102 (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults");
103 table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer");
104 table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer");
105 table->CreateBufferView =
106 (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView");
107 table->DestroyBufferView =
108 (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView");
109 table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage");
110 table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage");
111 table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa(
112 dev, "vkGetImageSubresourceLayout");
113 table->CreateImageView =
114 (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView");
115 table->DestroyImageView =
116 (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView");
117 table->CreateShaderModule =
118 (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule");
119 table->DestroyShaderModule =
120 (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule");
121 table->CreatePipelineCache =
122 (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache");
123 table->DestroyPipelineCache =
124 (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache");
125 table->GetPipelineCacheData =
126 (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData");
127 table->MergePipelineCaches =
128 (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches");
129 table->CreateGraphicsPipelines =
130 (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines");
131 table->CreateComputePipelines =
132 (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines");
133 table->DestroyPipeline =
134 (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline");
135 table->CreatePipelineLayout =
136 (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout");
137 table->DestroyPipelineLayout =
138 (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout");
139 table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler");
140 table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler");
141 table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa(
142 dev, "vkCreateDescriptorSetLayout");
143 table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa(
144 dev, "vkDestroyDescriptorSetLayout");
145 table->CreateDescriptorPool =
146 (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool");
147 table->DestroyDescriptorPool =
148 (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool");
149 table->ResetDescriptorPool =
150 (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool");
151 table->AllocateDescriptorSets =
152 (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets");
153 table->FreeDescriptorSets =
154 (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets");
155 table->UpdateDescriptorSets =
156 (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets");
157 table->CreateFramebuffer =
158 (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer");
159 table->DestroyFramebuffer =
160 (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer");
161 table->CreateRenderPass =
162 (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass");
163 table->DestroyRenderPass =
164 (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass");
165 table->GetRenderAreaGranularity =
166 (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity");
167 table->CreateCommandPool =
168 (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool");
169 table->DestroyCommandPool =
170 (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool");
171 table->ResetCommandPool =
172 (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool");
173 table->AllocateCommandBuffers =
174 (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers");
175 table->FreeCommandBuffers =
176 (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers");
177 table->BeginCommandBuffer =
178 (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer");
179 table->EndCommandBuffer =
180 (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer");
181 table->ResetCommandBuffer =
182 (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer");
183 table->CmdBindPipeline =
184 (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline");
185 table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport");
186 table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor");
187 table->CmdSetLineWidth =
188 (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth");
189 table->CmdSetDepthBias =
190 (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias");
191 table->CmdSetBlendConstants =
192 (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants");
193 table->CmdSetDepthBounds =
194 (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds");
195 table->CmdSetStencilCompareMask =
196 (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask");
197 table->CmdSetStencilWriteMask =
198 (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask");
199 table->CmdSetStencilReference =
200 (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference");
201 table->CmdBindDescriptorSets =
202 (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets");
203 table->CmdBindVertexBuffers =
204 (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers");
205 table->CmdBindIndexBuffer =
206 (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer");
207 table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw");
208 table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed");
209 table->CmdDrawIndirect =
210 (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect");
211 table->CmdDrawIndexedIndirect =
212 (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect");
213 table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch");
214 table->CmdDispatchIndirect =
215 (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect");
216 table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer");
217 table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage");
218 table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage");
219 table->CmdCopyBufferToImage =
220 (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage");
221 table->CmdCopyImageToBuffer =
222 (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer");
223 table->CmdUpdateBuffer =
224 (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer");
225 table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer");
226 table->CmdClearColorImage =
227 (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage");
228 table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa(
229 dev, "vkCmdClearDepthStencilImage");
230 table->CmdClearAttachments =
231 (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments");
232 table->CmdResolveImage =
233 (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage");
234 table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent");
235 table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent");
236 table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents");
237 table->CmdPipelineBarrier =
238 (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier");
239 table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery");
240 table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery");
241 table->CmdResetQueryPool =
242 (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool");
243 table->CmdWriteTimestamp =
244 (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp");
245 table->CmdCopyQueryPoolResults =
246 (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults");
247 table->CmdPushConstants =
248 (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants");
249 table->CmdBeginRenderPass =
250 (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass");
251 table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass");
252 table->CmdEndRenderPass =
253 (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass");
254 table->CmdExecuteCommands =
255 (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands");
Jon Ashburn232e3af2015-11-30 17:21:25 -0700256}
257
Jon Ashburn23d36b12016-02-02 17:47:28 -0700258static inline void loader_init_device_extension_dispatch_table(
259 struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa,
260 VkDevice dev) {
Jon Ashburn232e3af2015-11-30 17:21:25 -0700261 VkLayerDispatchTable *table = &dev_table->core_dispatch;
Jon Ashburn23d36b12016-02-02 17:47:28 -0700262 table->AcquireNextImageKHR =
263 (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR");
264 table->CreateSwapchainKHR =
265 (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR");
266 table->DestroySwapchainKHR =
267 (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR");
268 table->GetSwapchainImagesKHR =
269 (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR");
270 table->QueuePresentKHR =
271 (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR");
Mark Lobodzinski0853ad52016-08-29 14:54:34 -0600272 table->CmdDrawIndirectCountAMD =
273 (PFN_vkCmdDrawIndirectCountAMD)gpa(dev, "vkCmdDrawIndirectCountAMD");
274 table->CmdDrawIndexedIndirectCountAMD =
275 (PFN_vkCmdDrawIndexedIndirectCountAMD)gpa(
276 dev, "vkCmdDrawIndexedIndirectCountAMD");
Mark Lobodzinski5f208522016-08-29 15:36:23 -0600277#ifdef VK_USE_PLATFORM_WIN32_KHR
278 table->GetMemoryWin32HandleNV =
279 (PFN_vkGetMemoryWin32HandleNV)gpa(dev, "vkGetMemoryWin32HandleNV");
280#endif // VK_USE_PLATFORM_WIN32_KHR
Mark Young1a867442016-07-01 15:18:27 -0600281 table->CreateSharedSwapchainsKHR =
282 (PFN_vkCreateSharedSwapchainsKHR)gpa(dev, "vkCreateSharedSwapchainsKHR");
283 table->DebugMarkerSetObjectTagEXT =
284 (PFN_vkDebugMarkerSetObjectTagEXT)gpa(dev, "vkDebugMarkerSetObjectTagEXT");
285 table->DebugMarkerSetObjectNameEXT =
286 (PFN_vkDebugMarkerSetObjectNameEXT)gpa(dev, "vkDebugMarkerSetObjectNameEXT");
287 table->CmdDebugMarkerBeginEXT =
288 (PFN_vkCmdDebugMarkerBeginEXT)gpa(dev, "vkCmdDebugMarkerBeginEXT");
289 table->CmdDebugMarkerEndEXT =
290 (PFN_vkCmdDebugMarkerEndEXT)gpa(dev, "vkCmdDebugMarkerEndEXT");
291 table->CmdDebugMarkerInsertEXT =
292 (PFN_vkCmdDebugMarkerInsertEXT)gpa(dev, "vkCmdDebugMarkerInsertEXT");
Mark Youngfa552782016-12-12 16:14:55 -0700293
294 // NVX_device_generated_commands
295 table->CmdProcessCommandsNVX =
296 (PFN_vkCmdProcessCommandsNVX)gpa(dev, "vkCmdProcessCommandsNVX");
297 table->CmdReserveSpaceForCommandsNVX =
298 (PFN_vkCmdReserveSpaceForCommandsNVX)gpa(
299 dev, "vkCmdReserveSpaceForCommandsNVX");
300 table->CreateIndirectCommandsLayoutNVX =
301 (PFN_vkCreateIndirectCommandsLayoutNVX)gpa(
302 dev, "vkCreateIndirectCommandsLayoutNVX");
303 table->DestroyIndirectCommandsLayoutNVX =
304 (PFN_vkDestroyIndirectCommandsLayoutNVX)gpa(
305 dev, "vkDestroyIndirectCommandsLayoutNVX");
306 table->CreateObjectTableNVX =
307 (PFN_vkCreateObjectTableNVX)gpa(dev, "vkCreateObjectTableNVX");
308 table->DestroyObjectTableNVX =
309 (PFN_vkDestroyObjectTableNVX)gpa(dev, "vkDestroyObjectTableNVX");
310 table->RegisterObjectsNVX =
311 (PFN_vkRegisterObjectsNVX)gpa(dev, "vkRegisterObjectsNVX");
312 table->UnregisterObjectsNVX =
313 (PFN_vkUnregisterObjectsNVX)gpa(dev, "vkUnregisterObjectsNVX");
Jon Ashburnd55a3942015-05-06 09:02:10 -0600314}
315
Jon Ashburn23d36b12016-02-02 17:47:28 -0700316static inline void *
317loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table,
318 const char *name) {
Jon Ashburnd55a3942015-05-06 09:02:10 -0600319 if (!name || name[0] != 'v' || name[1] != 'k')
320 return NULL;
321
322 name += 2;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600323 if (!strcmp(name, "GetDeviceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700324 return (void *)table->GetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600325 if (!strcmp(name, "DestroyDevice"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700326 return (void *)table->DestroyDevice;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600327 if (!strcmp(name, "GetDeviceQueue"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700328 return (void *)table->GetDeviceQueue;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600329 if (!strcmp(name, "QueueSubmit"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700330 return (void *)table->QueueSubmit;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600331 if (!strcmp(name, "QueueWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700332 return (void *)table->QueueWaitIdle;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600333 if (!strcmp(name, "DeviceWaitIdle"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700334 return (void *)table->DeviceWaitIdle;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800335 if (!strcmp(name, "AllocateMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700336 return (void *)table->AllocateMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600337 if (!strcmp(name, "FreeMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700338 return (void *)table->FreeMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600339 if (!strcmp(name, "MapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700340 return (void *)table->MapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600341 if (!strcmp(name, "UnmapMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700342 return (void *)table->UnmapMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600343 if (!strcmp(name, "FlushMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700344 return (void *)table->FlushMappedMemoryRanges;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600345 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700346 return (void *)table->InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -0600347 if (!strcmp(name, "GetDeviceMemoryCommitment"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700348 return (void *)table->GetDeviceMemoryCommitment;
Jon Ashburn754864f2015-07-23 18:49:07 -0600349 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700350 return (void *)table->GetImageSparseMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600351 if (!strcmp(name, "GetBufferMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700352 return (void *)table->GetBufferMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600353 if (!strcmp(name, "GetImageMemoryRequirements"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700354 return (void *)table->GetImageMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600355 if (!strcmp(name, "BindBufferMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700356 return (void *)table->BindBufferMemory;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600357 if (!strcmp(name, "BindImageMemory"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700358 return (void *)table->BindImageMemory;
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800359 if (!strcmp(name, "QueueBindSparse"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700360 return (void *)table->QueueBindSparse;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600361 if (!strcmp(name, "CreateFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700362 return (void *)table->CreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600363 if (!strcmp(name, "DestroyFence"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700364 return (void *)table->DestroyFence;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600365 if (!strcmp(name, "ResetFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700366 return (void *)table->ResetFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600367 if (!strcmp(name, "GetFenceStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700368 return (void *)table->GetFenceStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600369 if (!strcmp(name, "WaitForFences"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700370 return (void *)table->WaitForFences;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600371 if (!strcmp(name, "CreateSemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700372 return (void *)table->CreateSemaphore;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600373 if (!strcmp(name, "DestroySemaphore"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700374 return (void *)table->DestroySemaphore;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600375 if (!strcmp(name, "CreateEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700376 return (void *)table->CreateEvent;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600377 if (!strcmp(name, "DestroyEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700378 return (void *)table->DestroyEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600379 if (!strcmp(name, "GetEventStatus"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700380 return (void *)table->GetEventStatus;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600381 if (!strcmp(name, "SetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700382 return (void *)table->SetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600383 if (!strcmp(name, "ResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700384 return (void *)table->ResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600385 if (!strcmp(name, "CreateQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700386 return (void *)table->CreateQueryPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600387 if (!strcmp(name, "DestroyQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700388 return (void *)table->DestroyQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600389 if (!strcmp(name, "GetQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700390 return (void *)table->GetQueryPoolResults;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600391 if (!strcmp(name, "CreateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700392 return (void *)table->CreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600393 if (!strcmp(name, "DestroyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700394 return (void *)table->DestroyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600395 if (!strcmp(name, "CreateBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700396 return (void *)table->CreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600397 if (!strcmp(name, "DestroyBufferView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700398 return (void *)table->DestroyBufferView;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600399 if (!strcmp(name, "CreateImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700400 return (void *)table->CreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600401 if (!strcmp(name, "DestroyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700402 return (void *)table->DestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -0600403 if (!strcmp(name, "GetImageSubresourceLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700404 return (void *)table->GetImageSubresourceLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600405 if (!strcmp(name, "CreateImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700406 return (void *)table->CreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600407 if (!strcmp(name, "DestroyImageView"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700408 return (void *)table->DestroyImageView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600409 if (!strcmp(name, "CreateShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700410 return (void *)table->CreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600411 if (!strcmp(name, "DestroyShaderModule"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700412 return (void *)table->DestroyShaderModule;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600413 if (!strcmp(name, "CreatePipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700414 return (void *)vkCreatePipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600415 if (!strcmp(name, "DestroyPipelineCache"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700416 return (void *)vkDestroyPipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600417 if (!strcmp(name, "GetPipelineCacheData"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700418 return (void *)vkGetPipelineCacheData;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600419 if (!strcmp(name, "MergePipelineCaches"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700420 return (void *)vkMergePipelineCaches;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600421 if (!strcmp(name, "CreateGraphicsPipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700422 return (void *)vkCreateGraphicsPipelines;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600423 if (!strcmp(name, "CreateComputePipelines"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700424 return (void *)vkCreateComputePipelines;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600425 if (!strcmp(name, "DestroyPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700426 return (void *)table->DestroyPipeline;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600427 if (!strcmp(name, "CreatePipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700428 return (void *)table->CreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600429 if (!strcmp(name, "DestroyPipelineLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700430 return (void *)table->DestroyPipelineLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600431 if (!strcmp(name, "CreateSampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700432 return (void *)table->CreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600433 if (!strcmp(name, "DestroySampler"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700434 return (void *)table->DestroySampler;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600435 if (!strcmp(name, "CreateDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700436 return (void *)table->CreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600437 if (!strcmp(name, "DestroyDescriptorSetLayout"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700438 return (void *)table->DestroyDescriptorSetLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600439 if (!strcmp(name, "CreateDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700440 return (void *)table->CreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600441 if (!strcmp(name, "DestroyDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700442 return (void *)table->DestroyDescriptorPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600443 if (!strcmp(name, "ResetDescriptorPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700444 return (void *)table->ResetDescriptorPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800445 if (!strcmp(name, "AllocateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700446 return (void *)table->AllocateDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600447 if (!strcmp(name, "FreeDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700448 return (void *)table->FreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800449 if (!strcmp(name, "UpdateDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700450 return (void *)table->UpdateDescriptorSets;
Jon Ashburn754864f2015-07-23 18:49:07 -0600451 if (!strcmp(name, "CreateFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700452 return (void *)table->CreateFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600453 if (!strcmp(name, "DestroyFramebuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700454 return (void *)table->DestroyFramebuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600455 if (!strcmp(name, "CreateRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700456 return (void *)table->CreateRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600457 if (!strcmp(name, "DestroyRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700458 return (void *)table->DestroyRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600459 if (!strcmp(name, "GetRenderAreaGranularity"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700460 return (void *)table->GetRenderAreaGranularity;
Cody Northrope62183e2015-07-09 18:08:05 -0600461 if (!strcmp(name, "CreateCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700462 return (void *)table->CreateCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600463 if (!strcmp(name, "DestroyCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700464 return (void *)table->DestroyCommandPool;
Cody Northrope62183e2015-07-09 18:08:05 -0600465 if (!strcmp(name, "ResetCommandPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700466 return (void *)table->ResetCommandPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800467 if (!strcmp(name, "AllocateCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700468 return (void *)table->AllocateCommandBuffers;
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600469 if (!strcmp(name, "FreeCommandBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700470 return (void *)table->FreeCommandBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600471 if (!strcmp(name, "BeginCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700472 return (void *)table->BeginCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600473 if (!strcmp(name, "EndCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700474 return (void *)table->EndCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600475 if (!strcmp(name, "ResetCommandBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700476 return (void *)table->ResetCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600477 if (!strcmp(name, "CmdBindPipeline"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700478 return (void *)table->CmdBindPipeline;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600479 if (!strcmp(name, "CmdSetViewport"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700480 return (void *)table->CmdSetViewport;
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -0600481 if (!strcmp(name, "CmdSetScissor"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700482 return (void *)table->CmdSetScissor;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600483 if (!strcmp(name, "CmdSetLineWidth"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700484 return (void *)table->CmdSetLineWidth;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600485 if (!strcmp(name, "CmdSetDepthBias"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700486 return (void *)table->CmdSetDepthBias;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600487 if (!strcmp(name, "CmdSetBlendConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700488 return (void *)table->CmdSetBlendConstants;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600489 if (!strcmp(name, "CmdSetDepthBounds"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700490 return (void *)table->CmdSetDepthBounds;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600491 if (!strcmp(name, "CmdSetStencilCompareMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700492 return (void *)table->CmdSetStencilCompareMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600493 if (!strcmp(name, "CmdSetStencilwriteMask"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700494 return (void *)table->CmdSetStencilWriteMask;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600495 if (!strcmp(name, "CmdSetStencilReference"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700496 return (void *)table->CmdSetStencilReference;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600497 if (!strcmp(name, "CmdBindDescriptorSets"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700498 return (void *)table->CmdBindDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600499 if (!strcmp(name, "CmdBindVertexBuffers"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700500 return (void *)table->CmdBindVertexBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600501 if (!strcmp(name, "CmdBindIndexBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700502 return (void *)table->CmdBindIndexBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600503 if (!strcmp(name, "CmdDraw"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700504 return (void *)table->CmdDraw;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600505 if (!strcmp(name, "CmdDrawIndexed"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700506 return (void *)table->CmdDrawIndexed;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600507 if (!strcmp(name, "CmdDrawIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700508 return (void *)table->CmdDrawIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600509 if (!strcmp(name, "CmdDrawIndexedIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700510 return (void *)table->CmdDrawIndexedIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600511 if (!strcmp(name, "CmdDispatch"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700512 return (void *)table->CmdDispatch;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600513 if (!strcmp(name, "CmdDispatchIndirect"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700514 return (void *)table->CmdDispatchIndirect;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600515 if (!strcmp(name, "CmdCopyBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700516 return (void *)table->CmdCopyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600517 if (!strcmp(name, "CmdCopyImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700518 return (void *)table->CmdCopyImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600519 if (!strcmp(name, "CmdBlitImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700520 return (void *)table->CmdBlitImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600521 if (!strcmp(name, "CmdCopyBufferToImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700522 return (void *)table->CmdCopyBufferToImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600523 if (!strcmp(name, "CmdCopyImageToBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700524 return (void *)table->CmdCopyImageToBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600525 if (!strcmp(name, "CmdUpdateBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700526 return (void *)table->CmdUpdateBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600527 if (!strcmp(name, "CmdFillBuffer"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700528 return (void *)table->CmdFillBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600529 if (!strcmp(name, "CmdClearColorImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700530 return (void *)table->CmdClearColorImage;
Chris Forbesd9be82b2015-06-22 17:21:59 +1200531 if (!strcmp(name, "CmdClearDepthStencilImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700532 return (void *)table->CmdClearDepthStencilImage;
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -0600533 if (!strcmp(name, "CmdClearAttachments"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700534 return (void *)table->CmdClearAttachments;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600535 if (!strcmp(name, "CmdResolveImage"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700536 return (void *)table->CmdResolveImage;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600537 if (!strcmp(name, "CmdSetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700538 return (void *)table->CmdSetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600539 if (!strcmp(name, "CmdResetEvent"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700540 return (void *)table->CmdResetEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600541 if (!strcmp(name, "CmdWaitEvents"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700542 return (void *)table->CmdWaitEvents;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600543 if (!strcmp(name, "CmdPipelineBarrier"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700544 return (void *)table->CmdPipelineBarrier;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600545 if (!strcmp(name, "CmdBeginQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700546 return (void *)table->CmdBeginQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600547 if (!strcmp(name, "CmdEndQuery"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700548 return (void *)table->CmdEndQuery;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600549 if (!strcmp(name, "CmdResetQueryPool"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700550 return (void *)table->CmdResetQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600551 if (!strcmp(name, "CmdWriteTimestamp"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700552 return (void *)table->CmdWriteTimestamp;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600553 if (!strcmp(name, "CmdCopyQueryPoolResults"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700554 return (void *)table->CmdCopyQueryPoolResults;
Jon Ashburn754864f2015-07-23 18:49:07 -0600555 if (!strcmp(name, "CmdPushConstants"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700556 return (void *)table->CmdPushConstants;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600557 if (!strcmp(name, "CmdBeginRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700558 return (void *)table->CmdBeginRenderPass;
Chia-I Wu08accc62015-07-07 11:50:03 +0800559 if (!strcmp(name, "CmdNextSubpass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700560 return (void *)table->CmdNextSubpass;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600561 if (!strcmp(name, "CmdEndRenderPass"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700562 return (void *)table->CmdEndRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600563 if (!strcmp(name, "CmdExecuteCommands"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700564 return (void *)table->CmdExecuteCommands;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600565
Mark Young16573c72016-06-28 10:52:43 -0600566 if (!strcmp(name, "DestroySwapchainKHR"))
567 return (void *)table->DestroySwapchainKHR;
568 if (!strcmp(name, "GetSwapchainImagesKHR"))
569 return (void *)table->GetSwapchainImagesKHR;
570 if (!strcmp(name, "AcquireNextImageKHR"))
571 return (void *)table->AcquireNextImageKHR;
572 if (!strcmp(name, "QueuePresentKHR"))
573 return (void *)table->QueuePresentKHR;
574
Mark Young65cb3662016-11-07 13:27:02 -0700575 // NOTE: Device Funcs needing Trampoline/Terminator.
576 // Overrides for device functions needing a trampoline and
577 // a terminator because certain device entry-points still need to go
578 // through a terminator before hitting the ICD. This could be for
579 // several reasons, but the main one is currently unwrapping an
580 // object before passing the appropriate info along to the ICD.
581 if (!strcmp(name, "CreateSwapchainKHR")) {
582 return (void *)vkCreateSwapchainKHR;
583 } else if (!strcmp(name, "DebugMarkerSetObjectTagEXT")) {
584 return (void *)vkDebugMarkerSetObjectTagEXT;
585 } else if (!strcmp(name, "DebugMarkerSetObjectNameEXT")) {
586 return (void *)vkDebugMarkerSetObjectNameEXT;
587 }
588
Jon Ashburnd55a3942015-05-06 09:02:10 -0600589 return NULL;
590}
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600591
Jon Ashburn23d36b12016-02-02 17:47:28 -0700592static inline void
593loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table,
594 PFN_vkGetInstanceProcAddr gpa,
595 VkInstance inst) {
596 table->GetInstanceProcAddr =
597 (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr");
598 table->DestroyInstance =
599 (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance");
600 table->EnumeratePhysicalDevices =
601 (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices");
602 table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa(
603 inst, "vkGetPhysicalDeviceFeatures");
604 table->GetPhysicalDeviceImageFormatProperties =
605 (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa(
606 inst, "vkGetPhysicalDeviceImageFormatProperties");
607 table->GetPhysicalDeviceFormatProperties =
608 (PFN_vkGetPhysicalDeviceFormatProperties)gpa(
609 inst, "vkGetPhysicalDeviceFormatProperties");
610 table->GetPhysicalDeviceSparseImageFormatProperties =
611 (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa(
612 inst, "vkGetPhysicalDeviceSparseImageFormatProperties");
613 table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa(
614 inst, "vkGetPhysicalDeviceProperties");
615 table->GetPhysicalDeviceQueueFamilyProperties =
616 (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa(
617 inst, "vkGetPhysicalDeviceQueueFamilyProperties");
618 table->GetPhysicalDeviceMemoryProperties =
619 (PFN_vkGetPhysicalDeviceMemoryProperties)gpa(
620 inst, "vkGetPhysicalDeviceMemoryProperties");
621 table->EnumerateDeviceExtensionProperties =
622 (PFN_vkEnumerateDeviceExtensionProperties)gpa(
623 inst, "vkEnumerateDeviceExtensionProperties");
624 table->EnumerateDeviceLayerProperties =
625 (PFN_vkEnumerateDeviceLayerProperties)gpa(
626 inst, "vkEnumerateDeviceLayerProperties");
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600627}
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600628
Courtney Goeltzenleuchterd971b612015-06-17 20:51:59 -0600629static inline void loader_init_instance_extension_dispatch_table(
Jon Ashburn23d36b12016-02-02 17:47:28 -0700630 VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
631 VkInstance inst) {
632 table->DestroySurfaceKHR =
633 (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR");
634 table->CreateDebugReportCallbackEXT =
635 (PFN_vkCreateDebugReportCallbackEXT)gpa(
636 inst, "vkCreateDebugReportCallbackEXT");
637 table->DestroyDebugReportCallbackEXT =
638 (PFN_vkDestroyDebugReportCallbackEXT)gpa(
639 inst, "vkDestroyDebugReportCallbackEXT");
640 table->DebugReportMessageEXT =
641 (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT");
642 table->GetPhysicalDeviceSurfaceSupportKHR =
643 (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa(
644 inst, "vkGetPhysicalDeviceSurfaceSupportKHR");
645 table->GetPhysicalDeviceSurfaceCapabilitiesKHR =
646 (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa(
647 inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
648 table->GetPhysicalDeviceSurfaceFormatsKHR =
649 (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa(
650 inst, "vkGetPhysicalDeviceSurfaceFormatsKHR");
651 table->GetPhysicalDeviceSurfacePresentModesKHR =
652 (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa(
653 inst, "vkGetPhysicalDeviceSurfacePresentModesKHR");
Mark Lobodzinski317574e2016-08-29 14:21:14 -0600654 table->GetPhysicalDeviceExternalImageFormatPropertiesNV =
655 (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)gpa(
656 inst, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700657#ifdef VK_USE_PLATFORM_MIR_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700658 table->CreateMirSurfaceKHR =
659 (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR");
660 table->GetPhysicalDeviceMirPresentationSupportKHR =
661 (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa(
662 inst, "vkGetPhysicalDeviceMirPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700663#endif
664#ifdef VK_USE_PLATFORM_WAYLAND_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700665 table->CreateWaylandSurfaceKHR =
666 (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR");
667 table->GetPhysicalDeviceWaylandPresentationSupportKHR =
668 (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa(
669 inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700670#endif
671#ifdef VK_USE_PLATFORM_WIN32_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700672 table->CreateWin32SurfaceKHR =
673 (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR");
674 table->GetPhysicalDeviceWin32PresentationSupportKHR =
675 (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa(
676 inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700677#endif
678#ifdef VK_USE_PLATFORM_XCB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700679 table->CreateXcbSurfaceKHR =
680 (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR");
681 table->GetPhysicalDeviceXcbPresentationSupportKHR =
682 (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa(
683 inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700684#endif
685#ifdef VK_USE_PLATFORM_XLIB_KHR
Jon Ashburn23d36b12016-02-02 17:47:28 -0700686 table->CreateXlibSurfaceKHR =
687 (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR");
688 table->GetPhysicalDeviceXlibPresentationSupportKHR =
689 (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa(
690 inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR");
Ian Elliottdb4300a2015-11-23 10:17:23 -0700691#endif
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700692 table->GetPhysicalDeviceDisplayPropertiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600693 (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)gpa(
694 inst, "vkGetPhysicalDeviceDisplayPropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700695 table->GetPhysicalDeviceDisplayPlanePropertiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600696 (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)gpa(
697 inst, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700698 table->GetDisplayPlaneSupportedDisplaysKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600699 (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)gpa(
700 inst, "vkGetDisplayPlaneSupportedDisplaysKHR");
701 table->GetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR)gpa(
702 inst, "vkGetDisplayModePropertiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700703 table->CreateDisplayModeKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600704 (PFN_vkCreateDisplayModeKHR)gpa(inst, "vkCreateDisplayModeKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700705 table->GetDisplayPlaneCapabilitiesKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600706 (PFN_vkGetDisplayPlaneCapabilitiesKHR)gpa(
707 inst, "vkGetDisplayPlaneCapabilitiesKHR");
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700708 table->CreateDisplayPlaneSurfaceKHR =
Jon Ashburncc407a22016-04-15 09:25:03 -0600709 (PFN_vkCreateDisplayPlaneSurfaceKHR)gpa(
710 inst, "vkCreateDisplayPlaneSurfaceKHR");
Mark Youngfa552782016-12-12 16:14:55 -0700711
712 // NVX_device_generated_commands (physical device commands)
713 table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX =
714 (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)gpa(
715 inst, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600716}
Jon Ashburn27cd5842015-05-12 17:26:48 -0600717
Jon Ashburn23d36b12016-02-02 17:47:28 -0700718static inline void *
719loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table,
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700720 const char *name, bool *found_name) {
721 if (!name || name[0] != 'v' || name[1] != 'k') {
722 *found_name = false;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600723 return NULL;
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700724 }
Jon Ashburn27cd5842015-05-12 17:26:48 -0600725
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700726 *found_name = true;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600727 name += 2;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600728 if (!strcmp(name, "DestroyInstance"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700729 return (void *)table->DestroyInstance;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600730 if (!strcmp(name, "EnumeratePhysicalDevices"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700731 return (void *)table->EnumeratePhysicalDevices;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200732 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700733 return (void *)table->GetPhysicalDeviceFeatures;
Jon Ashburn754864f2015-07-23 18:49:07 -0600734 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700735 return (void *)table->GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600736 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700737 return (void *)table->GetPhysicalDeviceFormatProperties;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600738 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700739 return (void *)table->GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600740 if (!strcmp(name, "GetPhysicalDeviceProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700741 return (void *)table->GetPhysicalDeviceProperties;
Cody Northropd0802882015-08-03 17:04:53 -0600742 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700743 return (void *)table->GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600744 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700745 return (void *)table->GetPhysicalDeviceMemoryProperties;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600746 if (!strcmp(name, "GetInstanceProcAddr"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700747 return (void *)table->GetInstanceProcAddr;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600748 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700749 return (void *)table->EnumerateDeviceExtensionProperties;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600750 if (!strcmp(name, "EnumerateDeviceLayerProperties"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700751 return (void *)table->EnumerateDeviceLayerProperties;
Ian Elliottfb42cd72015-11-25 14:43:02 -0700752 if (!strcmp(name, "DestroySurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700753 return (void *)table->DestroySurfaceKHR;
Ian Elliott7e40db92015-08-21 15:09:33 -0600754 if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700755 return (void *)table->GetPhysicalDeviceSurfaceSupportKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700756 if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700757 return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700758 if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700759 return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR;
Ian Elliott486c5502015-11-19 16:05:09 -0700760 if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700761 return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR;
Mark Lobodzinski317574e2016-08-29 14:21:14 -0600762 if (!strcmp(name, "GetPhysicalDeviceExternalImageFormatPropertiesNV"))
763 return (void *)table->GetPhysicalDeviceExternalImageFormatPropertiesNV;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700764#ifdef VK_USE_PLATFORM_MIR_KHR
765 if (!strcmp(name, "CreateMirSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700766 return (void *)table->CreateMirSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700767 if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700768 return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700769#endif
770#ifdef VK_USE_PLATFORM_WAYLAND_KHR
771 if (!strcmp(name, "CreateWaylandSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700772 return (void *)table->CreateWaylandSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700773 if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700774 return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700775#endif
776#ifdef VK_USE_PLATFORM_WIN32_KHR
777 if (!strcmp(name, "CreateWin32SurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700778 return (void *)table->CreateWin32SurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700779 if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700780 return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700781#endif
782#ifdef VK_USE_PLATFORM_XCB_KHR
783 if (!strcmp(name, "CreateXcbSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700784 return (void *)table->CreateXcbSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700785 if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700786 return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700787#endif
788#ifdef VK_USE_PLATFORM_XLIB_KHR
789 if (!strcmp(name, "CreateXlibSurfaceKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700790 return (void *)table->CreateXlibSurfaceKHR;
Ian Elliott919fa302015-11-24 15:39:10 -0700791 if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700792 return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700793#endif
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700794 if (!strcmp(name, "GetPhysicalDeviceDisplayPropertiesKHR"))
795 return (void *)table->GetPhysicalDeviceDisplayPropertiesKHR;
796 if (!strcmp(name, "GetPhysicalDeviceDisplayPlanePropertiesKHR"))
797 return (void *)table->GetPhysicalDeviceDisplayPlanePropertiesKHR;
798 if (!strcmp(name, "GetDisplayPlaneSupportedDisplaysKHR"))
799 return (void *)table->GetDisplayPlaneSupportedDisplaysKHR;
800 if (!strcmp(name, "GetDisplayModePropertiesKHR"))
801 return (void *)table->GetDisplayModePropertiesKHR;
802 if (!strcmp(name, "CreateDisplayModeKHR"))
803 return (void *)table->CreateDisplayModeKHR;
804 if (!strcmp(name, "GetDisplayPlaneCapabilitiesKHR"))
805 return (void *)table->GetDisplayPlaneCapabilitiesKHR;
806 if (!strcmp(name, "CreateDisplayPlaneSurfaceKHR"))
807 return (void *)table->CreateDisplayPlaneSurfaceKHR;
808
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700809 if (!strcmp(name, "CreateDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700810 return (void *)table->CreateDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700811 if (!strcmp(name, "DestroyDebugReportCallbackEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700812 return (void *)table->DestroyDebugReportCallbackEXT;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700813 if (!strcmp(name, "DebugReportMessageEXT"))
Jon Ashburn23d36b12016-02-02 17:47:28 -0700814 return (void *)table->DebugReportMessageEXT;
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600815
Mark Youngfa552782016-12-12 16:14:55 -0700816 // NVX_device_generated_commands
817 if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX"))
818 return (void *)table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX;
819
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700820 *found_name = false;
Jon Ashburn27cd5842015-05-12 17:26:48 -0600821 return NULL;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600822}