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