-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgpa_helper.c
307 lines (292 loc) · 20 KB
/
gpa_helper.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
/*
*
* Copyright (c) 2015-2021 The Khronos Group Inc.
* Copyright (c) 2015-2021 Valve Corporation
* Copyright (c) 2015-2021 LunarG, Inc.
* Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: Jon Ashburn <[email protected]>
* Author: Charles Giessen <[email protected]>
*/
#include "gpa_helper.h"
#include <string.h>
#include "debug_utils.h"
#include "unknown_function_handling.h"
#include "wsi.h"
void *trampoline_get_proc_addr(struct loader_instance *inst, const char *funcName) {
// Don't include or check global functions
if (!strcmp(funcName, "vkGetInstanceProcAddr")) return vkGetInstanceProcAddr;
if (!strcmp(funcName, "vkDestroyInstance")) return vkDestroyInstance;
if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) return vkEnumeratePhysicalDevices;
if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) return vkGetPhysicalDeviceFeatures;
if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) return vkGetPhysicalDeviceFormatProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties")) return vkGetPhysicalDeviceImageFormatProperties;
#ifndef VULKANSC
if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties")) return vkGetPhysicalDeviceSparseImageFormatProperties;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) return vkGetPhysicalDeviceProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties")) return vkGetPhysicalDeviceQueueFamilyProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties")) return vkGetPhysicalDeviceMemoryProperties;
if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) return vkEnumerateDeviceLayerProperties;
if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) return vkEnumerateDeviceExtensionProperties;
if (!strcmp(funcName, "vkCreateDevice")) return vkCreateDevice;
if (!strcmp(funcName, "vkGetDeviceProcAddr")) return vkGetDeviceProcAddr;
if (!strcmp(funcName, "vkDestroyDevice")) return vkDestroyDevice;
if (!strcmp(funcName, "vkGetDeviceQueue")) return vkGetDeviceQueue;
if (!strcmp(funcName, "vkQueueSubmit")) return vkQueueSubmit;
if (!strcmp(funcName, "vkQueueWaitIdle")) return vkQueueWaitIdle;
if (!strcmp(funcName, "vkDeviceWaitIdle")) return vkDeviceWaitIdle;
if (!strcmp(funcName, "vkAllocateMemory")) return vkAllocateMemory;
#ifndef VULKANSC
if (!strcmp(funcName, "vkFreeMemory")) return vkFreeMemory;
#endif // VULKANSC
if (!strcmp(funcName, "vkMapMemory")) return vkMapMemory;
if (!strcmp(funcName, "vkUnmapMemory")) return vkUnmapMemory;
if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) return vkFlushMappedMemoryRanges;
if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) return vkInvalidateMappedMemoryRanges;
if (!strcmp(funcName, "vkGetDeviceMemoryCommitment")) return vkGetDeviceMemoryCommitment;
#ifndef VULKANSC
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements")) return vkGetImageSparseMemoryRequirements;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetImageMemoryRequirements")) return vkGetImageMemoryRequirements;
if (!strcmp(funcName, "vkGetBufferMemoryRequirements")) return vkGetBufferMemoryRequirements;
if (!strcmp(funcName, "vkBindImageMemory")) return vkBindImageMemory;
if (!strcmp(funcName, "vkBindBufferMemory")) return vkBindBufferMemory;
#ifndef VULKANSC
if (!strcmp(funcName, "vkQueueBindSparse")) return vkQueueBindSparse;
#endif // VULKANSC
if (!strcmp(funcName, "vkCreateFence")) return vkCreateFence;
if (!strcmp(funcName, "vkDestroyFence")) return vkDestroyFence;
if (!strcmp(funcName, "vkGetFenceStatus")) return vkGetFenceStatus;
if (!strcmp(funcName, "vkResetFences")) return vkResetFences;
if (!strcmp(funcName, "vkWaitForFences")) return vkWaitForFences;
if (!strcmp(funcName, "vkCreateSemaphore")) return vkCreateSemaphore;
if (!strcmp(funcName, "vkDestroySemaphore")) return vkDestroySemaphore;
if (!strcmp(funcName, "vkCreateEvent")) return vkCreateEvent;
if (!strcmp(funcName, "vkDestroyEvent")) return vkDestroyEvent;
if (!strcmp(funcName, "vkGetEventStatus")) return vkGetEventStatus;
if (!strcmp(funcName, "vkSetEvent")) return vkSetEvent;
if (!strcmp(funcName, "vkResetEvent")) return vkResetEvent;
if (!strcmp(funcName, "vkCreateQueryPool")) return vkCreateQueryPool;
#ifndef VULKANSC
if (!strcmp(funcName, "vkDestroyQueryPool")) return vkDestroyQueryPool;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetQueryPoolResults")) return vkGetQueryPoolResults;
if (!strcmp(funcName, "vkCreateBuffer")) return vkCreateBuffer;
if (!strcmp(funcName, "vkDestroyBuffer")) return vkDestroyBuffer;
if (!strcmp(funcName, "vkCreateBufferView")) return vkCreateBufferView;
if (!strcmp(funcName, "vkDestroyBufferView")) return vkDestroyBufferView;
if (!strcmp(funcName, "vkCreateImage")) return vkCreateImage;
if (!strcmp(funcName, "vkDestroyImage")) return vkDestroyImage;
if (!strcmp(funcName, "vkGetImageSubresourceLayout")) return vkGetImageSubresourceLayout;
if (!strcmp(funcName, "vkCreateImageView")) return vkCreateImageView;
if (!strcmp(funcName, "vkDestroyImageView")) return vkDestroyImageView;
#ifndef VULKANSC
if (!strcmp(funcName, "vkCreateShaderModule")) return vkCreateShaderModule;
if (!strcmp(funcName, "vkDestroyShaderModule")) return vkDestroyShaderModule;
#endif // VULKANSC
if (!strcmp(funcName, "vkCreatePipelineCache")) return vkCreatePipelineCache;
if (!strcmp(funcName, "vkDestroyPipelineCache")) return vkDestroyPipelineCache;
#ifndef VULKANSC
if (!strcmp(funcName, "vkGetPipelineCacheData")) return vkGetPipelineCacheData;
if (!strcmp(funcName, "vkMergePipelineCaches")) return vkMergePipelineCaches;
#endif // VULKANSC
if (!strcmp(funcName, "vkCreateGraphicsPipelines")) return vkCreateGraphicsPipelines;
if (!strcmp(funcName, "vkCreateComputePipelines")) return vkCreateComputePipelines;
if (!strcmp(funcName, "vkDestroyPipeline")) return vkDestroyPipeline;
if (!strcmp(funcName, "vkCreatePipelineLayout")) return vkCreatePipelineLayout;
if (!strcmp(funcName, "vkDestroyPipelineLayout")) return vkDestroyPipelineLayout;
if (!strcmp(funcName, "vkCreateSampler")) return vkCreateSampler;
if (!strcmp(funcName, "vkDestroySampler")) return vkDestroySampler;
if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) return vkCreateDescriptorSetLayout;
if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) return vkDestroyDescriptorSetLayout;
if (!strcmp(funcName, "vkCreateDescriptorPool")) return vkCreateDescriptorPool;
#ifndef VULKANSC
if (!strcmp(funcName, "vkDestroyDescriptorPool")) return vkDestroyDescriptorPool;
#endif // VULKANSC
if (!strcmp(funcName, "vkResetDescriptorPool")) return vkResetDescriptorPool;
if (!strcmp(funcName, "vkAllocateDescriptorSets")) return vkAllocateDescriptorSets;
if (!strcmp(funcName, "vkFreeDescriptorSets")) return vkFreeDescriptorSets;
if (!strcmp(funcName, "vkUpdateDescriptorSets")) return vkUpdateDescriptorSets;
if (!strcmp(funcName, "vkCreateFramebuffer")) return vkCreateFramebuffer;
if (!strcmp(funcName, "vkDestroyFramebuffer")) return vkDestroyFramebuffer;
if (!strcmp(funcName, "vkCreateRenderPass")) return vkCreateRenderPass;
if (!strcmp(funcName, "vkDestroyRenderPass")) return vkDestroyRenderPass;
if (!strcmp(funcName, "vkGetRenderAreaGranularity")) return vkGetRenderAreaGranularity;
if (!strcmp(funcName, "vkCreateCommandPool")) return vkCreateCommandPool;
#ifndef VULKANSC
if (!strcmp(funcName, "vkDestroyCommandPool")) return vkDestroyCommandPool;
#endif // VULKANSC
if (!strcmp(funcName, "vkResetCommandPool")) return vkResetCommandPool;
if (!strcmp(funcName, "vkAllocateCommandBuffers")) return vkAllocateCommandBuffers;
if (!strcmp(funcName, "vkFreeCommandBuffers")) return vkFreeCommandBuffers;
if (!strcmp(funcName, "vkBeginCommandBuffer")) return vkBeginCommandBuffer;
if (!strcmp(funcName, "vkEndCommandBuffer")) return vkEndCommandBuffer;
if (!strcmp(funcName, "vkResetCommandBuffer")) return vkResetCommandBuffer;
if (!strcmp(funcName, "vkCmdBindPipeline")) return vkCmdBindPipeline;
if (!strcmp(funcName, "vkCmdBindDescriptorSets")) return vkCmdBindDescriptorSets;
if (!strcmp(funcName, "vkCmdBindVertexBuffers")) return vkCmdBindVertexBuffers;
if (!strcmp(funcName, "vkCmdBindIndexBuffer")) return vkCmdBindIndexBuffer;
if (!strcmp(funcName, "vkCmdSetViewport")) return vkCmdSetViewport;
if (!strcmp(funcName, "vkCmdSetScissor")) return vkCmdSetScissor;
if (!strcmp(funcName, "vkCmdSetLineWidth")) return vkCmdSetLineWidth;
if (!strcmp(funcName, "vkCmdSetDepthBias")) return vkCmdSetDepthBias;
if (!strcmp(funcName, "vkCmdSetBlendConstants")) return vkCmdSetBlendConstants;
if (!strcmp(funcName, "vkCmdSetDepthBounds")) return vkCmdSetDepthBounds;
if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) return vkCmdSetStencilCompareMask;
if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) return vkCmdSetStencilWriteMask;
if (!strcmp(funcName, "vkCmdSetStencilReference")) return vkCmdSetStencilReference;
if (!strcmp(funcName, "vkCmdDraw")) return vkCmdDraw;
if (!strcmp(funcName, "vkCmdDrawIndexed")) return vkCmdDrawIndexed;
if (!strcmp(funcName, "vkCmdDrawIndirect")) return vkCmdDrawIndirect;
if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) return vkCmdDrawIndexedIndirect;
if (!strcmp(funcName, "vkCmdDispatch")) return vkCmdDispatch;
if (!strcmp(funcName, "vkCmdDispatchIndirect")) return vkCmdDispatchIndirect;
if (!strcmp(funcName, "vkCmdCopyBuffer")) return vkCmdCopyBuffer;
if (!strcmp(funcName, "vkCmdCopyImage")) return vkCmdCopyImage;
if (!strcmp(funcName, "vkCmdBlitImage")) return vkCmdBlitImage;
if (!strcmp(funcName, "vkCmdCopyBufferToImage")) return vkCmdCopyBufferToImage;
if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) return vkCmdCopyImageToBuffer;
if (!strcmp(funcName, "vkCmdUpdateBuffer")) return vkCmdUpdateBuffer;
if (!strcmp(funcName, "vkCmdFillBuffer")) return vkCmdFillBuffer;
if (!strcmp(funcName, "vkCmdClearColorImage")) return vkCmdClearColorImage;
if (!strcmp(funcName, "vkCmdClearDepthStencilImage")) return vkCmdClearDepthStencilImage;
if (!strcmp(funcName, "vkCmdClearAttachments")) return vkCmdClearAttachments;
if (!strcmp(funcName, "vkCmdResolveImage")) return vkCmdResolveImage;
if (!strcmp(funcName, "vkCmdSetEvent")) return vkCmdSetEvent;
if (!strcmp(funcName, "vkCmdResetEvent")) return vkCmdResetEvent;
if (!strcmp(funcName, "vkCmdWaitEvents")) return vkCmdWaitEvents;
if (!strcmp(funcName, "vkCmdPipelineBarrier")) return vkCmdPipelineBarrier;
if (!strcmp(funcName, "vkCmdBeginQuery")) return vkCmdBeginQuery;
if (!strcmp(funcName, "vkCmdEndQuery")) return vkCmdEndQuery;
if (!strcmp(funcName, "vkCmdResetQueryPool")) return vkCmdResetQueryPool;
if (!strcmp(funcName, "vkCmdWriteTimestamp")) return vkCmdWriteTimestamp;
if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) return vkCmdCopyQueryPoolResults;
if (!strcmp(funcName, "vkCmdPushConstants")) return vkCmdPushConstants;
if (!strcmp(funcName, "vkCmdBeginRenderPass")) return vkCmdBeginRenderPass;
if (!strcmp(funcName, "vkCmdNextSubpass")) return vkCmdNextSubpass;
if (!strcmp(funcName, "vkCmdEndRenderPass")) return vkCmdEndRenderPass;
if (!strcmp(funcName, "vkCmdExecuteCommands")) return vkCmdExecuteCommands;
// Core 1.1 functions
if (!strcmp(funcName, "vkEnumeratePhysicalDeviceGroups")) return vkEnumeratePhysicalDeviceGroups;
if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures2")) return vkGetPhysicalDeviceFeatures2;
if (!strcmp(funcName, "vkGetPhysicalDeviceProperties2")) return vkGetPhysicalDeviceProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties2")) return vkGetPhysicalDeviceFormatProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties2")) return vkGetPhysicalDeviceImageFormatProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties2")) return vkGetPhysicalDeviceQueueFamilyProperties2;
if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties2")) return vkGetPhysicalDeviceMemoryProperties2;
#ifndef VULKANSC
if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties2"))
return vkGetPhysicalDeviceSparseImageFormatProperties2;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalBufferProperties")) return vkGetPhysicalDeviceExternalBufferProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalSemaphoreProperties")) return vkGetPhysicalDeviceExternalSemaphoreProperties;
if (!strcmp(funcName, "vkGetPhysicalDeviceExternalFenceProperties")) return vkGetPhysicalDeviceExternalFenceProperties;
if (!strcmp(funcName, "vkBindBufferMemory2")) return vkBindBufferMemory2;
if (!strcmp(funcName, "vkBindImageMemory2")) return vkBindImageMemory2;
if (!strcmp(funcName, "vkGetDeviceGroupPeerMemoryFeatures")) return vkGetDeviceGroupPeerMemoryFeatures;
if (!strcmp(funcName, "vkCmdSetDeviceMask")) return vkCmdSetDeviceMask;
if (!strcmp(funcName, "vkCmdDispatchBase")) return vkCmdDispatchBase;
if (!strcmp(funcName, "vkGetImageMemoryRequirements2")) return vkGetImageMemoryRequirements2;
#ifndef VULKANSC
if (!strcmp(funcName, "vkTrimCommandPool")) return vkTrimCommandPool;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetDeviceQueue2")) return vkGetDeviceQueue2;
if (!strcmp(funcName, "vkCreateSamplerYcbcrConversion")) return vkCreateSamplerYcbcrConversion;
if (!strcmp(funcName, "vkDestroySamplerYcbcrConversion")) return vkDestroySamplerYcbcrConversion;
if (!strcmp(funcName, "vkGetDescriptorSetLayoutSupport")) return vkGetDescriptorSetLayoutSupport;
#ifndef VULKANSC
if (!strcmp(funcName, "vkCreateDescriptorUpdateTemplate")) return vkCreateDescriptorUpdateTemplate;
if (!strcmp(funcName, "vkDestroyDescriptorUpdateTemplate")) return vkDestroyDescriptorUpdateTemplate;
if (!strcmp(funcName, "vkUpdateDescriptorSetWithTemplate")) return vkUpdateDescriptorSetWithTemplate;
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements2")) return vkGetImageSparseMemoryRequirements2;
#endif // VULKANSC
if (!strcmp(funcName, "vkGetBufferMemoryRequirements2")) return vkGetBufferMemoryRequirements2;
// Core 1.2 functions
if (!strcmp(funcName, "vkCreateRenderPass2")) return vkCreateRenderPass2;
if (!strcmp(funcName, "vkCmdBeginRenderPass2")) return vkCmdBeginRenderPass2;
if (!strcmp(funcName, "vkCmdNextSubpass2")) return vkCmdNextSubpass2;
if (!strcmp(funcName, "vkCmdEndRenderPass2")) return vkCmdEndRenderPass2;
if (!strcmp(funcName, "vkCmdDrawIndirectCount")) return vkCmdDrawIndirectCount;
if (!strcmp(funcName, "vkCmdDrawIndexedIndirectCount")) return vkCmdDrawIndexedIndirectCount;
if (!strcmp(funcName, "vkGetSemaphoreCounterValue")) return vkGetSemaphoreCounterValue;
if (!strcmp(funcName, "vkWaitSemaphores")) return vkWaitSemaphores;
if (!strcmp(funcName, "vkSignalSemaphore")) return vkSignalSemaphore;
if (!strcmp(funcName, "vkGetBufferDeviceAddress")) return vkGetBufferDeviceAddress;
if (!strcmp(funcName, "vkGetBufferOpaqueCaptureAddress")) return vkGetBufferOpaqueCaptureAddress;
if (!strcmp(funcName, "vkGetDeviceMemoryOpaqueCaptureAddress")) return vkGetDeviceMemoryOpaqueCaptureAddress;
if (!strcmp(funcName, "vkResetQueryPool")) return vkResetQueryPool;
#ifndef VULKANSC
// Core 1.3 functions
if (!strcmp(funcName, "vkGetPhysicalDeviceToolProperties")) return vkGetPhysicalDeviceToolProperties;
if (!strcmp(funcName, "vkCreatePrivateDataSlot")) return vkCreatePrivateDataSlot;
if (!strcmp(funcName, "vkDestroyPrivateDataSlot")) return vkDestroyPrivateDataSlot;
if (!strcmp(funcName, "vkSetPrivateData")) return vkSetPrivateData;
if (!strcmp(funcName, "vkGetPrivateData")) return vkGetPrivateData;
if (!strcmp(funcName, "vkCmdSetEvent2")) return vkCmdSetEvent2;
if (!strcmp(funcName, "vkCmdResetEvent2")) return vkCmdResetEvent2;
if (!strcmp(funcName, "vkCmdWaitEvents2")) return vkCmdWaitEvents2;
if (!strcmp(funcName, "vkCmdPipelineBarrier2")) return vkCmdPipelineBarrier2;
if (!strcmp(funcName, "vkCmdWriteTimestamp2")) return vkCmdWriteTimestamp2;
if (!strcmp(funcName, "vkQueueSubmit2")) return vkQueueSubmit2;
if (!strcmp(funcName, "vkCmdCopyBuffer2")) return vkCmdCopyBuffer2;
if (!strcmp(funcName, "vkCmdCopyImage2")) return vkCmdCopyImage2;
if (!strcmp(funcName, "vkCmdCopyBufferToImage2")) return vkCmdCopyBufferToImage2;
if (!strcmp(funcName, "vkCmdCopyImageToBuffer2")) return vkCmdCopyImageToBuffer2;
if (!strcmp(funcName, "vkCmdBlitImage2")) return vkCmdBlitImage2;
if (!strcmp(funcName, "vkCmdResolveImage2")) return vkCmdResolveImage2;
if (!strcmp(funcName, "vkCmdBeginRendering")) return vkCmdBeginRendering;
if (!strcmp(funcName, "vkCmdEndRendering")) return vkCmdEndRendering;
if (!strcmp(funcName, "vkCmdSetCullMode")) return vkCmdSetCullMode;
if (!strcmp(funcName, "vkCmdSetFrontFace")) return vkCmdSetFrontFace;
if (!strcmp(funcName, "vkCmdSetPrimitiveTopology")) return vkCmdSetPrimitiveTopology;
if (!strcmp(funcName, "vkCmdSetViewportWithCount")) return vkCmdSetViewportWithCount;
if (!strcmp(funcName, "vkCmdSetScissorWithCount")) return vkCmdSetScissorWithCount;
if (!strcmp(funcName, "vkCmdBindVertexBuffers2")) return vkCmdBindVertexBuffers2;
if (!strcmp(funcName, "vkCmdSetDepthTestEnable")) return vkCmdSetDepthTestEnable;
if (!strcmp(funcName, "vkCmdSetDepthWriteEnable")) return vkCmdSetDepthWriteEnable;
if (!strcmp(funcName, "vkCmdSetDepthCompareOp")) return vkCmdSetDepthCompareOp;
if (!strcmp(funcName, "vkCmdSetDepthBoundsTestEnable")) return vkCmdSetDepthBoundsTestEnable;
if (!strcmp(funcName, "vkCmdSetStencilTestEnable")) return vkCmdSetStencilTestEnable;
if (!strcmp(funcName, "vkCmdSetStencilOp")) return vkCmdSetStencilOp;
if (!strcmp(funcName, "vkCmdSetRasterizerDiscardEnable")) return vkCmdSetRasterizerDiscardEnable;
if (!strcmp(funcName, "vkCmdSetDepthBiasEnable")) return vkCmdSetDepthBiasEnable;
if (!strcmp(funcName, "vkCmdSetPrimitiveRestartEnable")) return vkCmdSetPrimitiveRestartEnable;
if (!strcmp(funcName, "vkGetDeviceBufferMemoryRequirements")) return vkGetDeviceBufferMemoryRequirements;
if (!strcmp(funcName, "vkGetDeviceImageMemoryRequirements")) return vkGetDeviceImageMemoryRequirements;
if (!strcmp(funcName, "vkGetDeviceImageSparseMemoryRequirements")) return vkGetDeviceImageSparseMemoryRequirements;
#endif // VULKANSC
// Instance extensions
void *addr;
if (debug_extensions_InstanceGpa(inst, funcName, &addr)) return addr;
if (wsi_swapchain_instance_gpa(inst, funcName, &addr)) return addr;
if (extension_instance_gpa(inst, funcName, &addr)) return addr;
// Unknown physical device extensions
addr = loader_phys_dev_ext_gpa_tramp(inst, funcName);
if (NULL != addr) return addr;
// Unknown device extensions
addr = loader_dev_ext_gpa_tramp(inst, funcName);
return addr;
}
void *globalGetProcAddr(const char *name) {
if (!name || name[0] != 'v' || name[1] != 'k') return NULL;
name += 2;
if (!strcmp(name, "CreateInstance")) return vkCreateInstance;
if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return vkEnumerateInstanceExtensionProperties;
if (!strcmp(name, "EnumerateInstanceLayerProperties")) return vkEnumerateInstanceLayerProperties;
if (!strcmp(name, "EnumerateInstanceVersion")) return vkEnumerateInstanceVersion;
return NULL;
}