Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 1 | /* |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 2 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 3 | * Copyright (c) 2015-2016 The Khronos Group Inc. |
| 4 | * Copyright (c) 2015-2016 Valve Corporation |
| 5 | * Copyright (c) 2015-2016 LunarG, Inc. |
| 6 | * Copyright (C) 2016 Google Inc. |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 7 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | * of this software and/or associated documentation files (the "Materials"), to |
| 10 | * deal in the Materials without restriction, including without limitation the |
| 11 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 12 | * sell copies of the Materials, and to permit persons to whom the Materials are |
| 13 | * furnished to do so, subject to the following conditions: |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 14 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 15 | * The above copyright notice(s) and this permission notice shall be included in |
| 16 | * all copies or substantial portions of the Materials. |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 17 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 18 | * The Materials are Confidential Information as defined by the Khronos |
| 19 | * Membership Agreement until designated non-confidential by Khronos, at which |
| 20 | * point this condition clause shall be removed. |
| 21 | * |
| 22 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 25 | * |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 26 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 27 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 28 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 29 | * USE OR OTHER DEALINGS IN THE MATERIALS. |
| 30 | * |
| 31 | * Author: Courtney Goeltzenleuchter <courtney@lunarg.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 32 | * Author: Jon Ashburn <jon@lunarg.com> |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 33 | * Author: Ian Elliott <ian@LunarG.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 34 | * Author: Tony Barbour <tony@LunarG.com> |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 35 | */ |
| 36 | |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 37 | #include <vulkan/vulkan.h> |
| 38 | #include <vulkan/vk_layer.h> |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 39 | #include <string.h> |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 40 | #include "loader.h" |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 41 | #include "vk_loader_platform.h" |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 42 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 43 | static VkResult vkDevExtError(VkDevice dev) { |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 44 | return VK_ERROR_INITIALIZATION_FAILED; |
| 45 | } |
| 46 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 47 | static inline void |
| 48 | loader_init_device_dispatch_table(struct loader_dev_dispatch_table *dev_table, |
| 49 | PFN_vkGetDeviceProcAddr gpa, VkDevice dev) { |
Jon Ashburn | fc1031e | 2015-11-17 15:31:02 -0700 | [diff] [blame] | 50 | VkLayerDispatchTable *table = &dev_table->core_dispatch; |
| 51 | for (uint32_t i = 0; i < MAX_NUM_DEV_EXTS; i++) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 52 | dev_table->ext_dispatch.DevExt[i] = (PFN_vkDevExt)vkDevExtError; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 53 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 54 | table->GetDeviceProcAddr = |
| 55 | (PFN_vkGetDeviceProcAddr)gpa(dev, "vkGetDeviceProcAddr"); |
| 56 | table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice"); |
| 57 | table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue"); |
| 58 | table->QueueSubmit = (PFN_vkQueueSubmit)gpa(dev, "vkQueueSubmit"); |
| 59 | table->QueueWaitIdle = (PFN_vkQueueWaitIdle)gpa(dev, "vkQueueWaitIdle"); |
| 60 | table->DeviceWaitIdle = (PFN_vkDeviceWaitIdle)gpa(dev, "vkDeviceWaitIdle"); |
| 61 | table->AllocateMemory = (PFN_vkAllocateMemory)gpa(dev, "vkAllocateMemory"); |
| 62 | table->FreeMemory = (PFN_vkFreeMemory)gpa(dev, "vkFreeMemory"); |
| 63 | table->MapMemory = (PFN_vkMapMemory)gpa(dev, "vkMapMemory"); |
| 64 | table->UnmapMemory = (PFN_vkUnmapMemory)gpa(dev, "vkUnmapMemory"); |
| 65 | table->FlushMappedMemoryRanges = |
| 66 | (PFN_vkFlushMappedMemoryRanges)gpa(dev, "vkFlushMappedMemoryRanges"); |
| 67 | table->InvalidateMappedMemoryRanges = |
| 68 | (PFN_vkInvalidateMappedMemoryRanges)gpa( |
| 69 | dev, "vkInvalidateMappedMemoryRanges"); |
| 70 | table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)gpa( |
| 71 | dev, "vkGetDeviceMemoryCommitment"); |
| 72 | table->GetImageSparseMemoryRequirements = |
| 73 | (PFN_vkGetImageSparseMemoryRequirements)gpa( |
| 74 | dev, "vkGetImageSparseMemoryRequirements"); |
| 75 | table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)gpa( |
| 76 | dev, "vkGetBufferMemoryRequirements"); |
| 77 | table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)gpa( |
| 78 | dev, "vkGetImageMemoryRequirements"); |
| 79 | table->BindBufferMemory = |
| 80 | (PFN_vkBindBufferMemory)gpa(dev, "vkBindBufferMemory"); |
| 81 | table->BindImageMemory = |
| 82 | (PFN_vkBindImageMemory)gpa(dev, "vkBindImageMemory"); |
| 83 | table->QueueBindSparse = |
| 84 | (PFN_vkQueueBindSparse)gpa(dev, "vkQueueBindSparse"); |
| 85 | table->CreateFence = (PFN_vkCreateFence)gpa(dev, "vkCreateFence"); |
| 86 | table->DestroyFence = (PFN_vkDestroyFence)gpa(dev, "vkDestroyFence"); |
| 87 | table->ResetFences = (PFN_vkResetFences)gpa(dev, "vkResetFences"); |
| 88 | table->GetFenceStatus = (PFN_vkGetFenceStatus)gpa(dev, "vkGetFenceStatus"); |
| 89 | table->WaitForFences = (PFN_vkWaitForFences)gpa(dev, "vkWaitForFences"); |
| 90 | table->CreateSemaphore = |
| 91 | (PFN_vkCreateSemaphore)gpa(dev, "vkCreateSemaphore"); |
| 92 | table->DestroySemaphore = |
| 93 | (PFN_vkDestroySemaphore)gpa(dev, "vkDestroySemaphore"); |
| 94 | table->CreateEvent = (PFN_vkCreateEvent)gpa(dev, "vkCreateEvent"); |
| 95 | table->DestroyEvent = (PFN_vkDestroyEvent)gpa(dev, "vkDestroyEvent"); |
| 96 | table->GetEventStatus = (PFN_vkGetEventStatus)gpa(dev, "vkGetEventStatus"); |
| 97 | table->SetEvent = (PFN_vkSetEvent)gpa(dev, "vkSetEvent"); |
| 98 | table->ResetEvent = (PFN_vkResetEvent)gpa(dev, "vkResetEvent"); |
| 99 | table->CreateQueryPool = |
| 100 | (PFN_vkCreateQueryPool)gpa(dev, "vkCreateQueryPool"); |
| 101 | table->DestroyQueryPool = |
| 102 | (PFN_vkDestroyQueryPool)gpa(dev, "vkDestroyQueryPool"); |
| 103 | table->GetQueryPoolResults = |
| 104 | (PFN_vkGetQueryPoolResults)gpa(dev, "vkGetQueryPoolResults"); |
| 105 | table->CreateBuffer = (PFN_vkCreateBuffer)gpa(dev, "vkCreateBuffer"); |
| 106 | table->DestroyBuffer = (PFN_vkDestroyBuffer)gpa(dev, "vkDestroyBuffer"); |
| 107 | table->CreateBufferView = |
| 108 | (PFN_vkCreateBufferView)gpa(dev, "vkCreateBufferView"); |
| 109 | table->DestroyBufferView = |
| 110 | (PFN_vkDestroyBufferView)gpa(dev, "vkDestroyBufferView"); |
| 111 | table->CreateImage = (PFN_vkCreateImage)gpa(dev, "vkCreateImage"); |
| 112 | table->DestroyImage = (PFN_vkDestroyImage)gpa(dev, "vkDestroyImage"); |
| 113 | table->GetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)gpa( |
| 114 | dev, "vkGetImageSubresourceLayout"); |
| 115 | table->CreateImageView = |
| 116 | (PFN_vkCreateImageView)gpa(dev, "vkCreateImageView"); |
| 117 | table->DestroyImageView = |
| 118 | (PFN_vkDestroyImageView)gpa(dev, "vkDestroyImageView"); |
| 119 | table->CreateShaderModule = |
| 120 | (PFN_vkCreateShaderModule)gpa(dev, "vkCreateShaderModule"); |
| 121 | table->DestroyShaderModule = |
| 122 | (PFN_vkDestroyShaderModule)gpa(dev, "vkDestroyShaderModule"); |
| 123 | table->CreatePipelineCache = |
| 124 | (PFN_vkCreatePipelineCache)gpa(dev, "vkCreatePipelineCache"); |
| 125 | table->DestroyPipelineCache = |
| 126 | (PFN_vkDestroyPipelineCache)gpa(dev, "vkDestroyPipelineCache"); |
| 127 | table->GetPipelineCacheData = |
| 128 | (PFN_vkGetPipelineCacheData)gpa(dev, "vkGetPipelineCacheData"); |
| 129 | table->MergePipelineCaches = |
| 130 | (PFN_vkMergePipelineCaches)gpa(dev, "vkMergePipelineCaches"); |
| 131 | table->CreateGraphicsPipelines = |
| 132 | (PFN_vkCreateGraphicsPipelines)gpa(dev, "vkCreateGraphicsPipelines"); |
| 133 | table->CreateComputePipelines = |
| 134 | (PFN_vkCreateComputePipelines)gpa(dev, "vkCreateComputePipelines"); |
| 135 | table->DestroyPipeline = |
| 136 | (PFN_vkDestroyPipeline)gpa(dev, "vkDestroyPipeline"); |
| 137 | table->CreatePipelineLayout = |
| 138 | (PFN_vkCreatePipelineLayout)gpa(dev, "vkCreatePipelineLayout"); |
| 139 | table->DestroyPipelineLayout = |
| 140 | (PFN_vkDestroyPipelineLayout)gpa(dev, "vkDestroyPipelineLayout"); |
| 141 | table->CreateSampler = (PFN_vkCreateSampler)gpa(dev, "vkCreateSampler"); |
| 142 | table->DestroySampler = (PFN_vkDestroySampler)gpa(dev, "vkDestroySampler"); |
| 143 | table->CreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)gpa( |
| 144 | dev, "vkCreateDescriptorSetLayout"); |
| 145 | table->DestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)gpa( |
| 146 | dev, "vkDestroyDescriptorSetLayout"); |
| 147 | table->CreateDescriptorPool = |
| 148 | (PFN_vkCreateDescriptorPool)gpa(dev, "vkCreateDescriptorPool"); |
| 149 | table->DestroyDescriptorPool = |
| 150 | (PFN_vkDestroyDescriptorPool)gpa(dev, "vkDestroyDescriptorPool"); |
| 151 | table->ResetDescriptorPool = |
| 152 | (PFN_vkResetDescriptorPool)gpa(dev, "vkResetDescriptorPool"); |
| 153 | table->AllocateDescriptorSets = |
| 154 | (PFN_vkAllocateDescriptorSets)gpa(dev, "vkAllocateDescriptorSets"); |
| 155 | table->FreeDescriptorSets = |
| 156 | (PFN_vkFreeDescriptorSets)gpa(dev, "vkFreeDescriptorSets"); |
| 157 | table->UpdateDescriptorSets = |
| 158 | (PFN_vkUpdateDescriptorSets)gpa(dev, "vkUpdateDescriptorSets"); |
| 159 | table->CreateFramebuffer = |
| 160 | (PFN_vkCreateFramebuffer)gpa(dev, "vkCreateFramebuffer"); |
| 161 | table->DestroyFramebuffer = |
| 162 | (PFN_vkDestroyFramebuffer)gpa(dev, "vkDestroyFramebuffer"); |
| 163 | table->CreateRenderPass = |
| 164 | (PFN_vkCreateRenderPass)gpa(dev, "vkCreateRenderPass"); |
| 165 | table->DestroyRenderPass = |
| 166 | (PFN_vkDestroyRenderPass)gpa(dev, "vkDestroyRenderPass"); |
| 167 | table->GetRenderAreaGranularity = |
| 168 | (PFN_vkGetRenderAreaGranularity)gpa(dev, "vkGetRenderAreaGranularity"); |
| 169 | table->CreateCommandPool = |
| 170 | (PFN_vkCreateCommandPool)gpa(dev, "vkCreateCommandPool"); |
| 171 | table->DestroyCommandPool = |
| 172 | (PFN_vkDestroyCommandPool)gpa(dev, "vkDestroyCommandPool"); |
| 173 | table->ResetCommandPool = |
| 174 | (PFN_vkResetCommandPool)gpa(dev, "vkResetCommandPool"); |
| 175 | table->AllocateCommandBuffers = |
| 176 | (PFN_vkAllocateCommandBuffers)gpa(dev, "vkAllocateCommandBuffers"); |
| 177 | table->FreeCommandBuffers = |
| 178 | (PFN_vkFreeCommandBuffers)gpa(dev, "vkFreeCommandBuffers"); |
| 179 | table->BeginCommandBuffer = |
| 180 | (PFN_vkBeginCommandBuffer)gpa(dev, "vkBeginCommandBuffer"); |
| 181 | table->EndCommandBuffer = |
| 182 | (PFN_vkEndCommandBuffer)gpa(dev, "vkEndCommandBuffer"); |
| 183 | table->ResetCommandBuffer = |
| 184 | (PFN_vkResetCommandBuffer)gpa(dev, "vkResetCommandBuffer"); |
| 185 | table->CmdBindPipeline = |
| 186 | (PFN_vkCmdBindPipeline)gpa(dev, "vkCmdBindPipeline"); |
| 187 | table->CmdSetViewport = (PFN_vkCmdSetViewport)gpa(dev, "vkCmdSetViewport"); |
| 188 | table->CmdSetScissor = (PFN_vkCmdSetScissor)gpa(dev, "vkCmdSetScissor"); |
| 189 | table->CmdSetLineWidth = |
| 190 | (PFN_vkCmdSetLineWidth)gpa(dev, "vkCmdSetLineWidth"); |
| 191 | table->CmdSetDepthBias = |
| 192 | (PFN_vkCmdSetDepthBias)gpa(dev, "vkCmdSetDepthBias"); |
| 193 | table->CmdSetBlendConstants = |
| 194 | (PFN_vkCmdSetBlendConstants)gpa(dev, "vkCmdSetBlendConstants"); |
| 195 | table->CmdSetDepthBounds = |
| 196 | (PFN_vkCmdSetDepthBounds)gpa(dev, "vkCmdSetDepthBounds"); |
| 197 | table->CmdSetStencilCompareMask = |
| 198 | (PFN_vkCmdSetStencilCompareMask)gpa(dev, "vkCmdSetStencilCompareMask"); |
| 199 | table->CmdSetStencilWriteMask = |
| 200 | (PFN_vkCmdSetStencilWriteMask)gpa(dev, "vkCmdSetStencilWriteMask"); |
| 201 | table->CmdSetStencilReference = |
| 202 | (PFN_vkCmdSetStencilReference)gpa(dev, "vkCmdSetStencilReference"); |
| 203 | table->CmdBindDescriptorSets = |
| 204 | (PFN_vkCmdBindDescriptorSets)gpa(dev, "vkCmdBindDescriptorSets"); |
| 205 | table->CmdBindVertexBuffers = |
| 206 | (PFN_vkCmdBindVertexBuffers)gpa(dev, "vkCmdBindVertexBuffers"); |
| 207 | table->CmdBindIndexBuffer = |
| 208 | (PFN_vkCmdBindIndexBuffer)gpa(dev, "vkCmdBindIndexBuffer"); |
| 209 | table->CmdDraw = (PFN_vkCmdDraw)gpa(dev, "vkCmdDraw"); |
| 210 | table->CmdDrawIndexed = (PFN_vkCmdDrawIndexed)gpa(dev, "vkCmdDrawIndexed"); |
| 211 | table->CmdDrawIndirect = |
| 212 | (PFN_vkCmdDrawIndirect)gpa(dev, "vkCmdDrawIndirect"); |
| 213 | table->CmdDrawIndexedIndirect = |
| 214 | (PFN_vkCmdDrawIndexedIndirect)gpa(dev, "vkCmdDrawIndexedIndirect"); |
| 215 | table->CmdDispatch = (PFN_vkCmdDispatch)gpa(dev, "vkCmdDispatch"); |
| 216 | table->CmdDispatchIndirect = |
| 217 | (PFN_vkCmdDispatchIndirect)gpa(dev, "vkCmdDispatchIndirect"); |
| 218 | table->CmdCopyBuffer = (PFN_vkCmdCopyBuffer)gpa(dev, "vkCmdCopyBuffer"); |
| 219 | table->CmdCopyImage = (PFN_vkCmdCopyImage)gpa(dev, "vkCmdCopyImage"); |
| 220 | table->CmdBlitImage = (PFN_vkCmdBlitImage)gpa(dev, "vkCmdBlitImage"); |
| 221 | table->CmdCopyBufferToImage = |
| 222 | (PFN_vkCmdCopyBufferToImage)gpa(dev, "vkCmdCopyBufferToImage"); |
| 223 | table->CmdCopyImageToBuffer = |
| 224 | (PFN_vkCmdCopyImageToBuffer)gpa(dev, "vkCmdCopyImageToBuffer"); |
| 225 | table->CmdUpdateBuffer = |
| 226 | (PFN_vkCmdUpdateBuffer)gpa(dev, "vkCmdUpdateBuffer"); |
| 227 | table->CmdFillBuffer = (PFN_vkCmdFillBuffer)gpa(dev, "vkCmdFillBuffer"); |
| 228 | table->CmdClearColorImage = |
| 229 | (PFN_vkCmdClearColorImage)gpa(dev, "vkCmdClearColorImage"); |
| 230 | table->CmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)gpa( |
| 231 | dev, "vkCmdClearDepthStencilImage"); |
| 232 | table->CmdClearAttachments = |
| 233 | (PFN_vkCmdClearAttachments)gpa(dev, "vkCmdClearAttachments"); |
| 234 | table->CmdResolveImage = |
| 235 | (PFN_vkCmdResolveImage)gpa(dev, "vkCmdResolveImage"); |
| 236 | table->CmdSetEvent = (PFN_vkCmdSetEvent)gpa(dev, "vkCmdSetEvent"); |
| 237 | table->CmdResetEvent = (PFN_vkCmdResetEvent)gpa(dev, "vkCmdResetEvent"); |
| 238 | table->CmdWaitEvents = (PFN_vkCmdWaitEvents)gpa(dev, "vkCmdWaitEvents"); |
| 239 | table->CmdPipelineBarrier = |
| 240 | (PFN_vkCmdPipelineBarrier)gpa(dev, "vkCmdPipelineBarrier"); |
| 241 | table->CmdBeginQuery = (PFN_vkCmdBeginQuery)gpa(dev, "vkCmdBeginQuery"); |
| 242 | table->CmdEndQuery = (PFN_vkCmdEndQuery)gpa(dev, "vkCmdEndQuery"); |
| 243 | table->CmdResetQueryPool = |
| 244 | (PFN_vkCmdResetQueryPool)gpa(dev, "vkCmdResetQueryPool"); |
| 245 | table->CmdWriteTimestamp = |
| 246 | (PFN_vkCmdWriteTimestamp)gpa(dev, "vkCmdWriteTimestamp"); |
| 247 | table->CmdCopyQueryPoolResults = |
| 248 | (PFN_vkCmdCopyQueryPoolResults)gpa(dev, "vkCmdCopyQueryPoolResults"); |
| 249 | table->CmdPushConstants = |
| 250 | (PFN_vkCmdPushConstants)gpa(dev, "vkCmdPushConstants"); |
| 251 | table->CmdBeginRenderPass = |
| 252 | (PFN_vkCmdBeginRenderPass)gpa(dev, "vkCmdBeginRenderPass"); |
| 253 | table->CmdNextSubpass = (PFN_vkCmdNextSubpass)gpa(dev, "vkCmdNextSubpass"); |
| 254 | table->CmdEndRenderPass = |
| 255 | (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass"); |
| 256 | table->CmdExecuteCommands = |
| 257 | (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands"); |
Jon Ashburn | 232e3af | 2015-11-30 17:21:25 -0700 | [diff] [blame] | 258 | } |
| 259 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 260 | static inline void loader_init_device_extension_dispatch_table( |
| 261 | struct loader_dev_dispatch_table *dev_table, PFN_vkGetDeviceProcAddr gpa, |
| 262 | VkDevice dev) { |
Jon Ashburn | 232e3af | 2015-11-30 17:21:25 -0700 | [diff] [blame] | 263 | VkLayerDispatchTable *table = &dev_table->core_dispatch; |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 264 | table->AcquireNextImageKHR = |
| 265 | (PFN_vkAcquireNextImageKHR)gpa(dev, "vkAcquireNextImageKHR"); |
| 266 | table->CreateSwapchainKHR = |
| 267 | (PFN_vkCreateSwapchainKHR)gpa(dev, "vkCreateSwapchainKHR"); |
| 268 | table->DestroySwapchainKHR = |
| 269 | (PFN_vkDestroySwapchainKHR)gpa(dev, "vkDestroySwapchainKHR"); |
| 270 | table->GetSwapchainImagesKHR = |
| 271 | (PFN_vkGetSwapchainImagesKHR)gpa(dev, "vkGetSwapchainImagesKHR"); |
| 272 | table->QueuePresentKHR = |
| 273 | (PFN_vkQueuePresentKHR)gpa(dev, "vkQueuePresentKHR"); |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 274 | } |
| 275 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 276 | static inline void * |
| 277 | loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, |
| 278 | const char *name) { |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 279 | if (!name || name[0] != 'v' || name[1] != 'k') |
| 280 | return NULL; |
| 281 | |
| 282 | name += 2; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 283 | if (!strcmp(name, "GetDeviceProcAddr")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 284 | return (void *)table->GetDeviceProcAddr; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 285 | if (!strcmp(name, "DestroyDevice")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 286 | return (void *)table->DestroyDevice; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 287 | if (!strcmp(name, "GetDeviceQueue")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 288 | return (void *)table->GetDeviceQueue; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 289 | if (!strcmp(name, "QueueSubmit")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 290 | return (void *)table->QueueSubmit; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 291 | if (!strcmp(name, "QueueWaitIdle")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 292 | return (void *)table->QueueWaitIdle; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 293 | if (!strcmp(name, "DeviceWaitIdle")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 294 | return (void *)table->DeviceWaitIdle; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 295 | if (!strcmp(name, "AllocateMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 296 | return (void *)table->AllocateMemory; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 297 | if (!strcmp(name, "FreeMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 298 | return (void *)table->FreeMemory; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 299 | if (!strcmp(name, "MapMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 300 | return (void *)table->MapMemory; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 301 | if (!strcmp(name, "UnmapMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 302 | return (void *)table->UnmapMemory; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 303 | if (!strcmp(name, "FlushMappedMemoryRanges")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 304 | return (void *)table->FlushMappedMemoryRanges; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 305 | if (!strcmp(name, "InvalidateMappedMemoryRanges")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 306 | return (void *)table->InvalidateMappedMemoryRanges; |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 307 | if (!strcmp(name, "GetDeviceMemoryCommitment")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 308 | return (void *)table->GetDeviceMemoryCommitment; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 309 | if (!strcmp(name, "GetImageSparseMemoryRequirements")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 310 | return (void *)table->GetImageSparseMemoryRequirements; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 311 | if (!strcmp(name, "GetBufferMemoryRequirements")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 312 | return (void *)table->GetBufferMemoryRequirements; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 313 | if (!strcmp(name, "GetImageMemoryRequirements")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 314 | return (void *)table->GetImageMemoryRequirements; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 315 | if (!strcmp(name, "BindBufferMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 316 | return (void *)table->BindBufferMemory; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 317 | if (!strcmp(name, "BindImageMemory")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 318 | return (void *)table->BindImageMemory; |
Chia-I Wu | 1ff4c3d | 2015-10-26 16:55:27 +0800 | [diff] [blame] | 319 | if (!strcmp(name, "QueueBindSparse")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 320 | return (void *)table->QueueBindSparse; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 321 | if (!strcmp(name, "CreateFence")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 322 | return (void *)table->CreateFence; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 323 | if (!strcmp(name, "DestroyFence")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 324 | return (void *)table->DestroyFence; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 325 | if (!strcmp(name, "ResetFences")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 326 | return (void *)table->ResetFences; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 327 | if (!strcmp(name, "GetFenceStatus")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 328 | return (void *)table->GetFenceStatus; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 329 | if (!strcmp(name, "WaitForFences")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 330 | return (void *)table->WaitForFences; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 331 | if (!strcmp(name, "CreateSemaphore")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 332 | return (void *)table->CreateSemaphore; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 333 | if (!strcmp(name, "DestroySemaphore")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 334 | return (void *)table->DestroySemaphore; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 335 | if (!strcmp(name, "CreateEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 336 | return (void *)table->CreateEvent; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 337 | if (!strcmp(name, "DestroyEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 338 | return (void *)table->DestroyEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 339 | if (!strcmp(name, "GetEventStatus")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 340 | return (void *)table->GetEventStatus; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 341 | if (!strcmp(name, "SetEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 342 | return (void *)table->SetEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 343 | if (!strcmp(name, "ResetEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 344 | return (void *)table->ResetEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 345 | if (!strcmp(name, "CreateQueryPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 346 | return (void *)table->CreateQueryPool; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 347 | if (!strcmp(name, "DestroyQueryPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 348 | return (void *)table->DestroyQueryPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 349 | if (!strcmp(name, "GetQueryPoolResults")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 350 | return (void *)table->GetQueryPoolResults; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 351 | if (!strcmp(name, "CreateBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 352 | return (void *)table->CreateBuffer; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 353 | if (!strcmp(name, "DestroyBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 354 | return (void *)table->DestroyBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 355 | if (!strcmp(name, "CreateBufferView")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 356 | return (void *)table->CreateBufferView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 357 | if (!strcmp(name, "DestroyBufferView")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 358 | return (void *)table->DestroyBufferView; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 359 | if (!strcmp(name, "CreateImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 360 | return (void *)table->CreateImage; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 361 | if (!strcmp(name, "DestroyImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 362 | return (void *)table->DestroyImage; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 363 | if (!strcmp(name, "GetImageSubresourceLayout")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 364 | return (void *)table->GetImageSubresourceLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 365 | if (!strcmp(name, "CreateImageView")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 366 | return (void *)table->CreateImageView; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 367 | if (!strcmp(name, "DestroyImageView")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 368 | return (void *)table->DestroyImageView; |
Courtney Goeltzenleuchter | 2d2cb68 | 2015-06-24 18:24:19 -0600 | [diff] [blame] | 369 | if (!strcmp(name, "CreateShaderModule")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 370 | return (void *)table->CreateShaderModule; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 371 | if (!strcmp(name, "DestroyShaderModule")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 372 | return (void *)table->DestroyShaderModule; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 373 | if (!strcmp(name, "CreatePipelineCache")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 374 | return (void *)vkCreatePipelineCache; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 375 | if (!strcmp(name, "DestroyPipelineCache")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 376 | return (void *)vkDestroyPipelineCache; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 377 | if (!strcmp(name, "GetPipelineCacheData")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 378 | return (void *)vkGetPipelineCacheData; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 379 | if (!strcmp(name, "MergePipelineCaches")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 380 | return (void *)vkMergePipelineCaches; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 381 | if (!strcmp(name, "CreateGraphicsPipelines")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 382 | return (void *)vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 383 | if (!strcmp(name, "CreateComputePipelines")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 384 | return (void *)vkCreateComputePipelines; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 385 | if (!strcmp(name, "DestroyPipeline")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 386 | return (void *)table->DestroyPipeline; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 387 | if (!strcmp(name, "CreatePipelineLayout")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 388 | return (void *)table->CreatePipelineLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 389 | if (!strcmp(name, "DestroyPipelineLayout")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 390 | return (void *)table->DestroyPipelineLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 391 | if (!strcmp(name, "CreateSampler")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 392 | return (void *)table->CreateSampler; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 393 | if (!strcmp(name, "DestroySampler")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 394 | return (void *)table->DestroySampler; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 395 | if (!strcmp(name, "CreateDescriptorSetLayout")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 396 | return (void *)table->CreateDescriptorSetLayout; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 397 | if (!strcmp(name, "DestroyDescriptorSetLayout")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 398 | return (void *)table->DestroyDescriptorSetLayout; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 399 | if (!strcmp(name, "CreateDescriptorPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 400 | return (void *)table->CreateDescriptorPool; |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 401 | if (!strcmp(name, "DestroyDescriptorPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 402 | return (void *)table->DestroyDescriptorPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 403 | if (!strcmp(name, "ResetDescriptorPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 404 | return (void *)table->ResetDescriptorPool; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 405 | if (!strcmp(name, "AllocateDescriptorSets")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 406 | return (void *)table->AllocateDescriptorSets; |
Tony Barbour | 34ec692 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 407 | if (!strcmp(name, "FreeDescriptorSets")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 408 | return (void *)table->FreeDescriptorSets; |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 409 | if (!strcmp(name, "UpdateDescriptorSets")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 410 | return (void *)table->UpdateDescriptorSets; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 411 | if (!strcmp(name, "CreateFramebuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 412 | return (void *)table->CreateFramebuffer; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 413 | if (!strcmp(name, "DestroyFramebuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 414 | return (void *)table->DestroyFramebuffer; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 415 | if (!strcmp(name, "CreateRenderPass")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 416 | return (void *)table->CreateRenderPass; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 417 | if (!strcmp(name, "DestroyRenderPass")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 418 | return (void *)table->DestroyRenderPass; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 419 | if (!strcmp(name, "GetRenderAreaGranularity")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 420 | return (void *)table->GetRenderAreaGranularity; |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 421 | if (!strcmp(name, "CreateCommandPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 422 | return (void *)table->CreateCommandPool; |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 423 | if (!strcmp(name, "DestroyCommandPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 424 | return (void *)table->DestroyCommandPool; |
Cody Northrop | e62183e | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 425 | if (!strcmp(name, "ResetCommandPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 426 | return (void *)table->ResetCommandPool; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 427 | if (!strcmp(name, "AllocateCommandBuffers")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 428 | return (void *)table->AllocateCommandBuffers; |
Courtney Goeltzenleuchter | bee18a9 | 2015-10-23 14:21:05 -0600 | [diff] [blame] | 429 | if (!strcmp(name, "FreeCommandBuffers")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 430 | return (void *)table->FreeCommandBuffers; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 431 | if (!strcmp(name, "BeginCommandBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 432 | return (void *)table->BeginCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 433 | if (!strcmp(name, "EndCommandBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 434 | return (void *)table->EndCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 435 | if (!strcmp(name, "ResetCommandBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 436 | return (void *)table->ResetCommandBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 437 | if (!strcmp(name, "CmdBindPipeline")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 438 | return (void *)table->CmdBindPipeline; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 439 | if (!strcmp(name, "CmdSetViewport")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 440 | return (void *)table->CmdSetViewport; |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 441 | if (!strcmp(name, "CmdSetScissor")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 442 | return (void *)table->CmdSetScissor; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 443 | if (!strcmp(name, "CmdSetLineWidth")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 444 | return (void *)table->CmdSetLineWidth; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 445 | if (!strcmp(name, "CmdSetDepthBias")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 446 | return (void *)table->CmdSetDepthBias; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 447 | if (!strcmp(name, "CmdSetBlendConstants")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 448 | return (void *)table->CmdSetBlendConstants; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 449 | if (!strcmp(name, "CmdSetDepthBounds")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 450 | return (void *)table->CmdSetDepthBounds; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 451 | if (!strcmp(name, "CmdSetStencilCompareMask")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 452 | return (void *)table->CmdSetStencilCompareMask; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 453 | if (!strcmp(name, "CmdSetStencilwriteMask")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 454 | return (void *)table->CmdSetStencilWriteMask; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 455 | if (!strcmp(name, "CmdSetStencilReference")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 456 | return (void *)table->CmdSetStencilReference; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 457 | if (!strcmp(name, "CmdBindDescriptorSets")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 458 | return (void *)table->CmdBindDescriptorSets; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 459 | if (!strcmp(name, "CmdBindVertexBuffers")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 460 | return (void *)table->CmdBindVertexBuffers; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 461 | if (!strcmp(name, "CmdBindIndexBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 462 | return (void *)table->CmdBindIndexBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 463 | if (!strcmp(name, "CmdDraw")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 464 | return (void *)table->CmdDraw; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 465 | if (!strcmp(name, "CmdDrawIndexed")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 466 | return (void *)table->CmdDrawIndexed; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 467 | if (!strcmp(name, "CmdDrawIndirect")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 468 | return (void *)table->CmdDrawIndirect; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 469 | if (!strcmp(name, "CmdDrawIndexedIndirect")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 470 | return (void *)table->CmdDrawIndexedIndirect; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 471 | if (!strcmp(name, "CmdDispatch")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 472 | return (void *)table->CmdDispatch; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 473 | if (!strcmp(name, "CmdDispatchIndirect")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 474 | return (void *)table->CmdDispatchIndirect; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 475 | if (!strcmp(name, "CmdCopyBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 476 | return (void *)table->CmdCopyBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 477 | if (!strcmp(name, "CmdCopyImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 478 | return (void *)table->CmdCopyImage; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 479 | if (!strcmp(name, "CmdBlitImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 480 | return (void *)table->CmdBlitImage; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 481 | if (!strcmp(name, "CmdCopyBufferToImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 482 | return (void *)table->CmdCopyBufferToImage; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 483 | if (!strcmp(name, "CmdCopyImageToBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 484 | return (void *)table->CmdCopyImageToBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 485 | if (!strcmp(name, "CmdUpdateBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 486 | return (void *)table->CmdUpdateBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 487 | if (!strcmp(name, "CmdFillBuffer")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 488 | return (void *)table->CmdFillBuffer; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 489 | if (!strcmp(name, "CmdClearColorImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 490 | return (void *)table->CmdClearColorImage; |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 491 | if (!strcmp(name, "CmdClearDepthStencilImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 492 | return (void *)table->CmdClearDepthStencilImage; |
Courtney Goeltzenleuchter | c9323e0 | 2015-10-15 16:51:05 -0600 | [diff] [blame] | 493 | if (!strcmp(name, "CmdClearAttachments")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 494 | return (void *)table->CmdClearAttachments; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 495 | if (!strcmp(name, "CmdResolveImage")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 496 | return (void *)table->CmdResolveImage; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 497 | if (!strcmp(name, "CmdSetEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 498 | return (void *)table->CmdSetEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 499 | if (!strcmp(name, "CmdResetEvent")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 500 | return (void *)table->CmdResetEvent; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 501 | if (!strcmp(name, "CmdWaitEvents")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 502 | return (void *)table->CmdWaitEvents; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 503 | if (!strcmp(name, "CmdPipelineBarrier")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 504 | return (void *)table->CmdPipelineBarrier; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 505 | if (!strcmp(name, "CmdBeginQuery")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 506 | return (void *)table->CmdBeginQuery; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 507 | if (!strcmp(name, "CmdEndQuery")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 508 | return (void *)table->CmdEndQuery; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 509 | if (!strcmp(name, "CmdResetQueryPool")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 510 | return (void *)table->CmdResetQueryPool; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 511 | if (!strcmp(name, "CmdWriteTimestamp")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 512 | return (void *)table->CmdWriteTimestamp; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 513 | if (!strcmp(name, "CmdCopyQueryPoolResults")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 514 | return (void *)table->CmdCopyQueryPoolResults; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 515 | if (!strcmp(name, "CmdPushConstants")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 516 | return (void *)table->CmdPushConstants; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 517 | if (!strcmp(name, "CmdBeginRenderPass")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 518 | return (void *)table->CmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 519 | if (!strcmp(name, "CmdNextSubpass")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 520 | return (void *)table->CmdNextSubpass; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 521 | if (!strcmp(name, "CmdEndRenderPass")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 522 | return (void *)table->CmdEndRenderPass; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 523 | if (!strcmp(name, "CmdExecuteCommands")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 524 | return (void *)table->CmdExecuteCommands; |
Jon Ashburn | d55a394 | 2015-05-06 09:02:10 -0600 | [diff] [blame] | 525 | |
| 526 | return NULL; |
| 527 | } |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 528 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 529 | static inline void |
| 530 | loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, |
| 531 | PFN_vkGetInstanceProcAddr gpa, |
| 532 | VkInstance inst) { |
| 533 | table->GetInstanceProcAddr = |
| 534 | (PFN_vkGetInstanceProcAddr)gpa(inst, "vkGetInstanceProcAddr"); |
| 535 | table->DestroyInstance = |
| 536 | (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance"); |
| 537 | table->EnumeratePhysicalDevices = |
| 538 | (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices"); |
| 539 | table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa( |
| 540 | inst, "vkGetPhysicalDeviceFeatures"); |
| 541 | table->GetPhysicalDeviceImageFormatProperties = |
| 542 | (PFN_vkGetPhysicalDeviceImageFormatProperties)gpa( |
| 543 | inst, "vkGetPhysicalDeviceImageFormatProperties"); |
| 544 | table->GetPhysicalDeviceFormatProperties = |
| 545 | (PFN_vkGetPhysicalDeviceFormatProperties)gpa( |
| 546 | inst, "vkGetPhysicalDeviceFormatProperties"); |
| 547 | table->GetPhysicalDeviceSparseImageFormatProperties = |
| 548 | (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa( |
| 549 | inst, "vkGetPhysicalDeviceSparseImageFormatProperties"); |
| 550 | table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)gpa( |
| 551 | inst, "vkGetPhysicalDeviceProperties"); |
| 552 | table->GetPhysicalDeviceQueueFamilyProperties = |
| 553 | (PFN_vkGetPhysicalDeviceQueueFamilyProperties)gpa( |
| 554 | inst, "vkGetPhysicalDeviceQueueFamilyProperties"); |
| 555 | table->GetPhysicalDeviceMemoryProperties = |
| 556 | (PFN_vkGetPhysicalDeviceMemoryProperties)gpa( |
| 557 | inst, "vkGetPhysicalDeviceMemoryProperties"); |
| 558 | table->EnumerateDeviceExtensionProperties = |
| 559 | (PFN_vkEnumerateDeviceExtensionProperties)gpa( |
| 560 | inst, "vkEnumerateDeviceExtensionProperties"); |
| 561 | table->EnumerateDeviceLayerProperties = |
| 562 | (PFN_vkEnumerateDeviceLayerProperties)gpa( |
| 563 | inst, "vkEnumerateDeviceLayerProperties"); |
Courtney Goeltzenleuchter | d971b61 | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 564 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 565 | |
Courtney Goeltzenleuchter | d971b61 | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 566 | static inline void loader_init_instance_extension_dispatch_table( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 567 | VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa, |
| 568 | VkInstance inst) { |
| 569 | table->DestroySurfaceKHR = |
| 570 | (PFN_vkDestroySurfaceKHR)gpa(inst, "vkDestroySurfaceKHR"); |
| 571 | table->CreateDebugReportCallbackEXT = |
| 572 | (PFN_vkCreateDebugReportCallbackEXT)gpa( |
| 573 | inst, "vkCreateDebugReportCallbackEXT"); |
| 574 | table->DestroyDebugReportCallbackEXT = |
| 575 | (PFN_vkDestroyDebugReportCallbackEXT)gpa( |
| 576 | inst, "vkDestroyDebugReportCallbackEXT"); |
| 577 | table->DebugReportMessageEXT = |
| 578 | (PFN_vkDebugReportMessageEXT)gpa(inst, "vkDebugReportMessageEXT"); |
| 579 | table->GetPhysicalDeviceSurfaceSupportKHR = |
| 580 | (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)gpa( |
| 581 | inst, "vkGetPhysicalDeviceSurfaceSupportKHR"); |
| 582 | table->GetPhysicalDeviceSurfaceCapabilitiesKHR = |
| 583 | (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)gpa( |
| 584 | inst, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); |
| 585 | table->GetPhysicalDeviceSurfaceFormatsKHR = |
| 586 | (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)gpa( |
| 587 | inst, "vkGetPhysicalDeviceSurfaceFormatsKHR"); |
| 588 | table->GetPhysicalDeviceSurfacePresentModesKHR = |
| 589 | (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)gpa( |
| 590 | inst, "vkGetPhysicalDeviceSurfacePresentModesKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 591 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 592 | table->CreateMirSurfaceKHR = |
| 593 | (PFN_vkCreateMirSurfaceKHR)gpa(inst, "vkCreateMirSurfaceKHR"); |
| 594 | table->GetPhysicalDeviceMirPresentationSupportKHR = |
| 595 | (PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)gpa( |
| 596 | inst, "vkGetPhysicalDeviceMirPresentationSupportKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 597 | #endif |
| 598 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 599 | table->CreateWaylandSurfaceKHR = |
| 600 | (PFN_vkCreateWaylandSurfaceKHR)gpa(inst, "vkCreateWaylandSurfaceKHR"); |
| 601 | table->GetPhysicalDeviceWaylandPresentationSupportKHR = |
| 602 | (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)gpa( |
| 603 | inst, "vkGetPhysicalDeviceWaylandPresentationSupportKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 604 | #endif |
| 605 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 606 | table->CreateWin32SurfaceKHR = |
| 607 | (PFN_vkCreateWin32SurfaceKHR)gpa(inst, "vkCreateWin32SurfaceKHR"); |
| 608 | table->GetPhysicalDeviceWin32PresentationSupportKHR = |
| 609 | (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)gpa( |
| 610 | inst, "vkGetPhysicalDeviceWin32PresentationSupportKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 611 | #endif |
| 612 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 613 | table->CreateXcbSurfaceKHR = |
| 614 | (PFN_vkCreateXcbSurfaceKHR)gpa(inst, "vkCreateXcbSurfaceKHR"); |
| 615 | table->GetPhysicalDeviceXcbPresentationSupportKHR = |
| 616 | (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)gpa( |
| 617 | inst, "vkGetPhysicalDeviceXcbPresentationSupportKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 618 | #endif |
| 619 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 620 | table->CreateXlibSurfaceKHR = |
| 621 | (PFN_vkCreateXlibSurfaceKHR)gpa(inst, "vkCreateXlibSurfaceKHR"); |
| 622 | table->GetPhysicalDeviceXlibPresentationSupportKHR = |
| 623 | (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)gpa( |
| 624 | inst, "vkGetPhysicalDeviceXlibPresentationSupportKHR"); |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 625 | #endif |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 626 | } |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 627 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 628 | static inline void * |
| 629 | loader_lookup_instance_dispatch_table(const VkLayerInstanceDispatchTable *table, |
| 630 | const char *name) { |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 631 | if (!name || name[0] != 'v' || name[1] != 'k') |
| 632 | return NULL; |
| 633 | |
| 634 | name += 2; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 635 | if (!strcmp(name, "DestroyInstance")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 636 | return (void *)table->DestroyInstance; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 637 | if (!strcmp(name, "EnumeratePhysicalDevices")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 638 | return (void *)table->EnumeratePhysicalDevices; |
Chris Forbes | bc0bb77 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 639 | if (!strcmp(name, "GetPhysicalDeviceFeatures")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 640 | return (void *)table->GetPhysicalDeviceFeatures; |
Jon Ashburn | 754864f | 2015-07-23 18:49:07 -0600 | [diff] [blame] | 641 | if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 642 | return (void *)table->GetPhysicalDeviceImageFormatProperties; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 643 | if (!strcmp(name, "GetPhysicalDeviceFormatProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 644 | return (void *)table->GetPhysicalDeviceFormatProperties; |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 645 | if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 646 | return (void *)table->GetPhysicalDeviceSparseImageFormatProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 647 | if (!strcmp(name, "GetPhysicalDeviceProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 648 | return (void *)table->GetPhysicalDeviceProperties; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 649 | if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 650 | return (void *)table->GetPhysicalDeviceQueueFamilyProperties; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 651 | if (!strcmp(name, "GetPhysicalDeviceMemoryProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 652 | return (void *)table->GetPhysicalDeviceMemoryProperties; |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 653 | if (!strcmp(name, "GetInstanceProcAddr")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 654 | return (void *)table->GetInstanceProcAddr; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 655 | if (!strcmp(name, "EnumerateDeviceExtensionProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 656 | return (void *)table->EnumerateDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 657 | if (!strcmp(name, "EnumerateDeviceLayerProperties")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 658 | return (void *)table->EnumerateDeviceLayerProperties; |
Ian Elliott | fb42cd7 | 2015-11-25 14:43:02 -0700 | [diff] [blame] | 659 | if (!strcmp(name, "DestroySurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 660 | return (void *)table->DestroySurfaceKHR; |
Ian Elliott | 7e40db9 | 2015-08-21 15:09:33 -0600 | [diff] [blame] | 661 | if (!strcmp(name, "GetPhysicalDeviceSurfaceSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 662 | return (void *)table->GetPhysicalDeviceSurfaceSupportKHR; |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 663 | if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilitiesKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 664 | return (void *)table->GetPhysicalDeviceSurfaceCapabilitiesKHR; |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 665 | if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 666 | return (void *)table->GetPhysicalDeviceSurfaceFormatsKHR; |
Ian Elliott | 486c550 | 2015-11-19 16:05:09 -0700 | [diff] [blame] | 667 | if (!strcmp(name, "GetPhysicalDeviceSurfacePresentModesKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 668 | return (void *)table->GetPhysicalDeviceSurfacePresentModesKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 669 | #ifdef VK_USE_PLATFORM_MIR_KHR |
| 670 | if (!strcmp(name, "CreateMirSurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 671 | return (void *)table->CreateMirSurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 672 | if (!strcmp(name, "GetPhysicalDeviceMirPresentationSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 673 | return (void *)table->GetPhysicalDeviceMirPresentationSupportKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 674 | #endif |
| 675 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 676 | if (!strcmp(name, "CreateWaylandSurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 677 | return (void *)table->CreateWaylandSurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 678 | if (!strcmp(name, "GetPhysicalDeviceWaylandPresentationSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 679 | return (void *)table->GetPhysicalDeviceWaylandPresentationSupportKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 680 | #endif |
| 681 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 682 | if (!strcmp(name, "CreateWin32SurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 683 | return (void *)table->CreateWin32SurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 684 | if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 685 | return (void *)table->GetPhysicalDeviceWin32PresentationSupportKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 686 | #endif |
| 687 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 688 | if (!strcmp(name, "CreateXcbSurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 689 | return (void *)table->CreateXcbSurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 690 | if (!strcmp(name, "GetPhysicalDeviceXcbPresentationSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 691 | return (void *)table->GetPhysicalDeviceXcbPresentationSupportKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 692 | #endif |
| 693 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 694 | if (!strcmp(name, "CreateXlibSurfaceKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 695 | return (void *)table->CreateXlibSurfaceKHR; |
Ian Elliott | 919fa30 | 2015-11-24 15:39:10 -0700 | [diff] [blame] | 696 | if (!strcmp(name, "GetPhysicalDeviceXlibPresentationSupportKHR")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 697 | return (void *)table->GetPhysicalDeviceXlibPresentationSupportKHR; |
Ian Elliott | db4300a | 2015-11-23 10:17:23 -0700 | [diff] [blame] | 698 | #endif |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 699 | if (!strcmp(name, "CreateDebugReportCallbackEXT")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 700 | return (void *)table->CreateDebugReportCallbackEXT; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 701 | if (!strcmp(name, "DestroyDebugReportCallbackEXT")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 702 | return (void *)table->DestroyDebugReportCallbackEXT; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 703 | if (!strcmp(name, "DebugReportMessageEXT")) |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame^] | 704 | return (void *)table->DebugReportMessageEXT; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 705 | |
Jon Ashburn | 27cd584 | 2015-05-12 17:26:48 -0600 | [diff] [blame] | 706 | return NULL; |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 707 | } |