blob: f1b28868849d36b3e4a2d2655346a56377cd57d7 [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;
Cody Northropef72e2a2015-08-03 17:04:53 -060050 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
51 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060052 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
53 return (void*) vkGetPhysicalDeviceMemoryProperties;
Jon Ashburn53c16772015-05-06 10:15:07 -060054 if (!strcmp(name, "GetInstanceProcAddr"))
55 return (void*) vkGetInstanceProcAddr;
Jon Ashburn1245cec2015-05-18 13:20:15 -060056 if (!strcmp(name, "GetDeviceProcAddr"))
57 return (void*) vkGetDeviceProcAddr;
Jon Ashburn2139a3e2015-05-06 09:02:10 -060058 if (!strcmp(name, "CreateDevice"))
59 return (void*) vkCreateDevice;
60 if (!strcmp(name, "DestroyDevice"))
61 return (void*) vkDestroyDevice;
Tony Barbour426b9052015-06-24 16:06:58 -060062 if (!strcmp(name, "GetGlobalExtensionProperties"))
63 return (void*) vkGetGlobalExtensionProperties;
Tony Barbour426b9052015-06-24 16:06:58 -060064 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
65 return (void*) vkGetPhysicalDeviceExtensionProperties;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -060066 if (!strcmp(name, "GetGlobalLayerProperties"))
67 return (void*) vkGetGlobalLayerProperties;
68 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
69 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburn2139a3e2015-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 Ashburn2139a3e2015-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 Ashburn4e189562015-07-23 18:49:07 -060090 if (!strcmp(name, "GetDeviceMemoryCommitment"))
91 return (void *) vkGetDeviceMemoryCommitment;
Tony Barbourde4124d2015-07-03 10:33:54 -060092 if (!strcmp(name, "BindBufferMemory"))
93 return (void*) vkBindBufferMemory;
Jon Ashburn4e189562015-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 Lobodzinski83d4e6a2015-07-03 15:58:09 -0600100 if (!strcmp(name, "GetImageSparseMemoryRequirements"))
101 return (void*) vkGetImageSparseMemoryRequirements;
Jon Ashburn4e189562015-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 Ashburn2139a3e2015-05-06 09:02:10 -0600110 if (!strcmp(name, "CreateFence"))
111 return (void*) vkCreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -0600112 if (!strcmp(name, "DestroyFence"))
113 return (void*) vkDestroyFence;
Jon Ashburn2139a3e2015-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 Barbourde4124d2015-07-03 10:33:54 -0600122 if (!strcmp(name, "DestroySemaphore"))
123 return (void*) vkDestroySemaphore;
Jon Ashburn2139a3e2015-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 Barbourde4124d2015-07-03 10:33:54 -0600130 if (!strcmp(name, "DestroyEvent"))
131 return (void*) vkDestroyEvent;
Jon Ashburn2139a3e2015-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 Barbourde4124d2015-07-03 10:33:54 -0600140 if (!strcmp(name, "DestroyQueryPool"))
141 return (void*) vkDestroyQueryPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600142 if (!strcmp(name, "GetQueryPoolResults"))
143 return (void*) vkGetQueryPoolResults;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600144 if (!strcmp(name, "CreateBuffer"))
145 return (void*) vkCreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600146 if (!strcmp(name, "DestroyBuffer"))
147 return (void*) vkDestroyBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600148 if (!strcmp(name, "CreateBufferView"))
149 return (void*) vkCreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600150 if (!strcmp(name, "DestroyBufferView"))
151 return (void*) vkDestroyBufferView;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600152 if (!strcmp(name, "CreateImage"))
153 return (void*) vkCreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -0600154 if (!strcmp(name, "DestroyImage"))
155 return (void*) vkDestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -0600156 if (!strcmp(name, "GetImageSubresourceLayout"))
157 return (void*) vkGetImageSubresourceLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600158 if (!strcmp(name, "CreateImageView"))
159 return (void*) vkCreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600160 if (!strcmp(name, "DestroyImageView"))
161 return (void*) vkDestroyImageView;
Chia-I Wuc278df82015-07-07 11:50:03 +0800162 if (!strcmp(name, "CreateAttachmentView"))
163 return (void*) vkCreateAttachmentView;
Tony Barbourde4124d2015-07-03 10:33:54 -0600164 if (!strcmp(name, "DestroyAttachmentView"))
165 return (void*) vkDestroyAttachmentView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -0600166 if (!strcmp(name, "CreateShaderModule"))
167 return (void*) vkCreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -0600168 if (!strcmp(name, "DestroyShaderModule"))
169 return (void*) vkDestroyShaderModule;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600170 if (!strcmp(name, "CreateShader"))
171 return (void*) vkCreateShader;
Tony Barbourde4124d2015-07-03 10:33:54 -0600172 if (!strcmp(name, "DestroyShader"))
173 return (void*) vkDestroyShader;
Jon Ashburn0d60d272015-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 Barbourde4124d2015-07-03 10:33:54 -0600188 if (!strcmp(name, "DestroyPipeline"))
189 return (void*) vkDestroyPipeline;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600190 if (!strcmp(name, "CreatePipelineLayout"))
191 return (void*) vkCreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600192 if (!strcmp(name, "DestroyPipelineLayout"))
193 return (void*) vkDestroyPipelineLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600194 if (!strcmp(name, "CreateSampler"))
195 return (void*) vkCreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -0600196 if (!strcmp(name, "DestroySampler"))
197 return (void*) vkDestroySampler;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600198 if (!strcmp(name, "CreateDescriptorSetLayout"))
199 return (void*) vkCreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600200 if (!strcmp(name, "DestroyDescriptorSetLayout"))
201 return (void*) vkDestroyDescriptorSetLayout;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600202 if (!strcmp(name, "CreateDescriptorPool"))
203 return (void*) vkCreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600204 if (!strcmp(name, "DestroyDescriptorPool"))
205 return (void*) vkDestroyDescriptorPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600206 if (!strcmp(name, "ResetDescriptorPool"))
207 return (void*) vkResetDescriptorPool;
208 if (!strcmp(name, "AllocDescriptorSets"))
209 return (void*) vkAllocDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -0600210 if (!strcmp(name, "FreeDescriptorSets"))
211 return (void*) vkFreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +0800212 if (!strcmp(name, "UpdateDescriptorSets"))
213 return (void*) vkUpdateDescriptorSets;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600214 if (!strcmp(name, "CreateDynamicViewportState"))
215 return (void*) vkCreateDynamicViewportState;
Tony Barbourde4124d2015-07-03 10:33:54 -0600216 if (!strcmp(name, "DestroyDynamicViewportState"))
217 return (void*) vkDestroyDynamicViewportState;
Cody Northrope4bc6942015-08-26 10:01:32 -0600218 if (!strcmp(name, "CreateDynamicLineWidthState"))
219 return (void*) vkCreateDynamicLineWidthState;
220 if (!strcmp(name, "DestroyDynamicLineWidthState"))
221 return (void*) vkDestroyDynamicLineWidthState;
222 if (!strcmp(name, "CreateDynamicDepthBiasState"))
223 return (void*) vkCreateDynamicDepthBiasState;
224 if (!strcmp(name, "DestroyDynamicDepthBiasState"))
225 return (void*) vkDestroyDynamicDepthBiasState;
226 if (!strcmp(name, "CreateDynamicBlendState"))
227 return (void*) vkCreateDynamicBlendState;
228 if (!strcmp(name, "DestroyDynamicBlendState"))
229 return (void*) vkDestroyDynamicBlendState;
230 if (!strcmp(name, "CreateDynamicDepthBoundsState"))
231 return (void*) vkCreateDynamicDepthBoundsState;
232 if (!strcmp(name, "DestroyDynamicDepthBoundsState"))
233 return (void*) vkDestroyDynamicDepthBoundsState;
Cody Northrop2605cb02015-08-18 15:21:16 -0600234 if (!strcmp(name, "CreateDynamicStencilState"))
235 return (void*) vkCreateDynamicStencilState;
236 if (!strcmp(name, "DestroyDynamicStencilState"))
237 return (void*) vkDestroyDynamicStencilState;
Jon Ashburn4e189562015-07-23 18:49:07 -0600238 if (!strcmp(name, "CreateFramebuffer"))
239 return (void*) vkCreateFramebuffer;
240 if (!strcmp(name, "DestroyFramebuffer"))
241 return (void*) vkDestroyFramebuffer;
242 if (!strcmp(name, "CreateRenderPass"))
243 return (void*) vkCreateRenderPass;
244 if (!strcmp(name, "DestroyRenderPass"))
245 return (void*) vkDestroyRenderPass;
246 if (!strcmp(name, "GetRenderAreaGranularity"))
247 return (void*) vkGetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -0600248 if (!strcmp(name, "CreateCommandPool"))
249 return (void*) vkCreateCommandPool;
250 if (!strcmp(name, "DestroyCommandPool"))
251 return (void*) vkDestroyCommandPool;
252 if (!strcmp(name, "ResetCommandPool"))
253 return (void*) vkResetCommandPool;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600254 if (!strcmp(name, "CreateCommandBuffer"))
255 return (void*) vkCreateCommandBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -0600256 if (!strcmp(name, "DestroyCommandBuffer"))
257 return (void*) vkDestroyCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600258 if (!strcmp(name, "BeginCommandBuffer"))
259 return (void*) vkBeginCommandBuffer;
260 if (!strcmp(name, "EndCommandBuffer"))
261 return (void*) vkEndCommandBuffer;
262 if (!strcmp(name, "ResetCommandBuffer"))
263 return (void*) vkResetCommandBuffer;
264 if (!strcmp(name, "CmdBindPipeline"))
265 return (void*) vkCmdBindPipeline;
Tony Barbourde4124d2015-07-03 10:33:54 -0600266 if (!strcmp(name, "CmdBindDynamicViewportState"))
267 return (void*) vkCmdBindDynamicViewportState;
Cody Northrope4bc6942015-08-26 10:01:32 -0600268 if (!strcmp(name, "CmdBindDynamicLineWidthState"))
269 return (void*) vkCmdBindDynamicLineWidthState;
270 if (!strcmp(name, "CmdBindDynamicDepthBiasState"))
271 return (void*) vkCmdBindDynamicDepthBiasState;
272 if (!strcmp(name, "CmdBindDynamicBlendState"))
273 return (void*) vkCmdBindDynamicBlendState;
274 if (!strcmp(name, "CmdBindDynamicDepthBoundsState"))
275 return (void*) vkCmdBindDynamicDepthBoundsState;
Cody Northrop2605cb02015-08-18 15:21:16 -0600276 if (!strcmp(name, "CmdBindDynamicStencilState"))
277 return (void*) vkCmdBindDynamicStencilState;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600278 if (!strcmp(name, "CmdBindDescriptorSets"))
279 return (void*) vkCmdBindDescriptorSets;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600280 if (!strcmp(name, "CmdBindIndexBuffer"))
281 return (void*) vkCmdBindIndexBuffer;
Jon Ashburn4e189562015-07-23 18:49:07 -0600282 if (!strcmp(name, "CmdBindVertexBuffers"))
283 return (void*) vkCmdBindVertexBuffers;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600284 if (!strcmp(name, "CmdDraw"))
285 return (void*) vkCmdDraw;
286 if (!strcmp(name, "CmdDrawIndexed"))
287 return (void*) vkCmdDrawIndexed;
288 if (!strcmp(name, "CmdDrawIndirect"))
289 return (void*) vkCmdDrawIndirect;
290 if (!strcmp(name, "CmdDrawIndexedIndirect"))
291 return (void*) vkCmdDrawIndexedIndirect;
292 if (!strcmp(name, "CmdDispatch"))
293 return (void*) vkCmdDispatch;
294 if (!strcmp(name, "CmdDispatchIndirect"))
295 return (void*) vkCmdDispatchIndirect;
296 if (!strcmp(name, "CmdCopyBuffer"))
297 return (void*) vkCmdCopyBuffer;
298 if (!strcmp(name, "CmdCopyImage"))
299 return (void*) vkCmdCopyImage;
300 if (!strcmp(name, "CmdBlitImage"))
301 return (void*) vkCmdBlitImage;
302 if (!strcmp(name, "CmdCopyBufferToImage"))
303 return (void*) vkCmdCopyBufferToImage;
304 if (!strcmp(name, "CmdCopyImageToBuffer"))
305 return (void*) vkCmdCopyImageToBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600306 if (!strcmp(name, "CmdUpdateBuffer"))
307 return (void*) vkCmdUpdateBuffer;
308 if (!strcmp(name, "CmdFillBuffer"))
309 return (void*) vkCmdFillBuffer;
310 if (!strcmp(name, "CmdClearColorImage"))
311 return (void*) vkCmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200312 if (!strcmp(name, "CmdClearDepthStencilImage"))
313 return (void*) vkCmdClearDepthStencilImage;
314 if (!strcmp(name, "CmdClearColorAttachment"))
315 return (void*) vkCmdClearColorAttachment;
316 if (!strcmp(name, "CmdClearDepthStencilAttachment"))
317 return (void*) vkCmdClearDepthStencilAttachment;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600318 if (!strcmp(name, "CmdResolveImage"))
319 return (void*) vkCmdResolveImage;
320 if (!strcmp(name, "CmdSetEvent"))
321 return (void*) vkCmdSetEvent;
322 if (!strcmp(name, "CmdResetEvent"))
323 return (void*) vkCmdResetEvent;
324 if (!strcmp(name, "CmdWaitEvents"))
325 return (void*) vkCmdWaitEvents;
326 if (!strcmp(name, "CmdPipelineBarrier"))
327 return (void*) vkCmdPipelineBarrier;
328 if (!strcmp(name, "CmdBeginQuery"))
329 return (void*) vkCmdBeginQuery;
330 if (!strcmp(name, "CmdEndQuery"))
331 return (void*) vkCmdEndQuery;
332 if (!strcmp(name, "CmdResetQueryPool"))
333 return (void*) vkCmdResetQueryPool;
334 if (!strcmp(name, "CmdWriteTimestamp"))
335 return (void*) vkCmdWriteTimestamp;
336 if (!strcmp(name, "CmdCopyQueryPoolResults"))
337 return (void*) vkCmdCopyQueryPoolResults;
Jon Ashburn4e189562015-07-23 18:49:07 -0600338 if (!strcmp(name, "CmdPushConstants"))
339 return (void*) vkCmdPushConstants;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600340 if (!strcmp(name, "CmdBeginRenderPass"))
341 return (void*) vkCmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800342 if (!strcmp(name, "CmdNextSubpass"))
343 return (void*) vkCmdNextSubpass;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600344 if (!strcmp(name, "CmdEndRenderPass"))
345 return (void*) vkCmdEndRenderPass;
Jon Ashburn4e189562015-07-23 18:49:07 -0600346 if (!strcmp(name, "CmdExecuteCommands"))
347 return (void*) vkCmdExecuteCommands;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600348 return NULL;
349}
350
351/* These functions require special handling by the loader.
352* They are not just generic trampoline code entrypoints.
353* Thus GPA must return loader entrypoint for these instead of first function
354* in the chain. */
355static inline void *loader_non_passthrough_gpa(const char *name)
356{
357 if (!name || name[0] != 'v' || name[1] != 'k')
358 return NULL;
359
360 name += 2;
361 if (!strcmp(name, "CreateInstance"))
362 return (void*) vkCreateInstance;
363 if (!strcmp(name, "DestroyInstance"))
364 return (void*) vkDestroyInstance;
365 if (!strcmp(name, "EnumeratePhysicalDevices"))
366 return (void*) vkEnumeratePhysicalDevices;
Chris Forbesd7576302015-06-21 22:55:02 +1200367 if (!strcmp(name, "GetPhysicalDeviceFeatures"))
368 return (void*) vkGetPhysicalDeviceFeatures;
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -0600369 if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
370 return (void*) vkGetPhysicalDeviceFormatProperties;
Jon Ashburn4e189562015-07-23 18:49:07 -0600371 if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
372 return (void*) vkGetPhysicalDeviceImageFormatProperties;
Chris Forbesd7576302015-06-21 22:55:02 +1200373 if (!strcmp(name, "GetPhysicalDeviceLimits"))
374 return (void*) vkGetPhysicalDeviceLimits;
Cody Northropef72e2a2015-08-03 17:04:53 -0600375 if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
376 return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600377 if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
378 return (void*) vkGetPhysicalDeviceMemoryProperties;
379 if (!strcmp(name, "GetPhysicalDeviceProperties"))
380 return (void*) vkGetPhysicalDeviceProperties;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600381 if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
382 return (void*) vkGetPhysicalDeviceSparseImageFormatProperties;
Jon Ashburn53c16772015-05-06 10:15:07 -0600383 if (!strcmp(name, "GetInstanceProcAddr"))
384 return (void*) vkGetInstanceProcAddr;
Jon Ashburn1245cec2015-05-18 13:20:15 -0600385 if (!strcmp(name, "GetDeviceProcAddr"))
386 return (void*) vkGetDeviceProcAddr;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600387 if (!strcmp(name, "CreateDevice"))
388 return (void*) vkCreateDevice;
Tony Barbour426b9052015-06-24 16:06:58 -0600389 if (!strcmp(name, "GetPhysicalDeviceExtensionProperties"))
390 return (void*) vkGetPhysicalDeviceExtensionProperties;
Jon Ashburn4e189562015-07-23 18:49:07 -0600391 if (!strcmp(name, "GetPhysicalDeviceLayerProperties"))
392 return (void*) vkGetPhysicalDeviceLayerProperties;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600393 if (!strcmp(name, "GetDeviceQueue"))
394 return (void*) vkGetDeviceQueue;
395 if (!strcmp(name, "CreateCommandBuffer"))
396 return (void*) vkCreateCommandBuffer;
Jon Ashburn2139a3e2015-05-06 09:02:10 -0600397
398 return NULL;
399}