blob: bb79f03533773c35d2e21efe5f691fe13e931c7b [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;
46 if (!strcmp(name, "GetPhysicalDeviceLimits"))
47 return (void*) vkGetPhysicalDeviceLimits;
Tony Barbour59a47322015-06-24 16:06:58 -060048 if (!strcmp(name, "GetPhysicalDeviceProperties"))
49 return (void*) vkGetPhysicalDeviceProperties;
Cody Northropd0802882015-08-03 17:04:53 -060050 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
51 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -060052 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
53 return (void*) vkGetPhysicalDeviceMemoryProperties;
Jon Ashburnb0fbe912015-05-06 10:15:07 -060054 if (!strcmp(name, "GetInstanceProcAddr"))
55 return (void*) vkGetInstanceProcAddr;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -060056 if (!strcmp(name, "GetDeviceProcAddr"))
57 return (void*) vkGetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -060058 if (!strcmp(name, "CreateDevice"))
59 return (void*) vkCreateDevice;
60 if (!strcmp(name, "DestroyDevice"))
61 return (void*) vkDestroyDevice;
Tony Barbour59a47322015-06-24 16:06:58 -060062 if (!strcmp(name, "GetGlobalExtensionProperties"))
63 return (void*) vkGetGlobalExtensionProperties;
Tony Barbour59a47322015-06-24 16:06:58 -060064 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
65 return (void*) vkGetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter110fdf92015-06-29 15:39:26 -060066 if (!strcmp(name, "GetGlobalLayerProperties"))
67 return (void*) vkGetGlobalLayerProperties;
68 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
69 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburnd55a3942015-05-06 09:02:10 -060070 if (!strcmp(name, "GetDeviceQueue"))
71 return (void*) vkGetDeviceQueue;
72 if (!strcmp(name, "QueueSubmit"))
73 return (void*) vkQueueSubmit;
74 if (!strcmp(name, "QueueWaitIdle"))
75 return (void*) vkQueueWaitIdle;
76 if (!strcmp(name, "DeviceWaitIdle"))
77 return (void*) vkDeviceWaitIdle;
78 if (!strcmp(name, "AllocMemory"))
79 return (void*) vkAllocMemory;
80 if (!strcmp(name, "FreeMemory"))
81 return (void*) vkFreeMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -060082 if (!strcmp(name, "MapMemory"))
83 return (void*) vkMapMemory;
84 if (!strcmp(name, "UnmapMemory"))
85 return (void*) vkUnmapMemory;
86 if (!strcmp(name, "FlushMappedMemoryRanges"))
87 return (void*) vkFlushMappedMemoryRanges;
88 if (!strcmp(name, "InvalidateMappedMemoryRanges"))
89 return (void*) vkInvalidateMappedMemoryRanges;
Jon Ashburn754864f2015-07-23 18:49:07 -060090 if (!strcmp(name, "GetDeviceMemoryCommitment"))
91 return (void *) vkGetDeviceMemoryCommitment;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060092 if (!strcmp(name, "BindBufferMemory"))
93 return (void*) vkBindBufferMemory;
Jon Ashburn754864f2015-07-23 18:49:07 -060094 if (!strcmp(name, "BindImageMemory"))
95 return (void*) vkBindImageMemory;
96 if (!strcmp(name, "GetBufferMemoryRequirements"))
97 return (void*) vkGetBufferMemoryRequirements;
98 if (!strcmp(name, "GetImageMemoryRequirements"))
99 return (void*) vkGetImageMemoryRequirements;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600100 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
101 return (void*) vkGetImageSparseMemoryRequirements;
Jon Ashburn754864f2015-07-23 18:49:07 -0600102 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
103 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
104 if (!strcmp(name, "QueueBindSparseBufferMemory"))
105 return (void*) vkQueueBindSparseBufferMemory;
106 if (!strcmp(name, "QueueBindSparseImageOpaqueMemory"))
107 return (void*) vkQueueBindSparseImageOpaqueMemory;
108 if (!strcmp(name, "QueueBindSparseImageMemory"))
109 return (void*) vkQueueBindSparseImageMemory;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600110 if (!strcmp(name, "CreateFence"))
111 return (void*) vkCreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600112 if (!strcmp(name, "DestroyFence"))
113 return (void*) vkDestroyFence;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600114 if (!strcmp(name, "ResetFences"))
115 return (void*) vkResetFences;
116 if (!strcmp(name, "GetFenceStatus"))
117 return (void*) vkGetFenceStatus;
118 if (!strcmp(name, "WaitForFences"))
119 return (void*) vkWaitForFences;
120 if (!strcmp(name, "CreateSemaphore"))
121 return (void*) vkCreateSemaphore;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600122 if (!strcmp(name, "DestroySemaphore"))
123 return (void*) vkDestroySemaphore;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600124 if (!strcmp(name, "QueueSignalSemaphore"))
125 return (void*) vkQueueSignalSemaphore;
126 if (!strcmp(name, "QueueWaitSemaphore"))
127 return (void*) vkQueueWaitSemaphore;
128 if (!strcmp(name, "CreateEvent"))
129 return (void*) vkCreateEvent;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600130 if (!strcmp(name, "DestroyEvent"))
131 return (void*) vkDestroyEvent;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600132 if (!strcmp(name, "GetEventStatus"))
133 return (void*) vkGetEventStatus;
134 if (!strcmp(name, "SetEvent"))
135 return (void*) vkSetEvent;
136 if (!strcmp(name, "ResetEvent"))
137 return (void*) vkResetEvent;
138 if (!strcmp(name, "CreateQueryPool"))
139 return (void*) vkCreateQueryPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600140 if (!strcmp(name, "DestroyQueryPool"))
141 return (void*) vkDestroyQueryPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600142 if (!strcmp(name, "GetQueryPoolResults"))
143 return (void*) vkGetQueryPoolResults;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600144 if (!strcmp(name, "CreateBuffer"))
145 return (void*) vkCreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600146 if (!strcmp(name, "DestroyBuffer"))
147 return (void*) vkDestroyBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600148 if (!strcmp(name, "CreateBufferView"))
149 return (void*) vkCreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600150 if (!strcmp(name, "DestroyBufferView"))
151 return (void*) vkDestroyBufferView;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600152 if (!strcmp(name, "CreateImage"))
153 return (void*) vkCreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600154 if (!strcmp(name, "DestroyImage"))
155 return (void*) vkDestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -0600156 if (!strcmp(name, "GetImageSubresourceLayout"))
157 return (void*) vkGetImageSubresourceLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600158 if (!strcmp(name, "CreateImageView"))
159 return (void*) vkCreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600160 if (!strcmp(name, "DestroyImageView"))
161 return (void*) vkDestroyImageView;
Chia-I Wu08accc62015-07-07 11:50:03 +0800162 if (!strcmp(name, "CreateAttachmentView"))
163 return (void*) vkCreateAttachmentView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600164 if (!strcmp(name, "DestroyAttachmentView"))
165 return (void*) vkDestroyAttachmentView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -0600166 if (!strcmp(name, "CreateShaderModule"))
167 return (void*) vkCreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600168 if (!strcmp(name, "DestroyShaderModule"))
169 return (void*) vkDestroyShaderModule;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600170 if (!strcmp(name, "CreateShader"))
171 return (void*) vkCreateShader;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600172 if (!strcmp(name, "DestroyShader"))
173 return (void*) vkDestroyShader;
Jon Ashburnc669cc62015-07-09 15:02:25 -0600174 if (!strcmp(name, "CreatePipelineCache"))
175 return (void*) vkCreatePipelineCache;
176 if (!strcmp(name, "DestroyPipelineCache"))
177 return (void*) vkDestroyPipelineCache;
178 if (!strcmp(name, "GetPipelineCacheSize"))
179 return (void*) vkGetPipelineCacheSize;
180 if (!strcmp(name, "GetPipelineCacheData"))
181 return (void*) vkGetPipelineCacheData;
182 if (!strcmp(name, "MergePipelineCaches"))
183 return (void*) vkMergePipelineCaches;
184 if (!strcmp(name, "CreateGraphicsPipelines"))
185 return (void*) vkCreateGraphicsPipelines;
186 if (!strcmp(name, "CreateComputePipelines"))
187 return (void*) vkCreateComputePipelines;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600188 if (!strcmp(name, "DestroyPipeline"))
189 return (void*) vkDestroyPipeline;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600190 if (!strcmp(name, "CreatePipelineLayout"))
191 return (void*) vkCreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600192 if (!strcmp(name, "DestroyPipelineLayout"))
193 return (void*) vkDestroyPipelineLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600194 if (!strcmp(name, "CreateSampler"))
195 return (void*) vkCreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600196 if (!strcmp(name, "DestroySampler"))
197 return (void*) vkDestroySampler;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600198 if (!strcmp(name, "CreateDescriptorSetLayout"))
199 return (void*) vkCreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600200 if (!strcmp(name, "DestroyDescriptorSetLayout"))
201 return (void*) vkDestroyDescriptorSetLayout;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600202 if (!strcmp(name, "CreateDescriptorPool"))
203 return (void*) vkCreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600204 if (!strcmp(name, "DestroyDescriptorPool"))
205 return (void*) vkDestroyDescriptorPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600206 if (!strcmp(name, "ResetDescriptorPool"))
207 return (void*) vkResetDescriptorPool;
208 if (!strcmp(name, "AllocDescriptorSets"))
209 return (void*) vkAllocDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600210 if (!strcmp(name, "FreeDescriptorSets"))
211 return (void*) vkFreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800212 if (!strcmp(name, "UpdateDescriptorSets"))
213 return (void*) vkUpdateDescriptorSets;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600214 if (!strcmp(name, "CreateDynamicViewportState"))
215 return (void*) vkCreateDynamicViewportState;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600216 if (!strcmp(name, "DestroyDynamicViewportState"))
217 return (void*) vkDestroyDynamicViewportState;
Cody Northrop12365112015-08-17 11:10:49 -0600218 if (!strcmp(name, "CreateDynamicRasterLineState"))
219 return (void*) vkCreateDynamicRasterLineState;
220 if (!strcmp(name, "DestroyDynamicRasterLineState"))
221 return (void*) vkDestroyDynamicRasterLineState;
222 if (!strcmp(name, "CreateDynamicRasterDepthBiasState"))
223 return (void*) vkCreateDynamicRasterDepthBiasState;
224 if (!strcmp(name, "DestroyDynamicRasterDepthBiasState"))
225 return (void*) vkDestroyDynamicRasterDepthBiasState;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600226 if (!strcmp(name, "CreateDynamicColorBlendState"))
227 return (void*) vkCreateDynamicColorBlendState;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600228 if (!strcmp(name, "DestroyDynamicColorBlendState"))
229 return (void*) vkDestroyDynamicColorBlendState;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600230 if (!strcmp(name, "CreateDynamicDepthStencilState"))
231 return (void*) vkCreateDynamicDepthStencilState;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600232 if (!strcmp(name, "DestroyDynamicDepthStencilState"))
233 return (void*) vkDestroyDynamicDepthStencilState;
Jon Ashburn754864f2015-07-23 18:49:07 -0600234 if (!strcmp(name, "CreateFramebuffer"))
235 return (void*) vkCreateFramebuffer;
236 if (!strcmp(name, "DestroyFramebuffer"))
237 return (void*) vkDestroyFramebuffer;
238 if (!strcmp(name, "CreateRenderPass"))
239 return (void*) vkCreateRenderPass;
240 if (!strcmp(name, "DestroyRenderPass"))
241 return (void*) vkDestroyRenderPass;
242 if (!strcmp(name, "GetRenderAreaGranularity"))
243 return (void*) vkGetRenderAreaGranularity;
Cody Northrope62183e2015-07-09 18:08:05 -0600244 if (!strcmp(name, "CreateCommandPool"))
245 return (void*) vkCreateCommandPool;
246 if (!strcmp(name, "DestroyCommandPool"))
247 return (void*) vkDestroyCommandPool;
248 if (!strcmp(name, "ResetCommandPool"))
249 return (void*) vkResetCommandPool;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600250 if (!strcmp(name, "CreateCommandBuffer"))
251 return (void*) vkCreateCommandBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600252 if (!strcmp(name, "DestroyCommandBuffer"))
253 return (void*) vkDestroyCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600254 if (!strcmp(name, "BeginCommandBuffer"))
255 return (void*) vkBeginCommandBuffer;
256 if (!strcmp(name, "EndCommandBuffer"))
257 return (void*) vkEndCommandBuffer;
258 if (!strcmp(name, "ResetCommandBuffer"))
259 return (void*) vkResetCommandBuffer;
260 if (!strcmp(name, "CmdBindPipeline"))
261 return (void*) vkCmdBindPipeline;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600262 if (!strcmp(name, "CmdBindDynamicViewportState"))
263 return (void*) vkCmdBindDynamicViewportState;
Cody Northrop12365112015-08-17 11:10:49 -0600264 if (!strcmp(name, "CmdBindDynamicRasterLineState"))
265 return (void*) vkCmdBindDynamicRasterLineState;
266 if (!strcmp(name, "CmdBindDynamicRasterDepthBiasState"))
267 return (void*) vkCmdBindDynamicRasterDepthBiasState;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600268 if (!strcmp(name, "CmdBindDynamicColorBlendState"))
269 return (void*) vkCmdBindDynamicColorBlendState;
270 if (!strcmp(name, "CmdBindDynamicDepthStencilState"))
271 return (void*) vkCmdBindDynamicDepthStencilState;
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;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200367 if (!strcmp(name, "GetPhysicalDeviceLimits"))
368 return (void*) vkGetPhysicalDeviceLimits;
Cody Northropd0802882015-08-03 17:04:53 -0600369 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
370 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600371 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
372 return (void*) vkGetPhysicalDeviceMemoryProperties;
373 if (!strcmp(name, "GetPhysicalDeviceProperties"))
374 return (void*) vkGetPhysicalDeviceProperties;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -0600375 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
376 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
Jon Ashburnb0fbe912015-05-06 10:15:07 -0600377 if (!strcmp(name, "GetInstanceProcAddr"))
378 return (void*) vkGetInstanceProcAddr;
Jon Ashburn8d1b0b52015-05-18 13:20:15 -0600379 if (!strcmp(name, "GetDeviceProcAddr"))
380 return (void*) vkGetDeviceProcAddr;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600381 if (!strcmp(name, "CreateDevice"))
382 return (void*) vkCreateDevice;
Tony Barbour59a47322015-06-24 16:06:58 -0600383 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
384 return (void*) vkGetPhysicalDeviceExtensionProperties;
Jon Ashburn754864f2015-07-23 18:49:07 -0600385 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
386 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600387 if (!strcmp(name, "GetDeviceQueue"))
388 return (void*) vkGetDeviceQueue;
389 if (!strcmp(name, "CreateCommandBuffer"))
390 return (void*) vkCreateCommandBuffer;
Jon Ashburnd55a3942015-05-06 09:02:10 -0600391
392 return NULL;
393}