blob: e462a1d7016040165e4eec3accbed7281871d7b9 [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;
46 if (!strcmp(name, "GetPhysicalDeviceLimits"))
47 return (void*) vkGetPhysicalDeviceLimits;
Tony Barbour426b9052015-06-24 16:06:58 -060048 if (!strcmp(name, "GetPhysicalDeviceProperties"))
49 return (void*) vkGetPhysicalDeviceProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060050 if (!strcmp(name, "GetPhysicalDeviceQueueCount"))
51 return (void*) vkGetPhysicalDeviceQueueCount;
52 if (!strcmp(name, "GetPhysicalDeviceQueueProperties"))
53 return (void*) vkGetPhysicalDeviceQueueProperties;
54 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
55 return (void*) vkGetPhysicalDeviceMemoryProperties;
Jon Ashburn53c16772015-05-06 10:15:07 -060056 if (!strcmp(name, "GetInstanceProcAddr"))
57 return (void*) vkGetInstanceProcAddr;
Jon Ashburn1245cec2015-05-18 13:20:15 -060058 if (!strcmp(name, "GetDeviceProcAddr"))
59 return (void*) vkGetDeviceProcAddr;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060060 if (!strcmp(name, "CreateDevice"))
61 return (void*) vkCreateDevice;
62 if (!strcmp(name, "DestroyDevice"))
63 return (void*) vkDestroyDevice;
Tony Barbour426b9052015-06-24 16:06:58 -060064 if (!strcmp(name, "GetGlobalExtensionProperties"))
65 return (void*) vkGetGlobalExtensionProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060066 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
67 return (void*) vkGetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -060068 if (!strcmp(name, "GetGlobalLayerProperties"))
69 return (void*) vkGetGlobalLayerProperties;
70 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
71 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060072 if (!strcmp(name, "GetDeviceQueue"))
73 return (void*) vkGetDeviceQueue;
74 if (!strcmp(name, "QueueSubmit"))
75 return (void*) vkQueueSubmit;
76 if (!strcmp(name, "QueueWaitIdle"))
77 return (void*) vkQueueWaitIdle;
78 if (!strcmp(name, "DeviceWaitIdle"))
79 return (void*) vkDeviceWaitIdle;
80 if (!strcmp(name, "AllocMemory"))
81 return (void*) vkAllocMemory;
82 if (!strcmp(name, "FreeMemory"))
83 return (void*) vkFreeMemory;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060084 if (!strcmp(name, "MapMemory"))
85 return (void*) vkMapMemory;
86 if (!strcmp(name, "UnmapMemory"))
87 return (void*) vkUnmapMemory;
88 if (!strcmp(name, "FlushMappedMemoryRanges"))
89 return (void*) vkFlushMappedMemoryRanges;
90 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
91 return (void*) vkInvalidateMappedMemoryRanges;
Jon Ashburn4e189562015-07-23 18:49:07 -060092 if (!strcmp(name, "GetDeviceMemoryCommitment"))
93 return (void *) vkGetDeviceMemoryCommitment;
Tony Barbourde4124d2015-07-03 10:33:54 -060094 if (!strcmp(name, "BindBufferMemory"))
95 return (void*) vkBindBufferMemory;
Jon Ashburn4e189562015-07-23 18:49:07 -060096 if (!strcmp(name, "BindImageMemory"))
97 return (void*) vkBindImageMemory;
98 if (!strcmp(name, "GetBufferMemoryRequirements"))
99 return (void*) vkGetBufferMemoryRequirements;
100 if (!strcmp(name, "GetImageMemoryRequirements"))
101 return (void*) vkGetImageMemoryRequirements;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600102 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
103 return (void*) vkGetImageSparseMemoryRequirements;
Jon Ashburn4e189562015-07-23 18:49:07 -0600104 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
105 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
106 if (!strcmp(name, "QueueBindSparseBufferMemory"))
107 return (void*) vkQueueBindSparseBufferMemory;
108 if (!strcmp(name, "QueueBindSparseImageOpaqueMemory"))
109 return (void*) vkQueueBindSparseImageOpaqueMemory;
110 if (!strcmp(name, "QueueBindSparseImageMemory"))
111 return (void*) vkQueueBindSparseImageMemory;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600112 if (!strcmp(name, "CreateFence"))
113 return (void*) vkCreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -0600114 if (!strcmp(name, "DestroyFence"))
115 return (void*) vkDestroyFence;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600116 if (!strcmp(name, "ResetFences"))
117 return (void*) vkResetFences;
118 if (!strcmp(name, "GetFenceStatus"))
119 return (void*) vkGetFenceStatus;
120 if (!strcmp(name, "WaitForFences"))
121 return (void*) vkWaitForFences;
122 if (!strcmp(name, "CreateSemaphore"))
123 return (void*) vkCreateSemaphore;
Tony Barbourde4124d2015-07-03 10:33:54 -0600124 if (!strcmp(name, "DestroySemaphore"))
125 return (void*) vkDestroySemaphore;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600126 if (!strcmp(name, "QueueSignalSemaphore"))
127 return (void*) vkQueueSignalSemaphore;
128 if (!strcmp(name, "QueueWaitSemaphore"))
129 return (void*) vkQueueWaitSemaphore;
130 if (!strcmp(name, "CreateEvent"))
131 return (void*) vkCreateEvent;
Tony Barbourde4124d2015-07-03 10:33:54 -0600132 if (!strcmp(name, "DestroyEvent"))
133 return (void*) vkDestroyEvent;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600134 if (!strcmp(name, "GetEventStatus"))
135 return (void*) vkGetEventStatus;
136 if (!strcmp(name, "SetEvent"))
137 return (void*) vkSetEvent;
138 if (!strcmp(name, "ResetEvent"))
139 return (void*) vkResetEvent;
140 if (!strcmp(name, "CreateQueryPool"))
141 return (void*) vkCreateQueryPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600142 if (!strcmp(name, "DestroyQueryPool"))
143 return (void*) vkDestroyQueryPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600144 if (!strcmp(name, "GetQueryPoolResults"))
145 return (void*) vkGetQueryPoolResults;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600146 if (!strcmp(name, "CreateBuffer"))
147 return (void*) vkCreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600148 if (!strcmp(name, "DestroyBuffer"))
149 return (void*) vkDestroyBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600150 if (!strcmp(name, "CreateBufferView"))
151 return (void*) vkCreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600152 if (!strcmp(name, "DestroyBufferView"))
153 return (void*) vkDestroyBufferView;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600154 if (!strcmp(name, "CreateImage"))
155 return (void*) vkCreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -0600156 if (!strcmp(name, "DestroyImage"))
157 return (void*) vkDestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -0600158 if (!strcmp(name, "GetImageSubresourceLayout"))
159 return (void*) vkGetImageSubresourceLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600160 if (!strcmp(name, "CreateImageView"))
161 return (void*) vkCreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600162 if (!strcmp(name, "DestroyImageView"))
163 return (void*) vkDestroyImageView;
Chia-I Wuc278df82015-07-07 11:50:03 +0800164 if (!strcmp(name, "CreateAttachmentView"))
165 return (void*) vkCreateAttachmentView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600166 if (!strcmp(name, "DestroyAttachmentView"))
167 return (void*) vkDestroyAttachmentView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600168 if (!strcmp(name, "CreateShaderModule"))
169 return (void*) vkCreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -0600170 if (!strcmp(name, "DestroyShaderModule"))
171 return (void*) vkDestroyShaderModule;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600172 if (!strcmp(name, "CreateShader"))
173 return (void*) vkCreateShader;
Tony Barbourde4124d2015-07-03 10:33:54 -0600174 if (!strcmp(name, "DestroyShader"))
175 return (void*) vkDestroyShader;
Jon Ashburn0d60d272015-07-09 15:02:25 -0600176 if (!strcmp(name, "CreatePipelineCache"))
177 return (void*) vkCreatePipelineCache;
178 if (!strcmp(name, "DestroyPipelineCache"))
179 return (void*) vkDestroyPipelineCache;
180 if (!strcmp(name, "GetPipelineCacheSize"))
181 return (void*) vkGetPipelineCacheSize;
182 if (!strcmp(name, "GetPipelineCacheData"))
183 return (void*) vkGetPipelineCacheData;
184 if (!strcmp(name, "MergePipelineCaches"))
185 return (void*) vkMergePipelineCaches;
186 if (!strcmp(name, "CreateGraphicsPipelines"))
187 return (void*) vkCreateGraphicsPipelines;
188 if (!strcmp(name, "CreateComputePipelines"))
189 return (void*) vkCreateComputePipelines;
Tony Barbourde4124d2015-07-03 10:33:54 -0600190 if (!strcmp(name, "DestroyPipeline"))
191 return (void*) vkDestroyPipeline;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600192 if (!strcmp(name, "CreatePipelineLayout"))
193 return (void*) vkCreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600194 if (!strcmp(name, "DestroyPipelineLayout"))
195 return (void*) vkDestroyPipelineLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600196 if (!strcmp(name, "CreateSampler"))
197 return (void*) vkCreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -0600198 if (!strcmp(name, "DestroySampler"))
199 return (void*) vkDestroySampler;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600200 if (!strcmp(name, "CreateDescriptorSetLayout"))
201 return (void*) vkCreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600202 if (!strcmp(name, "DestroyDescriptorSetLayout"))
203 return (void*) vkDestroyDescriptorSetLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600204 if (!strcmp(name, "CreateDescriptorPool"))
205 return (void*) vkCreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600206 if (!strcmp(name, "DestroyDescriptorPool"))
207 return (void*) vkDestroyDescriptorPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600208 if (!strcmp(name, "ResetDescriptorPool"))
209 return (void*) vkResetDescriptorPool;
210 if (!strcmp(name, "AllocDescriptorSets"))
211 return (void*) vkAllocDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -0600212 if (!strcmp(name, "FreeDescriptorSets"))
213 return (void*) vkFreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +0800214 if (!strcmp(name, "UpdateDescriptorSets"))
215 return (void*) vkUpdateDescriptorSets;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600216 if (!strcmp(name, "CreateDynamicViewportState"))
217 return (void*) vkCreateDynamicViewportState;
Tony Barbourde4124d2015-07-03 10:33:54 -0600218 if (!strcmp(name, "DestroyDynamicViewportState"))
219 return (void*) vkDestroyDynamicViewportState;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600220 if (!strcmp(name, "CreateDynamicRasterState"))
221 return (void*) vkCreateDynamicRasterState;
Tony Barbourde4124d2015-07-03 10:33:54 -0600222 if (!strcmp(name, "DestroyDynamicRasterState"))
223 return (void*) vkDestroyDynamicRasterState;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600224 if (!strcmp(name, "CreateDynamicColorBlendState"))
225 return (void*) vkCreateDynamicColorBlendState;
Tony Barbourde4124d2015-07-03 10:33:54 -0600226 if (!strcmp(name, "DestroyDynamicColorBlendState"))
227 return (void*) vkDestroyDynamicColorBlendState;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600228 if (!strcmp(name, "CreateDynamicDepthStencilState"))
229 return (void*) vkCreateDynamicDepthStencilState;
Tony Barbourde4124d2015-07-03 10:33:54 -0600230 if (!strcmp(name, "DestroyDynamicDepthStencilState"))
231 return (void*) vkDestroyDynamicDepthStencilState;
Jon Ashburn4e189562015-07-23 18:49:07 -0600232 if (!strcmp(name, "CreateFramebuffer"))
233 return (void*) vkCreateFramebuffer;
234 if (!strcmp(name, "DestroyFramebuffer"))
235 return (void*) vkDestroyFramebuffer;
236 if (!strcmp(name, "CreateRenderPass"))
237 return (void*) vkCreateRenderPass;
238 if (!strcmp(name, "DestroyRenderPass"))
239 return (void*) vkDestroyRenderPass;
240 if (!strcmp(name, "GetRenderAreaGranularity"))
241 return (void*) vkGetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -0600242 if (!strcmp(name, "CreateCommandPool"))
243 return (void*) vkCreateCommandPool;
244 if (!strcmp(name, "DestroyCommandPool"))
245 return (void*) vkDestroyCommandPool;
246 if (!strcmp(name, "ResetCommandPool"))
247 return (void*) vkResetCommandPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600248 if (!strcmp(name, "CreateCommandBuffer"))
249 return (void*) vkCreateCommandBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600250 if (!strcmp(name, "DestroyCommandBuffer"))
251 return (void*) vkDestroyCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600252 if (!strcmp(name, "BeginCommandBuffer"))
253 return (void*) vkBeginCommandBuffer;
254 if (!strcmp(name, "EndCommandBuffer"))
255 return (void*) vkEndCommandBuffer;
256 if (!strcmp(name, "ResetCommandBuffer"))
257 return (void*) vkResetCommandBuffer;
258 if (!strcmp(name, "CmdBindPipeline"))
259 return (void*) vkCmdBindPipeline;
Tony Barbourde4124d2015-07-03 10:33:54 -0600260 if (!strcmp(name, "CmdBindDynamicViewportState"))
261 return (void*) vkCmdBindDynamicViewportState;
262 if (!strcmp(name, "CmdBindDynamicRasterState"))
263 return (void*) vkCmdBindDynamicRasterState;
264 if (!strcmp(name, "CmdBindDynamicColorBlendState"))
265 return (void*) vkCmdBindDynamicColorBlendState;
266 if (!strcmp(name, "CmdBindDynamicDepthStencilState"))
267 return (void*) vkCmdBindDynamicDepthStencilState;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600268 if (!strcmp(name, "CmdBindDescriptorSets"))
269 return (void*) vkCmdBindDescriptorSets;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600270 if (!strcmp(name, "CmdBindIndexBuffer"))
271 return (void*) vkCmdBindIndexBuffer;
Jon Ashburn4e189562015-07-23 18:49:07 -0600272 if (!strcmp(name, "CmdBindVertexBuffers"))
273 return (void*) vkCmdBindVertexBuffers;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600274 if (!strcmp(name, "CmdDraw"))
275 return (void*) vkCmdDraw;
276 if (!strcmp(name, "CmdDrawIndexed"))
277 return (void*) vkCmdDrawIndexed;
278 if (!strcmp(name, "CmdDrawIndirect"))
279 return (void*) vkCmdDrawIndirect;
280 if (!strcmp(name, "CmdDrawIndexedIndirect"))
281 return (void*) vkCmdDrawIndexedIndirect;
282 if (!strcmp(name, "CmdDispatch"))
283 return (void*) vkCmdDispatch;
284 if (!strcmp(name, "CmdDispatchIndirect"))
285 return (void*) vkCmdDispatchIndirect;
286 if (!strcmp(name, "CmdCopyBuffer"))
287 return (void*) vkCmdCopyBuffer;
288 if (!strcmp(name, "CmdCopyImage"))
289 return (void*) vkCmdCopyImage;
290 if (!strcmp(name, "CmdBlitImage"))
291 return (void*) vkCmdBlitImage;
292 if (!strcmp(name, "CmdCopyBufferToImage"))
293 return (void*) vkCmdCopyBufferToImage;
294 if (!strcmp(name, "CmdCopyImageToBuffer"))
295 return (void*) vkCmdCopyImageToBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600296 if (!strcmp(name, "CmdUpdateBuffer"))
297 return (void*) vkCmdUpdateBuffer;
298 if (!strcmp(name, "CmdFillBuffer"))
299 return (void*) vkCmdFillBuffer;
300 if (!strcmp(name, "CmdClearColorImage"))
301 return (void*) vkCmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200302 if (!strcmp(name, "CmdClearDepthStencilImage"))
303 return (void*) vkCmdClearDepthStencilImage;
304 if (!strcmp(name, "CmdClearColorAttachment"))
305 return (void*) vkCmdClearColorAttachment;
306 if (!strcmp(name, "CmdClearDepthStencilAttachment"))
307 return (void*) vkCmdClearDepthStencilAttachment;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600308 if (!strcmp(name, "CmdResolveImage"))
309 return (void*) vkCmdResolveImage;
310 if (!strcmp(name, "CmdSetEvent"))
311 return (void*) vkCmdSetEvent;
312 if (!strcmp(name, "CmdResetEvent"))
313 return (void*) vkCmdResetEvent;
314 if (!strcmp(name, "CmdWaitEvents"))
315 return (void*) vkCmdWaitEvents;
316 if (!strcmp(name, "CmdPipelineBarrier"))
317 return (void*) vkCmdPipelineBarrier;
318 if (!strcmp(name, "CmdBeginQuery"))
319 return (void*) vkCmdBeginQuery;
320 if (!strcmp(name, "CmdEndQuery"))
321 return (void*) vkCmdEndQuery;
322 if (!strcmp(name, "CmdResetQueryPool"))
323 return (void*) vkCmdResetQueryPool;
324 if (!strcmp(name, "CmdWriteTimestamp"))
325 return (void*) vkCmdWriteTimestamp;
326 if (!strcmp(name, "CmdCopyQueryPoolResults"))
327 return (void*) vkCmdCopyQueryPoolResults;
Jon Ashburn4e189562015-07-23 18:49:07 -0600328 if (!strcmp(name, "CmdPushConstants"))
329 return (void*) vkCmdPushConstants;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600330 if (!strcmp(name, "CmdBeginRenderPass"))
331 return (void*) vkCmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800332 if (!strcmp(name, "CmdNextSubpass"))
333 return (void*) vkCmdNextSubpass;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600334 if (!strcmp(name, "CmdEndRenderPass"))
335 return (void*) vkCmdEndRenderPass;
Jon Ashburn4e189562015-07-23 18:49:07 -0600336 if (!strcmp(name, "CmdExecuteCommands"))
337 return (void*) vkCmdExecuteCommands;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600338 return NULL;
339}
340
341/* These functions require special handling by the loader.
342* They are not just generic trampoline code entrypoints.
343* Thus GPA must return loader entrypoint for these instead of first function
344* in the chain. */
345static inline void *loader_non_passthrough_gpa(const char *name)
346{
347 if (!name || name[0] != 'v' || name[1] != 'k')
348 return NULL;
349
350 name += 2;
351 if (!strcmp(name, "CreateInstance"))
352 return (void*) vkCreateInstance;
353 if (!strcmp(name, "DestroyInstance"))
354 return (void*) vkDestroyInstance;
355 if (!strcmp(name, "EnumeratePhysicalDevices"))
356 return (void*) vkEnumeratePhysicalDevices;
Chris Forbesd7576302015-06-21 22:55:02 +1200357 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
358 return (void*) vkGetPhysicalDeviceFeatures;
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -0600359 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
360 return (void*) vkGetPhysicalDeviceFormatProperties;
Jon Ashburn4e189562015-07-23 18:49:07 -0600361 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
362 return (void*) vkGetPhysicalDeviceImageFormatProperties;
Chris Forbesd7576302015-06-21 22:55:02 +1200363 if (!strcmp(name, "GetPhysicalDeviceLimits"))
364 return (void*) vkGetPhysicalDeviceLimits;
Tony Barbour426b9052015-06-24 16:06:58 -0600365 if (!strcmp(name, "GetPhysicalDeviceQueueCount"))
366 return (void*) vkGetPhysicalDeviceQueueCount;
367 if (!strcmp(name, "GetPhysicalDeviceQueueProperties"))
368 return (void*) vkGetPhysicalDeviceQueueProperties;
369 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
370 return (void*) vkGetPhysicalDeviceMemoryProperties;
371 if (!strcmp(name, "GetPhysicalDeviceProperties"))
372 return (void*) vkGetPhysicalDeviceProperties;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600373 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
374 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
Jon Ashburn53c16772015-05-06 10:15:07 -0600375 if (!strcmp(name, "GetInstanceProcAddr"))
376 return (void*) vkGetInstanceProcAddr;
Jon Ashburn1245cec2015-05-18 13:20:15 -0600377 if (!strcmp(name, "GetDeviceProcAddr"))
378 return (void*) vkGetDeviceProcAddr;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600379 if (!strcmp(name, "CreateDevice"))
380 return (void*) vkCreateDevice;
Tony Barbour426b9052015-06-24 16:06:58 -0600381 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
382 return (void*) vkGetPhysicalDeviceExtensionProperties;
Jon Ashburn4e189562015-07-23 18:49:07 -0600383 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
384 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600385 if (!strcmp(name, "GetDeviceQueue"))
386 return (void*) vkGetDeviceQueue;
387 if (!strcmp(name, "CreateCommandBuffer"))
388 return (void*) vkCreateCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600389
390 return NULL;
391}