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; |
| 46 | if (!strcmp(name, "GetPhysicalDeviceLimits")) |
| 47 | return (void*) vkGetPhysicalDeviceLimits; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 48 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 49 | return (void*) vkGetPhysicalDeviceProperties; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 50 | if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) |
| 51 | return (void*) vkGetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 52 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 53 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
Jon Ashburn | b0fbe91 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 54 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 55 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 56 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 57 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | d55a394 | 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 | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 62 | if (!strcmp(name, "GetGlobalExtensionProperties")) |
| 63 | return (void*) vkGetGlobalExtensionProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 64 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 65 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 110fdf9 | 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; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 70 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 82 | 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 Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 90 | if (!strcmp(name, "GetDeviceMemoryCommitment")) |
| 91 | return (void *) vkGetDeviceMemoryCommitment; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 92 | if (!strcmp(name, "BindBufferMemory")) |
| 93 | return (void*) vkBindBufferMemory; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 94 | 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 Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 100 | if (!strcmp(name, "GetImageSparseMemoryRequirements")) |
| 101 | return (void*) vkGetImageSparseMemoryRequirements; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 102 | 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 Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 110 | if (!strcmp(name, "CreateFence")) |
| 111 | return (void*) vkCreateFence; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 112 | if (!strcmp(name, "DestroyFence")) |
| 113 | return (void*) vkDestroyFence; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 114 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 122 | if (!strcmp(name, "DestroySemaphore")) |
| 123 | return (void*) vkDestroySemaphore; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 124 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 130 | if (!strcmp(name, "DestroyEvent")) |
| 131 | return (void*) vkDestroyEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 132 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 140 | if (!strcmp(name, "DestroyQueryPool")) |
| 141 | return (void*) vkDestroyQueryPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 142 | if (!strcmp(name, "GetQueryPoolResults")) |
| 143 | return (void*) vkGetQueryPoolResults; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 144 | if (!strcmp(name, "CreateBuffer")) |
| 145 | return (void*) vkCreateBuffer; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 146 | if (!strcmp(name, "DestroyBuffer")) |
| 147 | return (void*) vkDestroyBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 148 | if (!strcmp(name, "CreateBufferView")) |
| 149 | return (void*) vkCreateBufferView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 150 | if (!strcmp(name, "DestroyBufferView")) |
| 151 | return (void*) vkDestroyBufferView; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 152 | if (!strcmp(name, "CreateImage")) |
| 153 | return (void*) vkCreateImage; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 154 | if (!strcmp(name, "DestroyImage")) |
| 155 | return (void*) vkDestroyImage; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 156 | if (!strcmp(name, "GetImageSubresourceLayout")) |
| 157 | return (void*) vkGetImageSubresourceLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 158 | if (!strcmp(name, "CreateImageView")) |
| 159 | return (void*) vkCreateImageView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 160 | if (!strcmp(name, "DestroyImageView")) |
| 161 | return (void*) vkDestroyImageView; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 162 | if (!strcmp(name, "CreateAttachmentView")) |
| 163 | return (void*) vkCreateAttachmentView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 164 | if (!strcmp(name, "DestroyAttachmentView")) |
| 165 | return (void*) vkDestroyAttachmentView; |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 166 | if (!strcmp(name, "CreateShaderModule")) |
| 167 | return (void*) vkCreateShaderModule; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 168 | if (!strcmp(name, "DestroyShaderModule")) |
| 169 | return (void*) vkDestroyShaderModule; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 170 | if (!strcmp(name, "CreateShader")) |
| 171 | return (void*) vkCreateShader; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 172 | if (!strcmp(name, "DestroyShader")) |
| 173 | return (void*) vkDestroyShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 174 | 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 Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 188 | if (!strcmp(name, "DestroyPipeline")) |
| 189 | return (void*) vkDestroyPipeline; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 190 | if (!strcmp(name, "CreatePipelineLayout")) |
| 191 | return (void*) vkCreatePipelineLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 192 | if (!strcmp(name, "DestroyPipelineLayout")) |
| 193 | return (void*) vkDestroyPipelineLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 194 | if (!strcmp(name, "CreateSampler")) |
| 195 | return (void*) vkCreateSampler; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 196 | if (!strcmp(name, "DestroySampler")) |
| 197 | return (void*) vkDestroySampler; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 198 | if (!strcmp(name, "CreateDescriptorSetLayout")) |
| 199 | return (void*) vkCreateDescriptorSetLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 200 | if (!strcmp(name, "DestroyDescriptorSetLayout")) |
| 201 | return (void*) vkDestroyDescriptorSetLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 202 | if (!strcmp(name, "CreateDescriptorPool")) |
| 203 | return (void*) vkCreateDescriptorPool; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 204 | if (!strcmp(name, "DestroyDescriptorPool")) |
| 205 | return (void*) vkDestroyDescriptorPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 206 | if (!strcmp(name, "ResetDescriptorPool")) |
| 207 | return (void*) vkResetDescriptorPool; |
| 208 | if (!strcmp(name, "AllocDescriptorSets")) |
| 209 | return (void*) vkAllocDescriptorSets; |
Tony Barbour | 34ec692 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 210 | if (!strcmp(name, "FreeDescriptorSets")) |
| 211 | return (void*) vkFreeDescriptorSets; |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 212 | if (!strcmp(name, "UpdateDescriptorSets")) |
| 213 | return (void*) vkUpdateDescriptorSets; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 214 | if (!strcmp(name, "CreateDynamicViewportState")) |
| 215 | return (void*) vkCreateDynamicViewportState; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 216 | if (!strcmp(name, "DestroyDynamicViewportState")) |
| 217 | return (void*) vkDestroyDynamicViewportState; |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame^] | 218 | if (!strcmp(name, "CreateDynamicRasterLineState")) |
| 219 | return (void*) vkCreateDynamicRasterLineState; |
| 220 | if (!strcmp(name, "DestroyDynamicRasterLineState")) |
| 221 | return (void*) vkDestroyDynamicRasterLineState; |
| 222 | if (!strcmp(name, "CreateDynamicRasterDepthBiasState")) |
| 223 | return (void*) vkCreateDynamicRasterDepthBiasState; |
| 224 | if (!strcmp(name, "DestroyDynamicRasterDepthBiasState")) |
| 225 | return (void*) vkDestroyDynamicRasterDepthBiasState; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 226 | if (!strcmp(name, "CreateDynamicColorBlendState")) |
| 227 | return (void*) vkCreateDynamicColorBlendState; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 228 | if (!strcmp(name, "DestroyDynamicColorBlendState")) |
| 229 | return (void*) vkDestroyDynamicColorBlendState; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 230 | if (!strcmp(name, "CreateDynamicDepthStencilState")) |
| 231 | return (void*) vkCreateDynamicDepthStencilState; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 232 | if (!strcmp(name, "DestroyDynamicDepthStencilState")) |
| 233 | return (void*) vkDestroyDynamicDepthStencilState; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 234 | if (!strcmp(name, "CreateFramebuffer")) |
| 235 | return (void*) vkCreateFramebuffer; |
| 236 | if (!strcmp(name, "DestroyFramebuffer")) |
| 237 | return (void*) vkDestroyFramebuffer; |
| 238 | if (!strcmp(name, "CreateRenderPass")) |
| 239 | return (void*) vkCreateRenderPass; |
| 240 | if (!strcmp(name, "DestroyRenderPass")) |
| 241 | return (void*) vkDestroyRenderPass; |
| 242 | if (!strcmp(name, "GetRenderAreaGranularity")) |
| 243 | return (void*) vkGetRenderAreaGranularity; |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 244 | if (!strcmp(name, "CreateCommandPool")) |
| 245 | return (void*) vkCreateCommandPool; |
| 246 | if (!strcmp(name, "DestroyCommandPool")) |
| 247 | return (void*) vkDestroyCommandPool; |
| 248 | if (!strcmp(name, "ResetCommandPool")) |
| 249 | return (void*) vkResetCommandPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 250 | if (!strcmp(name, "CreateCommandBuffer")) |
| 251 | return (void*) vkCreateCommandBuffer; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 252 | if (!strcmp(name, "DestroyCommandBuffer")) |
| 253 | return (void*) vkDestroyCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 254 | if (!strcmp(name, "BeginCommandBuffer")) |
| 255 | return (void*) vkBeginCommandBuffer; |
| 256 | if (!strcmp(name, "EndCommandBuffer")) |
| 257 | return (void*) vkEndCommandBuffer; |
| 258 | if (!strcmp(name, "ResetCommandBuffer")) |
| 259 | return (void*) vkResetCommandBuffer; |
| 260 | if (!strcmp(name, "CmdBindPipeline")) |
| 261 | return (void*) vkCmdBindPipeline; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 262 | if (!strcmp(name, "CmdBindDynamicViewportState")) |
| 263 | return (void*) vkCmdBindDynamicViewportState; |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame^] | 264 | if (!strcmp(name, "CmdBindDynamicRasterLineState")) |
| 265 | return (void*) vkCmdBindDynamicRasterLineState; |
| 266 | if (!strcmp(name, "CmdBindDynamicRasterDepthBiasState")) |
| 267 | return (void*) vkCmdBindDynamicRasterDepthBiasState; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 268 | if (!strcmp(name, "CmdBindDynamicColorBlendState")) |
| 269 | return (void*) vkCmdBindDynamicColorBlendState; |
| 270 | if (!strcmp(name, "CmdBindDynamicDepthStencilState")) |
| 271 | return (void*) vkCmdBindDynamicDepthStencilState; |
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; |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 367 | if (!strcmp(name, "GetPhysicalDeviceLimits")) |
| 368 | return (void*) vkGetPhysicalDeviceLimits; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 369 | if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) |
| 370 | return (void*) vkGetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 371 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
| 372 | return (void*) vkGetPhysicalDeviceMemoryProperties; |
| 373 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
| 374 | return (void*) vkGetPhysicalDeviceProperties; |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 375 | if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) |
| 376 | return (void*) vkGetPhysicalDeviceSparseImageFormatProperties; |
Jon Ashburn | b0fbe91 | 2015-05-06 10:15:07 -0600 | [diff] [blame] | 377 | if (!strcmp(name, "GetInstanceProcAddr")) |
| 378 | return (void*) vkGetInstanceProcAddr; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 379 | if (!strcmp(name, "GetDeviceProcAddr")) |
| 380 | return (void*) vkGetDeviceProcAddr; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 381 | if (!strcmp(name, "CreateDevice")) |
| 382 | return (void*) vkCreateDevice; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 383 | if (!strcmp(name, "GetPhysicalDeviceExtensionProperties")) |
| 384 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 385 | if (!strcmp(name, "GetPhysicalDeviceLayerProperties")) |
| 386 | return (void*) vkGetPhysicalDeviceLayerProperties; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 387 | if (!strcmp(name, "GetDeviceQueue")) |
| 388 | return (void*) vkGetDeviceQueue; |
| 389 | if (!strcmp(name, "CreateCommandBuffer")) |
| 390 | return (void*) vkCreateCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 391 | |
| 392 | return NULL; |
| 393 | } |