Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1 | /* |
| 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 Elliott | 1d73e66 | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 26 | #include "wsi_swapchain.h" |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 27 | |
| 28 | static 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; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 40 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 41 | return (void*) vkGetPhysicalDeviceProperties; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 42 | if (!strcmp(name, "GetPhysicalDeviceQueueCount")) |
| 43 | return (void*) vkGetPhysicalDeviceQueueCount; |
| 44 | if (!strcmp(name, "GetPhysicalDeviceQueueProperties")) |
| 45 | return (void*) vkGetPhysicalDeviceQueueProperties; |
| 46 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 47 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
| 48 | if (!strcmp(name, "GetPhysicalDeviceFeatures")) |
| 49 | return (void*) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 4da96aa | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 50 | if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) |
| 51 | return (void*) vkGetPhysicalDeviceFormatProperties; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 52 | if (!strcmp(name, "GetPhysicalDeviceLimits")) |
| 53 | return (void*) vkGetPhysicalDeviceLimits; |
Jon Ashburn | 53c1677 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 54 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 55 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 1245cec | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 56 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 57 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 58 | if (!strcmp(name, "CreateDevice")) |
| 59 | return (void*) vkCreateDevice; |
| 60 | if (!strcmp(name, "DestroyDevice")) |
| 61 | return (void*) vkDestroyDevice; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 62 | if (!strcmp(name, "GetGlobalExtensionProperties")) |
| 63 | return (void*) vkGetGlobalExtensionProperties; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 64 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 65 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 66 | if (!strcmp(name, "GetGlobalLayerProperties")) |
| 67 | return (void*) vkGetGlobalLayerProperties; |
| 68 | if (!strcmp(name, "GetPhysicalDeviceLayerProperties")) |
| 69 | return (void*) vkGetPhysicalDeviceLayerProperties; |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 70 | if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) |
| 71 | return (void*) vkGetPhysicalDeviceSparseImageFormatProperties; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 72 | 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 Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 84 | 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; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 92 | if (!strcmp(name, "GetImageMemoryRequirements")) |
| 93 | return (void*) vkGetImageMemoryRequirements; |
| 94 | if (!strcmp(name, "GetBufferMemoryRequirements")) |
| 95 | return (void*) vkGetBufferMemoryRequirements; |
| 96 | if (!strcmp(name, "BindImageMemory")) |
| 97 | return (void*) vkBindImageMemory; |
| 98 | if (!strcmp(name, "BindBufferMemory")) |
| 99 | return (void*) vkBindBufferMemory; |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 100 | if (!strcmp(name, "QueueBindSparseBufferMemory")) |
| 101 | return (void*) vkQueueBindSparseBufferMemory; |
| 102 | if (!strcmp(name, "QueueBindSparseImageMemory")) |
| 103 | return (void*) vkQueueBindSparseImageMemory; |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 104 | if (!strcmp(name, "QueueBindSparseImageOpaqueMemory")) |
| 105 | return (void*) vkQueueBindSparseImageOpaqueMemory; |
| 106 | if (!strcmp(name, "GetImageSparseMemoryRequirements")) |
| 107 | return (void*) vkGetImageSparseMemoryRequirements; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 108 | if (!strcmp(name, "CreateFence")) |
| 109 | return (void*) vkCreateFence; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 110 | if (!strcmp(name, "DestroyFence")) |
| 111 | return (void*) vkDestroyFence; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 112 | 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 Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 120 | if (!strcmp(name, "DestroySemaphore")) |
| 121 | return (void*) vkDestroySemaphore; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 122 | 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 Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 128 | if (!strcmp(name, "DestroyEvent")) |
| 129 | return (void*) vkDestroyEvent; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 130 | 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 Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 138 | if (!strcmp(name, "DestroyQueryPool")) |
| 139 | return (void*) vkDestroyQueryPool; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 140 | if (!strcmp(name, "GetQueryPoolResults")) |
| 141 | return (void*) vkGetQueryPoolResults; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 142 | if (!strcmp(name, "CreateBuffer")) |
| 143 | return (void*) vkCreateBuffer; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 144 | if (!strcmp(name, "DestroyBuffer")) |
| 145 | return (void*) vkDestroyBuffer; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 146 | if (!strcmp(name, "CreateBufferView")) |
| 147 | return (void*) vkCreateBufferView; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 148 | if (!strcmp(name, "DestroyBufferView")) |
| 149 | return (void*) vkDestroyBufferView; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 150 | if (!strcmp(name, "CreateImage")) |
| 151 | return (void*) vkCreateImage; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 152 | if (!strcmp(name, "DestroyImage")) |
| 153 | return (void*) vkDestroyImage; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 154 | if (!strcmp(name, "GetImageSubresourceLayout")) |
| 155 | return (void*) vkGetImageSubresourceLayout; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 156 | if (!strcmp(name, "CreateImageView")) |
| 157 | return (void*) vkCreateImageView; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 158 | if (!strcmp(name, "DestroyImageView")) |
| 159 | return (void*) vkDestroyImageView; |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 160 | if (!strcmp(name, "CreateAttachmentView")) |
| 161 | return (void*) vkCreateAttachmentView; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 162 | if (!strcmp(name, "DestroyAttachmentView")) |
| 163 | return (void*) vkDestroyAttachmentView; |
Courtney Goeltzenleuchter | 0b29b0d | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 164 | if (!strcmp(name, "CreateShaderModule")) |
| 165 | return (void*) vkCreateShaderModule; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 166 | if (!strcmp(name, "DestroyShaderModule")) |
| 167 | return (void*) vkDestroyShaderModule; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 168 | if (!strcmp(name, "CreateShader")) |
| 169 | return (void*) vkCreateShader; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 170 | if (!strcmp(name, "DestroyShader")) |
| 171 | return (void*) vkDestroyShader; |
Jon Ashburn | 0d60d27 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 172 | if (!strcmp(name, "CreatePipelineCache")) |
| 173 | return (void*) vkCreatePipelineCache; |
| 174 | if (!strcmp(name, "DestroyPipelineCache")) |
| 175 | return (void*) vkDestroyPipelineCache; |
| 176 | if (!strcmp(name, "GetPipelineCacheSize")) |
| 177 | return (void*) vkGetPipelineCacheSize; |
| 178 | if (!strcmp(name, "GetPipelineCacheData")) |
| 179 | return (void*) vkGetPipelineCacheData; |
| 180 | if (!strcmp(name, "MergePipelineCaches")) |
| 181 | return (void*) vkMergePipelineCaches; |
| 182 | if (!strcmp(name, "CreateGraphicsPipelines")) |
| 183 | return (void*) vkCreateGraphicsPipelines; |
| 184 | if (!strcmp(name, "CreateComputePipelines")) |
| 185 | return (void*) vkCreateComputePipelines; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 186 | if (!strcmp(name, "DestroyPipeline")) |
| 187 | return (void*) vkDestroyPipeline; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 188 | if (!strcmp(name, "CreatePipelineLayout")) |
| 189 | return (void*) vkCreatePipelineLayout; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 190 | if (!strcmp(name, "DestroyPipelineLayout")) |
| 191 | return (void*) vkDestroyPipelineLayout; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 192 | if (!strcmp(name, "CreateSampler")) |
| 193 | return (void*) vkCreateSampler; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 194 | if (!strcmp(name, "DestroySampler")) |
| 195 | return (void*) vkDestroySampler; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 196 | if (!strcmp(name, "CreateDescriptorSetLayout")) |
| 197 | return (void*) vkCreateDescriptorSetLayout; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 198 | if (!strcmp(name, "DestroyDescriptorSetLayout")) |
| 199 | return (void*) vkDestroyDescriptorSetLayout; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 200 | if (!strcmp(name, "CreateDescriptorPool")) |
| 201 | return (void*) vkCreateDescriptorPool; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 202 | if (!strcmp(name, "DestroyDescriptorPool")) |
| 203 | return (void*) vkDestroyDescriptorPool; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 204 | if (!strcmp(name, "ResetDescriptorPool")) |
| 205 | return (void*) vkResetDescriptorPool; |
| 206 | if (!strcmp(name, "AllocDescriptorSets")) |
| 207 | return (void*) vkAllocDescriptorSets; |
Tony Barbour | b857d31 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 208 | if (!strcmp(name, "FreeDescriptorSets")) |
| 209 | return (void*) vkFreeDescriptorSets; |
Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 210 | if (!strcmp(name, "UpdateDescriptorSets")) |
| 211 | return (void*) vkUpdateDescriptorSets; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 212 | if (!strcmp(name, "CreateDynamicViewportState")) |
| 213 | return (void*) vkCreateDynamicViewportState; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 214 | if (!strcmp(name, "DestroyDynamicViewportState")) |
| 215 | return (void*) vkDestroyDynamicViewportState; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 216 | if (!strcmp(name, "CreateDynamicRasterState")) |
| 217 | return (void*) vkCreateDynamicRasterState; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 218 | if (!strcmp(name, "DestroyDynamicRasterState")) |
| 219 | return (void*) vkDestroyDynamicRasterState; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 220 | if (!strcmp(name, "CreateDynamicColorBlendState")) |
| 221 | return (void*) vkCreateDynamicColorBlendState; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 222 | if (!strcmp(name, "DestroyDynamicColorBlendState")) |
| 223 | return (void*) vkDestroyDynamicColorBlendState; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 224 | if (!strcmp(name, "CreateDynamicDepthStencilState")) |
| 225 | return (void*) vkCreateDynamicDepthStencilState; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 226 | if (!strcmp(name, "DestroyDynamicDepthStencilState")) |
| 227 | return (void*) vkDestroyDynamicDepthStencilState; |
Cody Northrop | f02f9f8 | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 228 | if (!strcmp(name, "CreateCommandPool")) |
| 229 | return (void*) vkCreateCommandPool; |
| 230 | if (!strcmp(name, "DestroyCommandPool")) |
| 231 | return (void*) vkDestroyCommandPool; |
| 232 | if (!strcmp(name, "ResetCommandPool")) |
| 233 | return (void*) vkResetCommandPool; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 234 | if (!strcmp(name, "CreateCommandBuffer")) |
| 235 | return (void*) vkCreateCommandBuffer; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 236 | if (!strcmp(name, "DestroyCommandBuffer")) |
| 237 | return (void*) vkDestroyCommandBuffer; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 238 | if (!strcmp(name, "BeginCommandBuffer")) |
| 239 | return (void*) vkBeginCommandBuffer; |
| 240 | if (!strcmp(name, "EndCommandBuffer")) |
| 241 | return (void*) vkEndCommandBuffer; |
| 242 | if (!strcmp(name, "ResetCommandBuffer")) |
| 243 | return (void*) vkResetCommandBuffer; |
| 244 | if (!strcmp(name, "CmdBindPipeline")) |
| 245 | return (void*) vkCmdBindPipeline; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 246 | if (!strcmp(name, "CmdBindDynamicViewportState")) |
| 247 | return (void*) vkCmdBindDynamicViewportState; |
| 248 | if (!strcmp(name, "CmdBindDynamicRasterState")) |
| 249 | return (void*) vkCmdBindDynamicRasterState; |
| 250 | if (!strcmp(name, "CmdBindDynamicColorBlendState")) |
| 251 | return (void*) vkCmdBindDynamicColorBlendState; |
| 252 | if (!strcmp(name, "CmdBindDynamicDepthStencilState")) |
| 253 | return (void*) vkCmdBindDynamicDepthStencilState; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 254 | if (!strcmp(name, "CmdBindDescriptorSets")) |
| 255 | return (void*) vkCmdBindDescriptorSets; |
| 256 | if (!strcmp(name, "CmdBindVertexBuffers")) |
| 257 | return (void*) vkCmdBindVertexBuffers; |
| 258 | if (!strcmp(name, "CmdBindIndexBuffer")) |
| 259 | return (void*) vkCmdBindIndexBuffer; |
| 260 | if (!strcmp(name, "CmdDraw")) |
| 261 | return (void*) vkCmdDraw; |
| 262 | if (!strcmp(name, "CmdDrawIndexed")) |
| 263 | return (void*) vkCmdDrawIndexed; |
| 264 | if (!strcmp(name, "CmdDrawIndirect")) |
| 265 | return (void*) vkCmdDrawIndirect; |
| 266 | if (!strcmp(name, "CmdDrawIndexedIndirect")) |
| 267 | return (void*) vkCmdDrawIndexedIndirect; |
| 268 | if (!strcmp(name, "CmdDispatch")) |
| 269 | return (void*) vkCmdDispatch; |
| 270 | if (!strcmp(name, "CmdDispatchIndirect")) |
| 271 | return (void*) vkCmdDispatchIndirect; |
| 272 | if (!strcmp(name, "CmdCopyBuffer")) |
| 273 | return (void*) vkCmdCopyBuffer; |
| 274 | if (!strcmp(name, "CmdCopyImage")) |
| 275 | return (void*) vkCmdCopyImage; |
| 276 | if (!strcmp(name, "CmdBlitImage")) |
| 277 | return (void*) vkCmdBlitImage; |
| 278 | if (!strcmp(name, "CmdCopyBufferToImage")) |
| 279 | return (void*) vkCmdCopyBufferToImage; |
| 280 | if (!strcmp(name, "CmdCopyImageToBuffer")) |
| 281 | return (void*) vkCmdCopyImageToBuffer; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 282 | if (!strcmp(name, "CmdUpdateBuffer")) |
| 283 | return (void*) vkCmdUpdateBuffer; |
| 284 | if (!strcmp(name, "CmdFillBuffer")) |
| 285 | return (void*) vkCmdFillBuffer; |
| 286 | if (!strcmp(name, "CmdClearColorImage")) |
| 287 | return (void*) vkCmdClearColorImage; |
Chris Forbes | 2951d7d | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 288 | if (!strcmp(name, "CmdClearDepthStencilImage")) |
| 289 | return (void*) vkCmdClearDepthStencilImage; |
| 290 | if (!strcmp(name, "CmdClearColorAttachment")) |
| 291 | return (void*) vkCmdClearColorAttachment; |
| 292 | if (!strcmp(name, "CmdClearDepthStencilAttachment")) |
| 293 | return (void*) vkCmdClearDepthStencilAttachment; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 294 | if (!strcmp(name, "CmdResolveImage")) |
| 295 | return (void*) vkCmdResolveImage; |
| 296 | if (!strcmp(name, "CmdSetEvent")) |
| 297 | return (void*) vkCmdSetEvent; |
| 298 | if (!strcmp(name, "CmdResetEvent")) |
| 299 | return (void*) vkCmdResetEvent; |
| 300 | if (!strcmp(name, "CmdWaitEvents")) |
| 301 | return (void*) vkCmdWaitEvents; |
| 302 | if (!strcmp(name, "CmdPipelineBarrier")) |
| 303 | return (void*) vkCmdPipelineBarrier; |
| 304 | if (!strcmp(name, "CmdBeginQuery")) |
| 305 | return (void*) vkCmdBeginQuery; |
| 306 | if (!strcmp(name, "CmdEndQuery")) |
| 307 | return (void*) vkCmdEndQuery; |
| 308 | if (!strcmp(name, "CmdResetQueryPool")) |
| 309 | return (void*) vkCmdResetQueryPool; |
| 310 | if (!strcmp(name, "CmdWriteTimestamp")) |
| 311 | return (void*) vkCmdWriteTimestamp; |
| 312 | if (!strcmp(name, "CmdCopyQueryPoolResults")) |
| 313 | return (void*) vkCmdCopyQueryPoolResults; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 314 | if (!strcmp(name, "CreateFramebuffer")) |
| 315 | return (void*) vkCreateFramebuffer; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 316 | if (!strcmp(name, "DestroyFramebuffer")) |
| 317 | return (void*) vkDestroyFramebuffer; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 318 | if (!strcmp(name, "CreateRenderPass")) |
| 319 | return (void*) vkCreateRenderPass; |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 320 | if (!strcmp(name, "DestroyRenderPass")) |
| 321 | return (void*) vkDestroyRenderPass; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 322 | if (!strcmp(name, "CmdBeginRenderPass")) |
| 323 | return (void*) vkCmdBeginRenderPass; |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 324 | if (!strcmp(name, "CmdNextSubpass")) |
| 325 | return (void*) vkCmdNextSubpass; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 326 | if (!strcmp(name, "CmdEndRenderPass")) |
| 327 | return (void*) vkCmdEndRenderPass; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 328 | |
| 329 | return NULL; |
| 330 | } |
| 331 | |
| 332 | /* These functions require special handling by the loader. |
| 333 | * They are not just generic trampoline code entrypoints. |
| 334 | * Thus GPA must return loader entrypoint for these instead of first function |
| 335 | * in the chain. */ |
| 336 | static inline void *loader_non_passthrough_gpa(const char *name) |
| 337 | { |
| 338 | if (!name || name[0] != 'v' || name[1] != 'k') |
| 339 | return NULL; |
| 340 | |
| 341 | name += 2; |
| 342 | if (!strcmp(name, "CreateInstance")) |
| 343 | return (void*) vkCreateInstance; |
| 344 | if (!strcmp(name, "DestroyInstance")) |
| 345 | return (void*) vkDestroyInstance; |
| 346 | if (!strcmp(name, "EnumeratePhysicalDevices")) |
| 347 | return (void*) vkEnumeratePhysicalDevices; |
Chris Forbes | d757630 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 348 | if (!strcmp(name, "GetPhysicalDeviceFeatures")) |
| 349 | return (void*) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 4da96aa | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 350 | if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) |
| 351 | return (void*) vkGetPhysicalDeviceFormatProperties; |
Chris Forbes | d757630 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 352 | if (!strcmp(name, "GetPhysicalDeviceLimits")) |
| 353 | return (void*) vkGetPhysicalDeviceLimits; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 354 | if (!strcmp(name, "GetPhysicalDeviceQueueCount")) |
| 355 | return (void*) vkGetPhysicalDeviceQueueCount; |
| 356 | if (!strcmp(name, "GetPhysicalDeviceQueueProperties")) |
| 357 | return (void*) vkGetPhysicalDeviceQueueProperties; |
| 358 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 359 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
| 360 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 361 | return (void*) vkGetPhysicalDeviceProperties; |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 362 | if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) |
| 363 | return (void*) vkGetPhysicalDeviceSparseImageFormatProperties; |
Jon Ashburn | 53c1677 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 364 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 365 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 1245cec | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 366 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 367 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 368 | if (!strcmp(name, "CreateDevice")) |
| 369 | return (void*) vkCreateDevice; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 370 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 371 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 372 | if (!strcmp(name, "GetDeviceQueue")) |
| 373 | return (void*) vkGetDeviceQueue; |
| 374 | if (!strcmp(name, "CreateCommandBuffer")) |
| 375 | return (void*) vkCreateCommandBuffer; |
Jon Ashburn | 2139a3e | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 376 | |
| 377 | return NULL; |
| 378 | } |