Jon Ashburn | d55a394 | 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 | d3ef02f | 2015-07-06 14:36:13 -0600 | [diff] [blame] | 26 | #include "wsi_swapchain.h" |
Jon Ashburn | d55a394 | 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; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 40 | 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 Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 46 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 47 | return (void*) vkGetPhysicalDeviceProperties; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 48 | if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) |
| 49 | return (void*) vkGetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 50 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 51 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
Jon Ashburn | b0fbe91 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 52 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 53 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 54 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 55 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 56 | if (!strcmp(name, "CreateDevice")) |
| 57 | return (void*) vkCreateDevice; |
| 58 | if (!strcmp(name, "DestroyDevice")) |
| 59 | return (void*) vkDestroyDevice; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 60 | if (!strcmp(name, "GetGlobalExtensionProperties")) |
| 61 | return (void*) vkGetGlobalExtensionProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 62 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 63 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 64 | if (!strcmp(name, "GetGlobalLayerProperties")) |
| 65 | return (void*) vkGetGlobalLayerProperties; |
| 66 | if (!strcmp(name, "GetPhysicalDeviceLayerProperties")) |
| 67 | return (void*) vkGetPhysicalDeviceLayerProperties; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 68 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 80 | 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 Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 88 | if (!strcmp(name, "GetDeviceMemoryCommitment")) |
| 89 | return (void *) vkGetDeviceMemoryCommitment; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 90 | if (!strcmp(name, "BindBufferMemory")) |
| 91 | return (void*) vkBindBufferMemory; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 92 | 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 Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 98 | if (!strcmp(name, "GetImageSparseMemoryRequirements")) |
| 99 | return (void*) vkGetImageSparseMemoryRequirements; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 100 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 108 | if (!strcmp(name, "CreateFence")) |
| 109 | return (void*) vkCreateFence; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 110 | if (!strcmp(name, "DestroyFence")) |
| 111 | return (void*) vkDestroyFence; |
Jon Ashburn | d55a394 | 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 | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 120 | if (!strcmp(name, "DestroySemaphore")) |
| 121 | return (void*) vkDestroySemaphore; |
Jon Ashburn | d55a394 | 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 | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 128 | if (!strcmp(name, "DestroyEvent")) |
| 129 | return (void*) vkDestroyEvent; |
Jon Ashburn | d55a394 | 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 | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 138 | if (!strcmp(name, "DestroyQueryPool")) |
| 139 | return (void*) vkDestroyQueryPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 140 | if (!strcmp(name, "GetQueryPoolResults")) |
| 141 | return (void*) vkGetQueryPoolResults; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 142 | if (!strcmp(name, "CreateBuffer")) |
| 143 | return (void*) vkCreateBuffer; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 144 | if (!strcmp(name, "DestroyBuffer")) |
| 145 | return (void*) vkDestroyBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 146 | if (!strcmp(name, "CreateBufferView")) |
| 147 | return (void*) vkCreateBufferView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 148 | if (!strcmp(name, "DestroyBufferView")) |
| 149 | return (void*) vkDestroyBufferView; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 150 | if (!strcmp(name, "CreateImage")) |
| 151 | return (void*) vkCreateImage; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 152 | if (!strcmp(name, "DestroyImage")) |
| 153 | return (void*) vkDestroyImage; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 154 | if (!strcmp(name, "GetImageSubresourceLayout")) |
| 155 | return (void*) vkGetImageSubresourceLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 156 | if (!strcmp(name, "CreateImageView")) |
| 157 | return (void*) vkCreateImageView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 158 | if (!strcmp(name, "DestroyImageView")) |
| 159 | return (void*) vkDestroyImageView; |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 160 | if (!strcmp(name, "CreateShaderModule")) |
| 161 | return (void*) vkCreateShaderModule; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 162 | if (!strcmp(name, "DestroyShaderModule")) |
| 163 | return (void*) vkDestroyShaderModule; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 164 | if (!strcmp(name, "CreateShader")) |
| 165 | return (void*) vkCreateShader; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 166 | if (!strcmp(name, "DestroyShader")) |
| 167 | return (void*) vkDestroyShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 168 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 182 | if (!strcmp(name, "DestroyPipeline")) |
| 183 | return (void*) vkDestroyPipeline; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 184 | if (!strcmp(name, "CreatePipelineLayout")) |
| 185 | return (void*) vkCreatePipelineLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 186 | if (!strcmp(name, "DestroyPipelineLayout")) |
| 187 | return (void*) vkDestroyPipelineLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 188 | if (!strcmp(name, "CreateSampler")) |
| 189 | return (void*) vkCreateSampler; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 190 | if (!strcmp(name, "DestroySampler")) |
| 191 | return (void*) vkDestroySampler; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 192 | if (!strcmp(name, "CreateDescriptorSetLayout")) |
| 193 | return (void*) vkCreateDescriptorSetLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 194 | if (!strcmp(name, "DestroyDescriptorSetLayout")) |
| 195 | return (void*) vkDestroyDescriptorSetLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 196 | if (!strcmp(name, "CreateDescriptorPool")) |
| 197 | return (void*) vkCreateDescriptorPool; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 198 | if (!strcmp(name, "DestroyDescriptorPool")) |
| 199 | return (void*) vkDestroyDescriptorPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 200 | if (!strcmp(name, "ResetDescriptorPool")) |
| 201 | return (void*) vkResetDescriptorPool; |
| 202 | if (!strcmp(name, "AllocDescriptorSets")) |
| 203 | return (void*) vkAllocDescriptorSets; |
Tony Barbour | 34ec692 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 204 | if (!strcmp(name, "FreeDescriptorSets")) |
| 205 | return (void*) vkFreeDescriptorSets; |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 206 | if (!strcmp(name, "UpdateDescriptorSets")) |
| 207 | return (void*) vkUpdateDescriptorSets; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 208 | if (!strcmp(name, "CreateDynamicViewportState")) |
| 209 | return (void*) vkCreateDynamicViewportState; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 210 | if (!strcmp(name, "DestroyDynamicViewportState")) |
| 211 | return (void*) vkDestroyDynamicViewportState; |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 212 | 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 Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 228 | if (!strcmp(name, "CreateDynamicStencilState")) |
| 229 | return (void*) vkCreateDynamicStencilState; |
| 230 | if (!strcmp(name, "DestroyDynamicStencilState")) |
| 231 | return (void*) vkDestroyDynamicStencilState; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 232 | 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 Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 242 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 248 | if (!strcmp(name, "CreateCommandBuffer")) |
| 249 | return (void*) vkCreateCommandBuffer; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 250 | if (!strcmp(name, "DestroyCommandBuffer")) |
| 251 | return (void*) vkDestroyCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 252 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 260 | if (!strcmp(name, "CmdBindDynamicViewportState")) |
| 261 | return (void*) vkCmdBindDynamicViewportState; |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 262 | 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 Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 270 | if (!strcmp(name, "CmdBindDynamicStencilState")) |
| 271 | return (void*) vkCmdBindDynamicStencilState; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 272 | if (!strcmp(name, "CmdBindDescriptorSets")) |
| 273 | return (void*) vkCmdBindDescriptorSets; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 274 | if (!strcmp(name, "CmdBindIndexBuffer")) |
| 275 | return (void*) vkCmdBindIndexBuffer; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 276 | if (!strcmp(name, "CmdBindVertexBuffers")) |
| 277 | return (void*) vkCmdBindVertexBuffers; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 278 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 300 | 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 Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 306 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 312 | 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 Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 332 | if (!strcmp(name, "CmdPushConstants")) |
| 333 | return (void*) vkCmdPushConstants; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 334 | if (!strcmp(name, "CmdBeginRenderPass")) |
| 335 | return (void*) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 336 | if (!strcmp(name, "CmdNextSubpass")) |
| 337 | return (void*) vkCmdNextSubpass; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 338 | if (!strcmp(name, "CmdEndRenderPass")) |
| 339 | return (void*) vkCmdEndRenderPass; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 340 | if (!strcmp(name, "CmdExecuteCommands")) |
| 341 | return (void*) vkCmdExecuteCommands; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 342 | 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. */ |
| 349 | static 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 Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 361 | if (!strcmp(name, "GetPhysicalDeviceFeatures")) |
| 362 | return (void*) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 363 | if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) |
| 364 | return (void*) vkGetPhysicalDeviceFormatProperties; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 365 | if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties")) |
| 366 | return (void*) vkGetPhysicalDeviceImageFormatProperties; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 367 | if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) |
| 368 | return (void*) vkGetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 369 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 370 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
| 371 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 372 | return (void*) vkGetPhysicalDeviceProperties; |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 373 | if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) |
| 374 | return (void*) vkGetPhysicalDeviceSparseImageFormatProperties; |
Jon Ashburn | b0fbe91 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 375 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 376 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 377 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 378 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 379 | if (!strcmp(name, "CreateDevice")) |
| 380 | return (void*) vkCreateDevice; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 381 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 382 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 383 | if (!strcmp(name, "GetPhysicalDeviceLayerProperties")) |
| 384 | return (void*) vkGetPhysicalDeviceLayerProperties; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 385 | if (!strcmp(name, "GetDeviceQueue")) |
| 386 | return (void*) vkGetDeviceQueue; |
| 387 | if (!strcmp(name, "CreateCommandBuffer")) |
| 388 | return (void*) vkCreateCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 389 | |
| 390 | return NULL; |
| 391 | } |