blob: f33ac67a248fb9b7aefa0d7fde6b1216f8114d77 [file] [log] [blame]
Jon Ashburn2139a3e2015-05-06 09:02:10 -06001/*
2 * Vulkan
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include <string.h>
Ian Elliott1d73e662015-07-06 14:36:13 -060026#include "wsi_swapchain.h"
Jon Ashburn2139a3e2015-05-06 09:02:10 -060027
28static inline void* globalGetProcAddr(const char *name)
29{
30 if (!name || name[0] != 'v' || name[1] != 'k')
31 return NULL;
32
33 name += 2;
34 if (!strcmp(name, "CreateInstance"))
35 return (void*) vkCreateInstance;
36 if (!strcmp(name, "DestroyInstance"))
37 return (void*) vkDestroyInstance;
38 if (!strcmp(name, "EnumeratePhysicalDevices"))
39 return (void*) vkEnumeratePhysicalDevices;
Jon Ashburn4e189562015-07-23 18:49:07 -060040 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
41 return (void*) vkGetPhysicalDeviceFeatures;
42 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
43 return (void*) vkGetPhysicalDeviceFormatProperties;
44 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
45 return (void*) vkGetPhysicalDeviceImageFormatProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060046 if (!strcmp(name, "GetPhysicalDeviceProperties"))
47 return (void*) vkGetPhysicalDeviceProperties;
Cody Northropef72e2a2015-08-03 17:04:53 -060048 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
49 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060050 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
51 return (void*) vkGetPhysicalDeviceMemoryProperties;
Jon Ashburn53c16772015-05-06 10:15:07 -060052 if (!strcmp(name, "GetInstanceProcAddr"))
53 return (void*) vkGetInstanceProcAddr;
Jon Ashburn1245cec2015-05-18 13:20:15 -060054 if (!strcmp(name, "GetDeviceProcAddr"))
55 return (void*) vkGetDeviceProcAddr;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060056 if (!strcmp(name, "CreateDevice"))
57 return (void*) vkCreateDevice;
58 if (!strcmp(name, "DestroyDevice"))
59 return (void*) vkDestroyDevice;
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -060060 if (!strcmp(name, "EnumerateInstanceExtensionProperties"))
61 return (void*) vkEnumerateInstanceExtensionProperties;
62 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
63 return (void*) vkEnumerateDeviceExtensionProperties;
64 if (!strcmp(name, "EnumerateInstanceLayerProperties"))
65 return (void*) vkEnumerateInstanceLayerProperties;
66 if (!strcmp(name, "EnumerateDeviceLayerProperties"))
67 return (void*) vkEnumerateDeviceLayerProperties;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060068 if (!strcmp(name, "GetDeviceQueue"))
69 return (void*) vkGetDeviceQueue;
70 if (!strcmp(name, "QueueSubmit"))
71 return (void*) vkQueueSubmit;
72 if (!strcmp(name, "QueueWaitIdle"))
73 return (void*) vkQueueWaitIdle;
74 if (!strcmp(name, "DeviceWaitIdle"))
75 return (void*) vkDeviceWaitIdle;
76 if (!strcmp(name, "AllocMemory"))
77 return (void*) vkAllocMemory;
78 if (!strcmp(name, "FreeMemory"))
79 return (void*) vkFreeMemory;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060080 if (!strcmp(name, "MapMemory"))
81 return (void*) vkMapMemory;
82 if (!strcmp(name, "UnmapMemory"))
83 return (void*) vkUnmapMemory;
84 if (!strcmp(name, "FlushMappedMemoryRanges"))
85 return (void*) vkFlushMappedMemoryRanges;
86 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
87 return (void*) vkInvalidateMappedMemoryRanges;
Jon Ashburn4e189562015-07-23 18:49:07 -060088 if (!strcmp(name, "GetDeviceMemoryCommitment"))
89 return (void *) vkGetDeviceMemoryCommitment;
Tony Barbourde4124d2015-07-03 10:33:54 -060090 if (!strcmp(name, "BindBufferMemory"))
91 return (void*) vkBindBufferMemory;
Jon Ashburn4e189562015-07-23 18:49:07 -060092 if (!strcmp(name, "BindImageMemory"))
93 return (void*) vkBindImageMemory;
94 if (!strcmp(name, "GetBufferMemoryRequirements"))
95 return (void*) vkGetBufferMemoryRequirements;
96 if (!strcmp(name, "GetImageMemoryRequirements"))
97 return (void*) vkGetImageMemoryRequirements;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -060098 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
99 return (void*) vkGetImageSparseMemoryRequirements;
Jon Ashburn4e189562015-07-23 18:49:07 -0600100 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
101 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
102 if (!strcmp(name, "QueueBindSparseBufferMemory"))
103 return (void*) vkQueueBindSparseBufferMemory;
104 if (!strcmp(name, "QueueBindSparseImageOpaqueMemory"))
105 return (void*) vkQueueBindSparseImageOpaqueMemory;
106 if (!strcmp(name, "QueueBindSparseImageMemory"))
107 return (void*) vkQueueBindSparseImageMemory;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600108 if (!strcmp(name, "CreateFence"))
109 return (void*) vkCreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -0600110 if (!strcmp(name, "DestroyFence"))
111 return (void*) vkDestroyFence;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600112 if (!strcmp(name, "ResetFences"))
113 return (void*) vkResetFences;
114 if (!strcmp(name, "GetFenceStatus"))
115 return (void*) vkGetFenceStatus;
116 if (!strcmp(name, "WaitForFences"))
117 return (void*) vkWaitForFences;
118 if (!strcmp(name, "CreateSemaphore"))
119 return (void*) vkCreateSemaphore;
Tony Barbourde4124d2015-07-03 10:33:54 -0600120 if (!strcmp(name, "DestroySemaphore"))
121 return (void*) vkDestroySemaphore;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600122 if (!strcmp(name, "QueueSignalSemaphore"))
123 return (void*) vkQueueSignalSemaphore;
124 if (!strcmp(name, "QueueWaitSemaphore"))
125 return (void*) vkQueueWaitSemaphore;
126 if (!strcmp(name, "CreateEvent"))
127 return (void*) vkCreateEvent;
Tony Barbourde4124d2015-07-03 10:33:54 -0600128 if (!strcmp(name, "DestroyEvent"))
129 return (void*) vkDestroyEvent;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600130 if (!strcmp(name, "GetEventStatus"))
131 return (void*) vkGetEventStatus;
132 if (!strcmp(name, "SetEvent"))
133 return (void*) vkSetEvent;
134 if (!strcmp(name, "ResetEvent"))
135 return (void*) vkResetEvent;
136 if (!strcmp(name, "CreateQueryPool"))
137 return (void*) vkCreateQueryPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600138 if (!strcmp(name, "DestroyQueryPool"))
139 return (void*) vkDestroyQueryPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600140 if (!strcmp(name, "GetQueryPoolResults"))
141 return (void*) vkGetQueryPoolResults;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600142 if (!strcmp(name, "CreateBuffer"))
143 return (void*) vkCreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600144 if (!strcmp(name, "DestroyBuffer"))
145 return (void*) vkDestroyBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600146 if (!strcmp(name, "CreateBufferView"))
147 return (void*) vkCreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600148 if (!strcmp(name, "DestroyBufferView"))
149 return (void*) vkDestroyBufferView;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600150 if (!strcmp(name, "CreateImage"))
151 return (void*) vkCreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -0600152 if (!strcmp(name, "DestroyImage"))
153 return (void*) vkDestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -0600154 if (!strcmp(name, "GetImageSubresourceLayout"))
155 return (void*) vkGetImageSubresourceLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600156 if (!strcmp(name, "CreateImageView"))
157 return (void*) vkCreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600158 if (!strcmp(name, "DestroyImageView"))
159 return (void*) vkDestroyImageView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600160 if (!strcmp(name, "CreateShaderModule"))
161 return (void*) vkCreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -0600162 if (!strcmp(name, "DestroyShaderModule"))
163 return (void*) vkDestroyShaderModule;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600164 if (!strcmp(name, "CreateShader"))
165 return (void*) vkCreateShader;
Tony Barbourde4124d2015-07-03 10:33:54 -0600166 if (!strcmp(name, "DestroyShader"))
167 return (void*) vkDestroyShader;
Jon Ashburn0d60d272015-07-09 15:02:25 -0600168 if (!strcmp(name, "CreatePipelineCache"))
169 return (void*) vkCreatePipelineCache;
170 if (!strcmp(name, "DestroyPipelineCache"))
171 return (void*) vkDestroyPipelineCache;
172 if (!strcmp(name, "GetPipelineCacheSize"))
173 return (void*) vkGetPipelineCacheSize;
174 if (!strcmp(name, "GetPipelineCacheData"))
175 return (void*) vkGetPipelineCacheData;
176 if (!strcmp(name, "MergePipelineCaches"))
177 return (void*) vkMergePipelineCaches;
178 if (!strcmp(name, "CreateGraphicsPipelines"))
179 return (void*) vkCreateGraphicsPipelines;
180 if (!strcmp(name, "CreateComputePipelines"))
181 return (void*) vkCreateComputePipelines;
Tony Barbourde4124d2015-07-03 10:33:54 -0600182 if (!strcmp(name, "DestroyPipeline"))
183 return (void*) vkDestroyPipeline;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600184 if (!strcmp(name, "CreatePipelineLayout"))
185 return (void*) vkCreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600186 if (!strcmp(name, "DestroyPipelineLayout"))
187 return (void*) vkDestroyPipelineLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600188 if (!strcmp(name, "CreateSampler"))
189 return (void*) vkCreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -0600190 if (!strcmp(name, "DestroySampler"))
191 return (void*) vkDestroySampler;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600192 if (!strcmp(name, "CreateDescriptorSetLayout"))
193 return (void*) vkCreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600194 if (!strcmp(name, "DestroyDescriptorSetLayout"))
195 return (void*) vkDestroyDescriptorSetLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600196 if (!strcmp(name, "CreateDescriptorPool"))
197 return (void*) vkCreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600198 if (!strcmp(name, "DestroyDescriptorPool"))
199 return (void*) vkDestroyDescriptorPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600200 if (!strcmp(name, "ResetDescriptorPool"))
201 return (void*) vkResetDescriptorPool;
202 if (!strcmp(name, "AllocDescriptorSets"))
203 return (void*) vkAllocDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -0600204 if (!strcmp(name, "FreeDescriptorSets"))
205 return (void*) vkFreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +0800206 if (!strcmp(name, "UpdateDescriptorSets"))
207 return (void*) vkUpdateDescriptorSets;
Jon Ashburn4e189562015-07-23 18:49:07 -0600208 if (!strcmp(name, "CreateFramebuffer"))
209 return (void*) vkCreateFramebuffer;
210 if (!strcmp(name, "DestroyFramebuffer"))
211 return (void*) vkDestroyFramebuffer;
212 if (!strcmp(name, "CreateRenderPass"))
213 return (void*) vkCreateRenderPass;
214 if (!strcmp(name, "DestroyRenderPass"))
215 return (void*) vkDestroyRenderPass;
216 if (!strcmp(name, "GetRenderAreaGranularity"))
217 return (void*) vkGetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -0600218 if (!strcmp(name, "CreateCommandPool"))
219 return (void*) vkCreateCommandPool;
220 if (!strcmp(name, "DestroyCommandPool"))
221 return (void*) vkDestroyCommandPool;
222 if (!strcmp(name, "ResetCommandPool"))
223 return (void*) vkResetCommandPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600224 if (!strcmp(name, "CreateCommandBuffer"))
225 return (void*) vkCreateCommandBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600226 if (!strcmp(name, "DestroyCommandBuffer"))
227 return (void*) vkDestroyCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600228 if (!strcmp(name, "BeginCommandBuffer"))
229 return (void*) vkBeginCommandBuffer;
230 if (!strcmp(name, "EndCommandBuffer"))
231 return (void*) vkEndCommandBuffer;
232 if (!strcmp(name, "ResetCommandBuffer"))
233 return (void*) vkResetCommandBuffer;
234 if (!strcmp(name, "CmdBindPipeline"))
235 return (void*) vkCmdBindPipeline;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600236 if (!strcmp(name, "CmdSetViewport"))
237 return (void*) vkCmdSetViewport;
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -0600238 if (!strcmp(name, "CmdSetScissor"))
239 return (void*) vkCmdSetScissor;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600240 if (!strcmp(name, "CmdSetLineWidth"))
241 return (void*) vkCmdSetLineWidth;
242 if (!strcmp(name, "CmdSetDepthBias"))
243 return (void*) vkCmdSetDepthBias;
244 if (!strcmp(name, "CmdSetBlendConstants"))
245 return (void*) vkCmdSetBlendConstants;
246 if (!strcmp(name, "CmdSetDepthBounds"))
247 return (void*) vkCmdSetDepthBounds;
248 if (!strcmp(name, "CmdSetStencilCompareMask"))
249 return (void*) vkCmdSetStencilCompareMask;
250 if (!strcmp(name, "CmdSetStencilWriteMask"))
251 return (void*) vkCmdSetStencilWriteMask;
252 if (!strcmp(name, "CmdSetStencilReference"))
253 return (void*) vkCmdSetStencilReference;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600254 if (!strcmp(name, "CmdBindIndexBuffer"))
255 return (void*) vkCmdBindIndexBuffer;
Jon Ashburn4e189562015-07-23 18:49:07 -0600256 if (!strcmp(name, "CmdBindVertexBuffers"))
257 return (void*) vkCmdBindVertexBuffers;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600258 if (!strcmp(name, "CmdDraw"))
259 return (void*) vkCmdDraw;
260 if (!strcmp(name, "CmdDrawIndexed"))
261 return (void*) vkCmdDrawIndexed;
262 if (!strcmp(name, "CmdDrawIndirect"))
263 return (void*) vkCmdDrawIndirect;
264 if (!strcmp(name, "CmdDrawIndexedIndirect"))
265 return (void*) vkCmdDrawIndexedIndirect;
266 if (!strcmp(name, "CmdDispatch"))
267 return (void*) vkCmdDispatch;
268 if (!strcmp(name, "CmdDispatchIndirect"))
269 return (void*) vkCmdDispatchIndirect;
270 if (!strcmp(name, "CmdCopyBuffer"))
271 return (void*) vkCmdCopyBuffer;
272 if (!strcmp(name, "CmdCopyImage"))
273 return (void*) vkCmdCopyImage;
274 if (!strcmp(name, "CmdBlitImage"))
275 return (void*) vkCmdBlitImage;
276 if (!strcmp(name, "CmdCopyBufferToImage"))
277 return (void*) vkCmdCopyBufferToImage;
278 if (!strcmp(name, "CmdCopyImageToBuffer"))
279 return (void*) vkCmdCopyImageToBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600280 if (!strcmp(name, "CmdUpdateBuffer"))
281 return (void*) vkCmdUpdateBuffer;
282 if (!strcmp(name, "CmdFillBuffer"))
283 return (void*) vkCmdFillBuffer;
284 if (!strcmp(name, "CmdClearColorImage"))
285 return (void*) vkCmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200286 if (!strcmp(name, "CmdClearDepthStencilImage"))
287 return (void*) vkCmdClearDepthStencilImage;
288 if (!strcmp(name, "CmdClearColorAttachment"))
289 return (void*) vkCmdClearColorAttachment;
290 if (!strcmp(name, "CmdClearDepthStencilAttachment"))
291 return (void*) vkCmdClearDepthStencilAttachment;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600292 if (!strcmp(name, "CmdResolveImage"))
293 return (void*) vkCmdResolveImage;
294 if (!strcmp(name, "CmdSetEvent"))
295 return (void*) vkCmdSetEvent;
296 if (!strcmp(name, "CmdResetEvent"))
297 return (void*) vkCmdResetEvent;
298 if (!strcmp(name, "CmdWaitEvents"))
299 return (void*) vkCmdWaitEvents;
300 if (!strcmp(name, "CmdPipelineBarrier"))
301 return (void*) vkCmdPipelineBarrier;
302 if (!strcmp(name, "CmdBeginQuery"))
303 return (void*) vkCmdBeginQuery;
304 if (!strcmp(name, "CmdEndQuery"))
305 return (void*) vkCmdEndQuery;
306 if (!strcmp(name, "CmdResetQueryPool"))
307 return (void*) vkCmdResetQueryPool;
308 if (!strcmp(name, "CmdWriteTimestamp"))
309 return (void*) vkCmdWriteTimestamp;
310 if (!strcmp(name, "CmdCopyQueryPoolResults"))
311 return (void*) vkCmdCopyQueryPoolResults;
Jon Ashburn4e189562015-07-23 18:49:07 -0600312 if (!strcmp(name, "CmdPushConstants"))
313 return (void*) vkCmdPushConstants;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600314 if (!strcmp(name, "CmdBeginRenderPass"))
315 return (void*) vkCmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800316 if (!strcmp(name, "CmdNextSubpass"))
317 return (void*) vkCmdNextSubpass;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600318 if (!strcmp(name, "CmdEndRenderPass"))
319 return (void*) vkCmdEndRenderPass;
Jon Ashburn4e189562015-07-23 18:49:07 -0600320 if (!strcmp(name, "CmdExecuteCommands"))
321 return (void*) vkCmdExecuteCommands;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600322 return NULL;
323}
324
325/* These functions require special handling by the loader.
326* They are not just generic trampoline code entrypoints.
327* Thus GPA must return loader entrypoint for these instead of first function
328* in the chain. */
Jon Ashburn8aa75cb2015-09-28 16:15:00 -0600329static inline void *loader_non_passthrough_gipa(const char *name)
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600330{
331 if (!name || name[0] != 'v' || name[1] != 'k')
332 return NULL;
333
334 name += 2;
335 if (!strcmp(name, "CreateInstance"))
336 return (void*) vkCreateInstance;
337 if (!strcmp(name, "DestroyInstance"))
338 return (void*) vkDestroyInstance;
Jon Ashburn230556b2015-10-08 15:59:17 -0600339 if (!strcmp(name, "GetDeviceProcAddr"))
340 return (void*) vkGetDeviceProcAddr;
Jon Ashburn8aa75cb2015-09-28 16:15:00 -0600341 // remove once no longer locks
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600342 if (!strcmp(name, "EnumeratePhysicalDevices"))
343 return (void*) vkEnumeratePhysicalDevices;
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -0600344 if (!strcmp(name, "EnumerateDeviceExtensionProperties"))
345 return (void*) vkEnumerateDeviceExtensionProperties;
346 if (!strcmp(name, "EnumerateDeviceLayerProperties"))
347 return (void*) vkEnumerateDeviceLayerProperties;
Jon Ashburn8aa75cb2015-09-28 16:15:00 -0600348 if (!strcmp(name, "GetInstanceProcAddr"))
349 return (void*) vkGetInstanceProcAddr;
Jon Ashburna1eef1a2015-10-05 14:09:37 -0600350 if (!strcmp(name, "CreateDevice"))
351 return (void*) vkCreateDevice;
Jon Ashburn8aa75cb2015-09-28 16:15:00 -0600352
353 return NULL;
354}
355
356static inline void *loader_non_passthrough_gdpa(const char *name)
357{
358 if (!name || name[0] != 'v' || name[1] != 'k')
359 return NULL;
360
361 name += 2;
362
363 if (!strcmp(name, "GetDeviceProcAddr"))
364 return (void*) vkGetDeviceProcAddr;
365 if (!strcmp(name, "CreateDevice"))
366 return (void*) vkCreateDevice;
367 if (!strcmp(name, "DestroyDevice"))
368 return (void*) vkDestroyDevice;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600369 if (!strcmp(name, "GetDeviceQueue"))
370 return (void*) vkGetDeviceQueue;
371 if (!strcmp(name, "CreateCommandBuffer"))
372 return (void*) vkCreateCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600373
374 return NULL;
375}