blob: fe6449a18d37f00f18cf0de391ace48f3a0469e4 [file] [log] [blame]
Jon Ashburnd55a3942015-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 Elliottd3ef02f2015-07-06 14:36:13 -060026#include "wsi_swapchain.h"
Jon Ashburnd55a3942015-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 Ashburn754864f2015-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 Barbour59a47322015-06-24 16:06:58 -060046 if (!strcmp(name, "GetPhysicalDeviceProperties"))
47 return (void*) vkGetPhysicalDeviceProperties;
Cody Northropd0802882015-08-03 17:04:53 -060048 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
49 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -060050 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
51 return (void*) vkGetPhysicalDeviceMemoryProperties;
Jon Ashburnb0fbe912015-05-06 10:15:07 -060052 if (!strcmp(name, "GetInstanceProcAddr"))
53 return (void*) vkGetInstanceProcAddr;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -060054 if (!strcmp(name, "GetDeviceProcAddr"))
55 return (void*) vkGetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -060056 if (!strcmp(name, "CreateDevice"))
57 return (void*) vkCreateDevice;
58 if (!strcmp(name, "DestroyDevice"))
59 return (void*) vkDestroyDevice;
Tony Barbour59a47322015-06-24 16:06:58 -060060 if (!strcmp(name, "GetGlobalExtensionProperties"))
61 return (void*) vkGetGlobalExtensionProperties;
Tony Barbour59a47322015-06-24 16:06:58 -060062 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
63 return (void*) vkGetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -060064 if (!strcmp(name, "GetGlobalLayerProperties"))
65 return (void*) vkGetGlobalLayerProperties;
66 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
67 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburnd55a3942015-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 Ashburnd55a3942015-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 Ashburn754864f2015-07-23 18:49:07 -060088 if (!strcmp(name, "GetDeviceMemoryCommitment"))
89 return (void *) vkGetDeviceMemoryCommitment;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060090 if (!strcmp(name, "BindBufferMemory"))
91 return (void*) vkBindBufferMemory;
Jon Ashburn754864f2015-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 Lobodzinski16e8bef2015-07-03 15:58:09 -060098 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
99 return (void*) vkGetImageSparseMemoryRequirements;
Jon Ashburn754864f2015-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 Ashburnd55a3942015-05-06 09:02:10 -0600108 if (!strcmp(name, "CreateFence"))
109 return (void*) vkCreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600110 if (!strcmp(name, "DestroyFence"))
111 return (void*) vkDestroyFence;
Jon Ashburnd55a3942015-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 Barbour1d2cd3f2015-07-03 10:33:54 -0600120 if (!strcmp(name, "DestroySemaphore"))
121 return (void*) vkDestroySemaphore;
Jon Ashburnd55a3942015-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 Barbour1d2cd3f2015-07-03 10:33:54 -0600128 if (!strcmp(name, "DestroyEvent"))
129 return (void*) vkDestroyEvent;
Jon Ashburnd55a3942015-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 Barbour1d2cd3f2015-07-03 10:33:54 -0600138 if (!strcmp(name, "DestroyQueryPool"))
139 return (void*) vkDestroyQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600140 if (!strcmp(name, "GetQueryPoolResults"))
141 return (void*) vkGetQueryPoolResults;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600142 if (!strcmp(name, "CreateBuffer"))
143 return (void*) vkCreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600144 if (!strcmp(name, "DestroyBuffer"))
145 return (void*) vkDestroyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600146 if (!strcmp(name, "CreateBufferView"))
147 return (void*) vkCreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600148 if (!strcmp(name, "DestroyBufferView"))
149 return (void*) vkDestroyBufferView;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600150 if (!strcmp(name, "CreateImage"))
151 return (void*) vkCreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600152 if (!strcmp(name, "DestroyImage"))
153 return (void*) vkDestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -0600154 if (!strcmp(name, "GetImageSubresourceLayout"))
155 return (void*) vkGetImageSubresourceLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600156 if (!strcmp(name, "CreateImageView"))
157 return (void*) vkCreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600158 if (!strcmp(name, "DestroyImageView"))
159 return (void*) vkDestroyImageView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600160 if (!strcmp(name, "CreateShaderModule"))
161 return (void*) vkCreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600162 if (!strcmp(name, "DestroyShaderModule"))
163 return (void*) vkDestroyShaderModule;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600164 if (!strcmp(name, "CreateShader"))
165 return (void*) vkCreateShader;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600166 if (!strcmp(name, "DestroyShader"))
167 return (void*) vkDestroyShader;
Jon Ashburnc669cc62015-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 Barbour1d2cd3f2015-07-03 10:33:54 -0600182 if (!strcmp(name, "DestroyPipeline"))
183 return (void*) vkDestroyPipeline;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600184 if (!strcmp(name, "CreatePipelineLayout"))
185 return (void*) vkCreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600186 if (!strcmp(name, "DestroyPipelineLayout"))
187 return (void*) vkDestroyPipelineLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600188 if (!strcmp(name, "CreateSampler"))
189 return (void*) vkCreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600190 if (!strcmp(name, "DestroySampler"))
191 return (void*) vkDestroySampler;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600192 if (!strcmp(name, "CreateDescriptorSetLayout"))
193 return (void*) vkCreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600194 if (!strcmp(name, "DestroyDescriptorSetLayout"))
195 return (void*) vkDestroyDescriptorSetLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600196 if (!strcmp(name, "CreateDescriptorPool"))
197 return (void*) vkCreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600198 if (!strcmp(name, "DestroyDescriptorPool"))
199 return (void*) vkDestroyDescriptorPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600200 if (!strcmp(name, "ResetDescriptorPool"))
201 return (void*) vkResetDescriptorPool;
202 if (!strcmp(name, "AllocDescriptorSets"))
203 return (void*) vkAllocDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600204 if (!strcmp(name, "FreeDescriptorSets"))
205 return (void*) vkFreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800206 if (!strcmp(name, "UpdateDescriptorSets"))
207 return (void*) vkUpdateDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600208 if (!strcmp(name, "CreateDynamicViewportState"))
209 return (void*) vkCreateDynamicViewportState;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600210 if (!strcmp(name, "DestroyDynamicViewportState"))
211 return (void*) vkDestroyDynamicViewportState;
Cody Northrop271ba752015-08-26 10:01:32 -0600212 if (!strcmp(name, "CreateDynamicLineWidthState"))
213 return (void*) vkCreateDynamicLineWidthState;
214 if (!strcmp(name, "DestroyDynamicLineWidthState"))
215 return (void*) vkDestroyDynamicLineWidthState;
216 if (!strcmp(name, "CreateDynamicDepthBiasState"))
217 return (void*) vkCreateDynamicDepthBiasState;
218 if (!strcmp(name, "DestroyDynamicDepthBiasState"))
219 return (void*) vkDestroyDynamicDepthBiasState;
220 if (!strcmp(name, "CreateDynamicBlendState"))
221 return (void*) vkCreateDynamicBlendState;
222 if (!strcmp(name, "DestroyDynamicBlendState"))
223 return (void*) vkDestroyDynamicBlendState;
224 if (!strcmp(name, "CreateDynamicDepthBoundsState"))
225 return (void*) vkCreateDynamicDepthBoundsState;
226 if (!strcmp(name, "DestroyDynamicDepthBoundsState"))
227 return (void*) vkDestroyDynamicDepthBoundsState;
Cody Northrop82485a82015-08-18 15:21:16 -0600228 if (!strcmp(name, "CreateDynamicStencilState"))
229 return (void*) vkCreateDynamicStencilState;
230 if (!strcmp(name, "DestroyDynamicStencilState"))
231 return (void*) vkDestroyDynamicStencilState;
Jon Ashburn754864f2015-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 Northrope62183e2015-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 Ashburnd55a3942015-05-06 09:02:10 -0600248 if (!strcmp(name, "CreateCommandBuffer"))
249 return (void*) vkCreateCommandBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600250 if (!strcmp(name, "DestroyCommandBuffer"))
251 return (void*) vkDestroyCommandBuffer;
Jon Ashburnd55a3942015-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 Barbour1d2cd3f2015-07-03 10:33:54 -0600260 if (!strcmp(name, "CmdBindDynamicViewportState"))
261 return (void*) vkCmdBindDynamicViewportState;
Cody Northrop271ba752015-08-26 10:01:32 -0600262 if (!strcmp(name, "CmdBindDynamicLineWidthState"))
263 return (void*) vkCmdBindDynamicLineWidthState;
264 if (!strcmp(name, "CmdBindDynamicDepthBiasState"))
265 return (void*) vkCmdBindDynamicDepthBiasState;
266 if (!strcmp(name, "CmdBindDynamicBlendState"))
267 return (void*) vkCmdBindDynamicBlendState;
268 if (!strcmp(name, "CmdBindDynamicDepthBoundsState"))
269 return (void*) vkCmdBindDynamicDepthBoundsState;
Cody Northrop82485a82015-08-18 15:21:16 -0600270 if (!strcmp(name, "CmdBindDynamicStencilState"))
271 return (void*) vkCmdBindDynamicStencilState;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600272 if (!strcmp(name, "CmdBindDescriptorSets"))
273 return (void*) vkCmdBindDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600274 if (!strcmp(name, "CmdBindIndexBuffer"))
275 return (void*) vkCmdBindIndexBuffer;
Jon Ashburn754864f2015-07-23 18:49:07 -0600276 if (!strcmp(name, "CmdBindVertexBuffers"))
277 return (void*) vkCmdBindVertexBuffers;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600278 if (!strcmp(name, "CmdDraw"))
279 return (void*) vkCmdDraw;
280 if (!strcmp(name, "CmdDrawIndexed"))
281 return (void*) vkCmdDrawIndexed;
282 if (!strcmp(name, "CmdDrawIndirect"))
283 return (void*) vkCmdDrawIndirect;
284 if (!strcmp(name, "CmdDrawIndexedIndirect"))
285 return (void*) vkCmdDrawIndexedIndirect;
286 if (!strcmp(name, "CmdDispatch"))
287 return (void*) vkCmdDispatch;
288 if (!strcmp(name, "CmdDispatchIndirect"))
289 return (void*) vkCmdDispatchIndirect;
290 if (!strcmp(name, "CmdCopyBuffer"))
291 return (void*) vkCmdCopyBuffer;
292 if (!strcmp(name, "CmdCopyImage"))
293 return (void*) vkCmdCopyImage;
294 if (!strcmp(name, "CmdBlitImage"))
295 return (void*) vkCmdBlitImage;
296 if (!strcmp(name, "CmdCopyBufferToImage"))
297 return (void*) vkCmdCopyBufferToImage;
298 if (!strcmp(name, "CmdCopyImageToBuffer"))
299 return (void*) vkCmdCopyImageToBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600300 if (!strcmp(name, "CmdUpdateBuffer"))
301 return (void*) vkCmdUpdateBuffer;
302 if (!strcmp(name, "CmdFillBuffer"))
303 return (void*) vkCmdFillBuffer;
304 if (!strcmp(name, "CmdClearColorImage"))
305 return (void*) vkCmdClearColorImage;
Chris Forbesd9be82b2015-06-22 17:21:59 +1200306 if (!strcmp(name, "CmdClearDepthStencilImage"))
307 return (void*) vkCmdClearDepthStencilImage;
308 if (!strcmp(name, "CmdClearColorAttachment"))
309 return (void*) vkCmdClearColorAttachment;
310 if (!strcmp(name, "CmdClearDepthStencilAttachment"))
311 return (void*) vkCmdClearDepthStencilAttachment;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600312 if (!strcmp(name, "CmdResolveImage"))
313 return (void*) vkCmdResolveImage;
314 if (!strcmp(name, "CmdSetEvent"))
315 return (void*) vkCmdSetEvent;
316 if (!strcmp(name, "CmdResetEvent"))
317 return (void*) vkCmdResetEvent;
318 if (!strcmp(name, "CmdWaitEvents"))
319 return (void*) vkCmdWaitEvents;
320 if (!strcmp(name, "CmdPipelineBarrier"))
321 return (void*) vkCmdPipelineBarrier;
322 if (!strcmp(name, "CmdBeginQuery"))
323 return (void*) vkCmdBeginQuery;
324 if (!strcmp(name, "CmdEndQuery"))
325 return (void*) vkCmdEndQuery;
326 if (!strcmp(name, "CmdResetQueryPool"))
327 return (void*) vkCmdResetQueryPool;
328 if (!strcmp(name, "CmdWriteTimestamp"))
329 return (void*) vkCmdWriteTimestamp;
330 if (!strcmp(name, "CmdCopyQueryPoolResults"))
331 return (void*) vkCmdCopyQueryPoolResults;
Jon Ashburn754864f2015-07-23 18:49:07 -0600332 if (!strcmp(name, "CmdPushConstants"))
333 return (void*) vkCmdPushConstants;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600334 if (!strcmp(name, "CmdBeginRenderPass"))
335 return (void*) vkCmdBeginRenderPass;
Chia-I Wu08accc62015-07-07 11:50:03 +0800336 if (!strcmp(name, "CmdNextSubpass"))
337 return (void*) vkCmdNextSubpass;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600338 if (!strcmp(name, "CmdEndRenderPass"))
339 return (void*) vkCmdEndRenderPass;
Jon Ashburn754864f2015-07-23 18:49:07 -0600340 if (!strcmp(name, "CmdExecuteCommands"))
341 return (void*) vkCmdExecuteCommands;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600342 return NULL;
343}
344
345/* These functions require special handling by the loader.
346* They are not just generic trampoline code entrypoints.
347* Thus GPA must return loader entrypoint for these instead of first function
348* in the chain. */
349static inline void *loader_non_passthrough_gpa(const char *name)
350{
351 if (!name || name[0] != 'v' || name[1] != 'k')
352 return NULL;
353
354 name += 2;
355 if (!strcmp(name, "CreateInstance"))
356 return (void*) vkCreateInstance;
357 if (!strcmp(name, "DestroyInstance"))
358 return (void*) vkDestroyInstance;
359 if (!strcmp(name, "EnumeratePhysicalDevices"))
360 return (void*) vkEnumeratePhysicalDevices;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200361 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
362 return (void*) vkGetPhysicalDeviceFeatures;
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600363 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
364 return (void*) vkGetPhysicalDeviceFormatProperties;
Jon Ashburn754864f2015-07-23 18:49:07 -0600365 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
366 return (void*) vkGetPhysicalDeviceImageFormatProperties;
Cody Northropd0802882015-08-03 17:04:53 -0600367 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
368 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600369 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
370 return (void*) vkGetPhysicalDeviceMemoryProperties;
371 if (!strcmp(name, "GetPhysicalDeviceProperties"))
372 return (void*) vkGetPhysicalDeviceProperties;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600373 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
374 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600375 if (!strcmp(name, "GetInstanceProcAddr"))
376 return (void*) vkGetInstanceProcAddr;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600377 if (!strcmp(name, "GetDeviceProcAddr"))
378 return (void*) vkGetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600379 if (!strcmp(name, "CreateDevice"))
380 return (void*) vkCreateDevice;
Tony Barbour59a47322015-06-24 16:06:58 -0600381 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
382 return (void*) vkGetPhysicalDeviceExtensionProperties;
Jon Ashburn754864f2015-07-23 18:49:07 -0600383 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
384 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600385 if (!strcmp(name, "GetDeviceQueue"))
386 return (void*) vkGetDeviceQueue;
387 if (!strcmp(name, "CreateCommandBuffer"))
388 return (void*) vkCreateCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600389
390 return NULL;
391}