Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // This file is generated. Do not edit manually! |
| 18 | // To regenerate: $ apic template ../api/vulkan.api get_proc_addr.cpp.tmpl |
| 19 | // Requires apic from https://android.googlesource.com/platform/tools/gpu/. |
| 20 | |
| 21 | #include <algorithm> |
| 22 | #include <log/log.h> |
| 23 | #include "loader.h" |
| 24 | using namespace vulkan; |
| 25 | |
| 26 | #define UNLIKELY(expr) __builtin_expect((expr), 0) |
| 27 | |
| 28 | namespace { |
| 29 | |
| 30 | struct NameProcEntry { |
| 31 | const char* name; |
| 32 | PFN_vkVoidFunction proc; |
| 33 | }; |
| 34 | |
| 35 | struct NameOffsetEntry { |
| 36 | const char* name; |
| 37 | size_t offset; |
| 38 | }; |
| 39 | |
| 40 | template <typename TEntry, size_t N> |
| 41 | const TEntry* FindProcEntry(const TEntry(&table)[N], const char* name) { |
| 42 | auto entry = std::lower_bound( |
| 43 | table, table + N, name, |
| 44 | [](const TEntry& e, const char* n) { return strcmp(e.name, n) < 0; }); |
| 45 | if (entry != (table + N) && strcmp(entry->name, name) == 0) |
| 46 | return entry; |
| 47 | return nullptr; |
| 48 | } |
| 49 | |
| 50 | const NameProcEntry kInstanceProcTbl[] = { |
| 51 | // clang-format off |
| 52 | {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDevice)}, |
| 53 | {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyInstance)}, |
| 54 | {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(vkEnumeratePhysicalDevices)}, |
| 55 | {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(vkGetInstanceProcAddr)}, |
| 56 | {"vkGetPhysicalDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceExtensionProperties)}, |
| 57 | {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFeatures)}, |
| 58 | {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFormatProperties)}, |
| 59 | {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceImageFormatProperties)}, |
| 60 | {"vkGetPhysicalDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceLayerProperties)}, |
| 61 | {"vkGetPhysicalDeviceLimits", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceLimits)}, |
| 62 | {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceMemoryProperties)}, |
| 63 | {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceProperties)}, |
| 64 | {"vkGetPhysicalDeviceQueueCount", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueCount)}, |
| 65 | {"vkGetPhysicalDeviceQueueProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueProperties)}, |
| 66 | {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSparseImageFormatProperties)}, |
| 67 | // clang-format on |
| 68 | }; |
| 69 | |
| 70 | const NameProcEntry kDeviceProcTbl[] = { |
| 71 | // clang-format off |
| 72 | {"vkAllocDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkAllocDescriptorSets)}, |
| 73 | {"vkAllocMemory", reinterpret_cast<PFN_vkVoidFunction>(vkAllocMemory)}, |
| 74 | {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkBeginCommandBuffer)}, |
| 75 | {"vkBindBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(vkBindBufferMemory)}, |
| 76 | {"vkBindImageMemory", reinterpret_cast<PFN_vkVoidFunction>(vkBindImageMemory)}, |
| 77 | {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginQuery)}, |
| 78 | {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginRenderPass)}, |
| 79 | {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDescriptorSets)}, |
| 80 | {"vkCmdBindDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicColorBlendState)}, |
| 81 | {"vkCmdBindDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicDepthStencilState)}, |
| 82 | {"vkCmdBindDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicRasterState)}, |
| 83 | {"vkCmdBindDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicViewportState)}, |
| 84 | {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindIndexBuffer)}, |
| 85 | {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindPipeline)}, |
| 86 | {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindVertexBuffers)}, |
| 87 | {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBlitImage)}, |
| 88 | {"vkCmdClearColorAttachment", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearColorAttachment)}, |
| 89 | {"vkCmdClearColorImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearColorImage)}, |
| 90 | {"vkCmdClearDepthStencilAttachment", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearDepthStencilAttachment)}, |
| 91 | {"vkCmdClearDepthStencilImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdClearDepthStencilImage)}, |
| 92 | {"vkCmdCopyBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyBuffer)}, |
| 93 | {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyBufferToImage)}, |
| 94 | {"vkCmdCopyImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyImage)}, |
| 95 | {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyImageToBuffer)}, |
| 96 | {"vkCmdCopyQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(vkCmdCopyQueryPoolResults)}, |
| 97 | {"vkCmdDispatch", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDispatch)}, |
| 98 | {"vkCmdDispatchIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDispatchIndirect)}, |
| 99 | {"vkCmdDraw", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDraw)}, |
| 100 | {"vkCmdDrawIndexed", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndexed)}, |
| 101 | {"vkCmdDrawIndexedIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndexedIndirect)}, |
| 102 | {"vkCmdDrawIndirect", reinterpret_cast<PFN_vkVoidFunction>(vkCmdDrawIndirect)}, |
| 103 | {"vkCmdEndQuery", reinterpret_cast<PFN_vkVoidFunction>(vkCmdEndQuery)}, |
| 104 | {"vkCmdEndRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdEndRenderPass)}, |
| 105 | {"vkCmdExecuteCommands", reinterpret_cast<PFN_vkVoidFunction>(vkCmdExecuteCommands)}, |
| 106 | {"vkCmdFillBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdFillBuffer)}, |
| 107 | {"vkCmdNextSubpass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdNextSubpass)}, |
| 108 | {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(vkCmdPipelineBarrier)}, |
| 109 | {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(vkCmdPushConstants)}, |
| 110 | {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetEvent)}, |
| 111 | {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetQueryPool)}, |
| 112 | {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResolveImage)}, |
| 113 | {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetEvent)}, |
| 114 | {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdUpdateBuffer)}, |
| 115 | {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWaitEvents)}, |
| 116 | {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWriteTimestamp)}, |
| 117 | {"vkCreateAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateAttachmentView)}, |
| 118 | {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBuffer)}, |
| 119 | {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBufferView)}, |
| 120 | {"vkCreateCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateCommandBuffer)}, |
| 121 | {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateCommandPool)}, |
| 122 | {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(vkCreateComputePipelines)}, |
| 123 | {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorPool)}, |
| 124 | {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorSetLayout)}, |
| 125 | {"vkCreateDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicColorBlendState)}, |
| 126 | {"vkCreateDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicDepthStencilState)}, |
| 127 | {"vkCreateDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicRasterState)}, |
| 128 | {"vkCreateDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicViewportState)}, |
| 129 | {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCreateEvent)}, |
| 130 | {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFence)}, |
| 131 | {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFramebuffer)}, |
| 132 | {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(vkCreateGraphicsPipelines)}, |
| 133 | {"vkCreateImage", reinterpret_cast<PFN_vkVoidFunction>(vkCreateImage)}, |
| 134 | {"vkCreateImageView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateImageView)}, |
| 135 | {"vkCreatePipelineCache", reinterpret_cast<PFN_vkVoidFunction>(vkCreatePipelineCache)}, |
| 136 | {"vkCreatePipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(vkCreatePipelineLayout)}, |
| 137 | {"vkCreateQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateQueryPool)}, |
| 138 | {"vkCreateRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCreateRenderPass)}, |
| 139 | {"vkCreateSampler", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSampler)}, |
| 140 | {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSemaphore)}, |
| 141 | {"vkCreateShader", reinterpret_cast<PFN_vkVoidFunction>(vkCreateShader)}, |
| 142 | {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkCreateShaderModule)}, |
| 143 | {"vkDestroyAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyAttachmentView)}, |
| 144 | {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBuffer)}, |
| 145 | {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBufferView)}, |
| 146 | {"vkDestroyCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyCommandBuffer)}, |
| 147 | {"vkDestroyCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyCommandPool)}, |
| 148 | {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorPool)}, |
| 149 | {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorSetLayout)}, |
| 150 | {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDevice)}, |
| 151 | {"vkDestroyDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicColorBlendState)}, |
| 152 | {"vkDestroyDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicDepthStencilState)}, |
| 153 | {"vkDestroyDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicRasterState)}, |
| 154 | {"vkDestroyDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicViewportState)}, |
| 155 | {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyEvent)}, |
| 156 | {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFence)}, |
| 157 | {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFramebuffer)}, |
| 158 | {"vkDestroyImage", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyImage)}, |
| 159 | {"vkDestroyImageView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyImageView)}, |
| 160 | {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipeline)}, |
| 161 | {"vkDestroyPipelineCache", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipelineCache)}, |
| 162 | {"vkDestroyPipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyPipelineLayout)}, |
| 163 | {"vkDestroyQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyQueryPool)}, |
| 164 | {"vkDestroyRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyRenderPass)}, |
| 165 | {"vkDestroySampler", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySampler)}, |
| 166 | {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySemaphore)}, |
| 167 | {"vkDestroyShader", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyShader)}, |
| 168 | {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyShaderModule)}, |
| 169 | {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkDeviceWaitIdle)}, |
| 170 | {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkEndCommandBuffer)}, |
| 171 | {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkFlushMappedMemoryRanges)}, |
| 172 | {"vkFreeDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkFreeDescriptorSets)}, |
| 173 | {"vkFreeMemory", reinterpret_cast<PFN_vkVoidFunction>(vkFreeMemory)}, |
| 174 | {"vkGetBufferMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetBufferMemoryRequirements)}, |
| 175 | {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceMemoryCommitment)}, |
| 176 | {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceProcAddr)}, |
| 177 | {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceQueue)}, |
| 178 | {"vkGetEventStatus", reinterpret_cast<PFN_vkVoidFunction>(vkGetEventStatus)}, |
| 179 | {"vkGetFenceStatus", reinterpret_cast<PFN_vkVoidFunction>(vkGetFenceStatus)}, |
| 180 | {"vkGetImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageMemoryRequirements)}, |
| 181 | {"vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageSparseMemoryRequirements)}, |
| 182 | {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(vkGetImageSubresourceLayout)}, |
| 183 | {"vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(vkGetPipelineCacheData)}, |
| 184 | {"vkGetPipelineCacheSize", reinterpret_cast<PFN_vkVoidFunction>(vkGetPipelineCacheSize)}, |
| 185 | {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(vkGetQueryPoolResults)}, |
| 186 | {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(vkGetRenderAreaGranularity)}, |
| 187 | {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkInvalidateMappedMemoryRanges)}, |
| 188 | {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(vkMapMemory)}, |
| 189 | {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(vkMergePipelineCaches)}, |
| 190 | {"vkQueueBindSparseBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseBufferMemory)}, |
| 191 | {"vkQueueBindSparseImageMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseImageMemory)}, |
| 192 | {"vkQueueBindSparseImageOpaqueMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseImageOpaqueMemory)}, |
| 193 | {"vkQueueSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkQueueSignalSemaphore)}, |
| 194 | {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(vkQueueSubmit)}, |
| 195 | {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkQueueWaitIdle)}, |
| 196 | {"vkQueueWaitSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkQueueWaitSemaphore)}, |
| 197 | {"vkResetCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkResetCommandBuffer)}, |
| 198 | {"vkResetCommandPool", reinterpret_cast<PFN_vkVoidFunction>(vkResetCommandPool)}, |
| 199 | {"vkResetDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkResetDescriptorPool)}, |
| 200 | {"vkResetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkResetEvent)}, |
| 201 | {"vkResetFences", reinterpret_cast<PFN_vkVoidFunction>(vkResetFences)}, |
| 202 | {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkSetEvent)}, |
| 203 | {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(vkUnmapMemory)}, |
| 204 | {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkUpdateDescriptorSets)}, |
| 205 | {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(vkWaitForFences)}, |
| 206 | // clang-format on |
| 207 | }; |
| 208 | |
| 209 | const NameOffsetEntry kInstanceOffsetTbl[] = { |
| 210 | // clang-format off |
| 211 | {"vkCreateDevice", offsetof(InstanceVtbl, CreateDevice)}, |
| 212 | {"vkDestroyInstance", offsetof(InstanceVtbl, DestroyInstance)}, |
| 213 | {"vkEnumeratePhysicalDevices", offsetof(InstanceVtbl, EnumeratePhysicalDevices)}, |
| 214 | {"vkGetInstanceProcAddr", offsetof(InstanceVtbl, GetInstanceProcAddr)}, |
| 215 | {"vkGetPhysicalDeviceExtensionProperties", offsetof(InstanceVtbl, GetPhysicalDeviceExtensionProperties)}, |
| 216 | {"vkGetPhysicalDeviceFeatures", offsetof(InstanceVtbl, GetPhysicalDeviceFeatures)}, |
| 217 | {"vkGetPhysicalDeviceFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceFormatProperties)}, |
| 218 | {"vkGetPhysicalDeviceImageFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceImageFormatProperties)}, |
| 219 | {"vkGetPhysicalDeviceLayerProperties", offsetof(InstanceVtbl, GetPhysicalDeviceLayerProperties)}, |
| 220 | {"vkGetPhysicalDeviceLimits", offsetof(InstanceVtbl, GetPhysicalDeviceLimits)}, |
| 221 | {"vkGetPhysicalDeviceMemoryProperties", offsetof(InstanceVtbl, GetPhysicalDeviceMemoryProperties)}, |
| 222 | {"vkGetPhysicalDeviceProperties", offsetof(InstanceVtbl, GetPhysicalDeviceProperties)}, |
| 223 | {"vkGetPhysicalDeviceQueueCount", offsetof(InstanceVtbl, GetPhysicalDeviceQueueCount)}, |
| 224 | {"vkGetPhysicalDeviceQueueProperties", offsetof(InstanceVtbl, GetPhysicalDeviceQueueProperties)}, |
| 225 | {"vkGetPhysicalDeviceSparseImageFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceSparseImageFormatProperties)}, |
| 226 | // clang-format on |
| 227 | }; |
| 228 | |
| 229 | const NameOffsetEntry kDeviceOffsetTbl[] = { |
| 230 | // clang-format off |
| 231 | {"vkAllocDescriptorSets", offsetof(DeviceVtbl, AllocDescriptorSets)}, |
| 232 | {"vkAllocMemory", offsetof(DeviceVtbl, AllocMemory)}, |
| 233 | {"vkBeginCommandBuffer", offsetof(DeviceVtbl, BeginCommandBuffer)}, |
| 234 | {"vkBindBufferMemory", offsetof(DeviceVtbl, BindBufferMemory)}, |
| 235 | {"vkBindImageMemory", offsetof(DeviceVtbl, BindImageMemory)}, |
| 236 | {"vkCmdBeginQuery", offsetof(DeviceVtbl, CmdBeginQuery)}, |
| 237 | {"vkCmdBeginRenderPass", offsetof(DeviceVtbl, CmdBeginRenderPass)}, |
| 238 | {"vkCmdBindDescriptorSets", offsetof(DeviceVtbl, CmdBindDescriptorSets)}, |
| 239 | {"vkCmdBindDynamicColorBlendState", offsetof(DeviceVtbl, CmdBindDynamicColorBlendState)}, |
| 240 | {"vkCmdBindDynamicDepthStencilState", offsetof(DeviceVtbl, CmdBindDynamicDepthStencilState)}, |
| 241 | {"vkCmdBindDynamicRasterState", offsetof(DeviceVtbl, CmdBindDynamicRasterState)}, |
| 242 | {"vkCmdBindDynamicViewportState", offsetof(DeviceVtbl, CmdBindDynamicViewportState)}, |
| 243 | {"vkCmdBindIndexBuffer", offsetof(DeviceVtbl, CmdBindIndexBuffer)}, |
| 244 | {"vkCmdBindPipeline", offsetof(DeviceVtbl, CmdBindPipeline)}, |
| 245 | {"vkCmdBindVertexBuffers", offsetof(DeviceVtbl, CmdBindVertexBuffers)}, |
| 246 | {"vkCmdBlitImage", offsetof(DeviceVtbl, CmdBlitImage)}, |
| 247 | {"vkCmdClearColorAttachment", offsetof(DeviceVtbl, CmdClearColorAttachment)}, |
| 248 | {"vkCmdClearColorImage", offsetof(DeviceVtbl, CmdClearColorImage)}, |
| 249 | {"vkCmdClearDepthStencilAttachment", offsetof(DeviceVtbl, CmdClearDepthStencilAttachment)}, |
| 250 | {"vkCmdClearDepthStencilImage", offsetof(DeviceVtbl, CmdClearDepthStencilImage)}, |
| 251 | {"vkCmdCopyBuffer", offsetof(DeviceVtbl, CmdCopyBuffer)}, |
| 252 | {"vkCmdCopyBufferToImage", offsetof(DeviceVtbl, CmdCopyBufferToImage)}, |
| 253 | {"vkCmdCopyImage", offsetof(DeviceVtbl, CmdCopyImage)}, |
| 254 | {"vkCmdCopyImageToBuffer", offsetof(DeviceVtbl, CmdCopyImageToBuffer)}, |
| 255 | {"vkCmdCopyQueryPoolResults", offsetof(DeviceVtbl, CmdCopyQueryPoolResults)}, |
| 256 | {"vkCmdDispatch", offsetof(DeviceVtbl, CmdDispatch)}, |
| 257 | {"vkCmdDispatchIndirect", offsetof(DeviceVtbl, CmdDispatchIndirect)}, |
| 258 | {"vkCmdDraw", offsetof(DeviceVtbl, CmdDraw)}, |
| 259 | {"vkCmdDrawIndexed", offsetof(DeviceVtbl, CmdDrawIndexed)}, |
| 260 | {"vkCmdDrawIndexedIndirect", offsetof(DeviceVtbl, CmdDrawIndexedIndirect)}, |
| 261 | {"vkCmdDrawIndirect", offsetof(DeviceVtbl, CmdDrawIndirect)}, |
| 262 | {"vkCmdEndQuery", offsetof(DeviceVtbl, CmdEndQuery)}, |
| 263 | {"vkCmdEndRenderPass", offsetof(DeviceVtbl, CmdEndRenderPass)}, |
| 264 | {"vkCmdExecuteCommands", offsetof(DeviceVtbl, CmdExecuteCommands)}, |
| 265 | {"vkCmdFillBuffer", offsetof(DeviceVtbl, CmdFillBuffer)}, |
| 266 | {"vkCmdNextSubpass", offsetof(DeviceVtbl, CmdNextSubpass)}, |
| 267 | {"vkCmdPipelineBarrier", offsetof(DeviceVtbl, CmdPipelineBarrier)}, |
| 268 | {"vkCmdPushConstants", offsetof(DeviceVtbl, CmdPushConstants)}, |
| 269 | {"vkCmdResetEvent", offsetof(DeviceVtbl, CmdResetEvent)}, |
| 270 | {"vkCmdResetQueryPool", offsetof(DeviceVtbl, CmdResetQueryPool)}, |
| 271 | {"vkCmdResolveImage", offsetof(DeviceVtbl, CmdResolveImage)}, |
| 272 | {"vkCmdSetEvent", offsetof(DeviceVtbl, CmdSetEvent)}, |
| 273 | {"vkCmdUpdateBuffer", offsetof(DeviceVtbl, CmdUpdateBuffer)}, |
| 274 | {"vkCmdWaitEvents", offsetof(DeviceVtbl, CmdWaitEvents)}, |
| 275 | {"vkCmdWriteTimestamp", offsetof(DeviceVtbl, CmdWriteTimestamp)}, |
| 276 | {"vkCreateAttachmentView", offsetof(DeviceVtbl, CreateAttachmentView)}, |
| 277 | {"vkCreateBuffer", offsetof(DeviceVtbl, CreateBuffer)}, |
| 278 | {"vkCreateBufferView", offsetof(DeviceVtbl, CreateBufferView)}, |
| 279 | {"vkCreateCommandBuffer", offsetof(DeviceVtbl, CreateCommandBuffer)}, |
| 280 | {"vkCreateCommandPool", offsetof(DeviceVtbl, CreateCommandPool)}, |
| 281 | {"vkCreateComputePipelines", offsetof(DeviceVtbl, CreateComputePipelines)}, |
| 282 | {"vkCreateDescriptorPool", offsetof(DeviceVtbl, CreateDescriptorPool)}, |
| 283 | {"vkCreateDescriptorSetLayout", offsetof(DeviceVtbl, CreateDescriptorSetLayout)}, |
| 284 | {"vkCreateDynamicColorBlendState", offsetof(DeviceVtbl, CreateDynamicColorBlendState)}, |
| 285 | {"vkCreateDynamicDepthStencilState", offsetof(DeviceVtbl, CreateDynamicDepthStencilState)}, |
| 286 | {"vkCreateDynamicRasterState", offsetof(DeviceVtbl, CreateDynamicRasterState)}, |
| 287 | {"vkCreateDynamicViewportState", offsetof(DeviceVtbl, CreateDynamicViewportState)}, |
| 288 | {"vkCreateEvent", offsetof(DeviceVtbl, CreateEvent)}, |
| 289 | {"vkCreateFence", offsetof(DeviceVtbl, CreateFence)}, |
| 290 | {"vkCreateFramebuffer", offsetof(DeviceVtbl, CreateFramebuffer)}, |
| 291 | {"vkCreateGraphicsPipelines", offsetof(DeviceVtbl, CreateGraphicsPipelines)}, |
| 292 | {"vkCreateImage", offsetof(DeviceVtbl, CreateImage)}, |
| 293 | {"vkCreateImageView", offsetof(DeviceVtbl, CreateImageView)}, |
| 294 | {"vkCreatePipelineCache", offsetof(DeviceVtbl, CreatePipelineCache)}, |
| 295 | {"vkCreatePipelineLayout", offsetof(DeviceVtbl, CreatePipelineLayout)}, |
| 296 | {"vkCreateQueryPool", offsetof(DeviceVtbl, CreateQueryPool)}, |
| 297 | {"vkCreateRenderPass", offsetof(DeviceVtbl, CreateRenderPass)}, |
| 298 | {"vkCreateSampler", offsetof(DeviceVtbl, CreateSampler)}, |
| 299 | {"vkCreateSemaphore", offsetof(DeviceVtbl, CreateSemaphore)}, |
| 300 | {"vkCreateShader", offsetof(DeviceVtbl, CreateShader)}, |
| 301 | {"vkCreateShaderModule", offsetof(DeviceVtbl, CreateShaderModule)}, |
| 302 | {"vkDestroyAttachmentView", offsetof(DeviceVtbl, DestroyAttachmentView)}, |
| 303 | {"vkDestroyBuffer", offsetof(DeviceVtbl, DestroyBuffer)}, |
| 304 | {"vkDestroyBufferView", offsetof(DeviceVtbl, DestroyBufferView)}, |
| 305 | {"vkDestroyCommandBuffer", offsetof(DeviceVtbl, DestroyCommandBuffer)}, |
| 306 | {"vkDestroyCommandPool", offsetof(DeviceVtbl, DestroyCommandPool)}, |
| 307 | {"vkDestroyDescriptorPool", offsetof(DeviceVtbl, DestroyDescriptorPool)}, |
| 308 | {"vkDestroyDescriptorSetLayout", offsetof(DeviceVtbl, DestroyDescriptorSetLayout)}, |
| 309 | {"vkDestroyDevice", offsetof(DeviceVtbl, DestroyDevice)}, |
| 310 | {"vkDestroyDynamicColorBlendState", offsetof(DeviceVtbl, DestroyDynamicColorBlendState)}, |
| 311 | {"vkDestroyDynamicDepthStencilState", offsetof(DeviceVtbl, DestroyDynamicDepthStencilState)}, |
| 312 | {"vkDestroyDynamicRasterState", offsetof(DeviceVtbl, DestroyDynamicRasterState)}, |
| 313 | {"vkDestroyDynamicViewportState", offsetof(DeviceVtbl, DestroyDynamicViewportState)}, |
| 314 | {"vkDestroyEvent", offsetof(DeviceVtbl, DestroyEvent)}, |
| 315 | {"vkDestroyFence", offsetof(DeviceVtbl, DestroyFence)}, |
| 316 | {"vkDestroyFramebuffer", offsetof(DeviceVtbl, DestroyFramebuffer)}, |
| 317 | {"vkDestroyImage", offsetof(DeviceVtbl, DestroyImage)}, |
| 318 | {"vkDestroyImageView", offsetof(DeviceVtbl, DestroyImageView)}, |
| 319 | {"vkDestroyPipeline", offsetof(DeviceVtbl, DestroyPipeline)}, |
| 320 | {"vkDestroyPipelineCache", offsetof(DeviceVtbl, DestroyPipelineCache)}, |
| 321 | {"vkDestroyPipelineLayout", offsetof(DeviceVtbl, DestroyPipelineLayout)}, |
| 322 | {"vkDestroyQueryPool", offsetof(DeviceVtbl, DestroyQueryPool)}, |
| 323 | {"vkDestroyRenderPass", offsetof(DeviceVtbl, DestroyRenderPass)}, |
| 324 | {"vkDestroySampler", offsetof(DeviceVtbl, DestroySampler)}, |
| 325 | {"vkDestroySemaphore", offsetof(DeviceVtbl, DestroySemaphore)}, |
| 326 | {"vkDestroyShader", offsetof(DeviceVtbl, DestroyShader)}, |
| 327 | {"vkDestroyShaderModule", offsetof(DeviceVtbl, DestroyShaderModule)}, |
| 328 | {"vkDeviceWaitIdle", offsetof(DeviceVtbl, DeviceWaitIdle)}, |
| 329 | {"vkEndCommandBuffer", offsetof(DeviceVtbl, EndCommandBuffer)}, |
| 330 | {"vkFlushMappedMemoryRanges", offsetof(DeviceVtbl, FlushMappedMemoryRanges)}, |
| 331 | {"vkFreeDescriptorSets", offsetof(DeviceVtbl, FreeDescriptorSets)}, |
| 332 | {"vkFreeMemory", offsetof(DeviceVtbl, FreeMemory)}, |
| 333 | {"vkGetBufferMemoryRequirements", offsetof(DeviceVtbl, GetBufferMemoryRequirements)}, |
| 334 | {"vkGetDeviceMemoryCommitment", offsetof(DeviceVtbl, GetDeviceMemoryCommitment)}, |
| 335 | {"vkGetDeviceProcAddr", offsetof(DeviceVtbl, GetDeviceProcAddr)}, |
| 336 | {"vkGetDeviceQueue", offsetof(DeviceVtbl, GetDeviceQueue)}, |
| 337 | {"vkGetEventStatus", offsetof(DeviceVtbl, GetEventStatus)}, |
| 338 | {"vkGetFenceStatus", offsetof(DeviceVtbl, GetFenceStatus)}, |
| 339 | {"vkGetImageMemoryRequirements", offsetof(DeviceVtbl, GetImageMemoryRequirements)}, |
| 340 | {"vkGetImageSparseMemoryRequirements", offsetof(DeviceVtbl, GetImageSparseMemoryRequirements)}, |
| 341 | {"vkGetImageSubresourceLayout", offsetof(DeviceVtbl, GetImageSubresourceLayout)}, |
| 342 | {"vkGetPipelineCacheData", offsetof(DeviceVtbl, GetPipelineCacheData)}, |
| 343 | {"vkGetPipelineCacheSize", offsetof(DeviceVtbl, GetPipelineCacheSize)}, |
| 344 | {"vkGetQueryPoolResults", offsetof(DeviceVtbl, GetQueryPoolResults)}, |
| 345 | {"vkGetRenderAreaGranularity", offsetof(DeviceVtbl, GetRenderAreaGranularity)}, |
| 346 | {"vkInvalidateMappedMemoryRanges", offsetof(DeviceVtbl, InvalidateMappedMemoryRanges)}, |
| 347 | {"vkMapMemory", offsetof(DeviceVtbl, MapMemory)}, |
| 348 | {"vkMergePipelineCaches", offsetof(DeviceVtbl, MergePipelineCaches)}, |
| 349 | {"vkQueueBindSparseBufferMemory", offsetof(DeviceVtbl, QueueBindSparseBufferMemory)}, |
| 350 | {"vkQueueBindSparseImageMemory", offsetof(DeviceVtbl, QueueBindSparseImageMemory)}, |
| 351 | {"vkQueueBindSparseImageOpaqueMemory", offsetof(DeviceVtbl, QueueBindSparseImageOpaqueMemory)}, |
| 352 | {"vkQueueSignalSemaphore", offsetof(DeviceVtbl, QueueSignalSemaphore)}, |
| 353 | {"vkQueueSubmit", offsetof(DeviceVtbl, QueueSubmit)}, |
| 354 | {"vkQueueWaitIdle", offsetof(DeviceVtbl, QueueWaitIdle)}, |
| 355 | {"vkQueueWaitSemaphore", offsetof(DeviceVtbl, QueueWaitSemaphore)}, |
| 356 | {"vkResetCommandBuffer", offsetof(DeviceVtbl, ResetCommandBuffer)}, |
| 357 | {"vkResetCommandPool", offsetof(DeviceVtbl, ResetCommandPool)}, |
| 358 | {"vkResetDescriptorPool", offsetof(DeviceVtbl, ResetDescriptorPool)}, |
| 359 | {"vkResetEvent", offsetof(DeviceVtbl, ResetEvent)}, |
| 360 | {"vkResetFences", offsetof(DeviceVtbl, ResetFences)}, |
| 361 | {"vkSetEvent", offsetof(DeviceVtbl, SetEvent)}, |
| 362 | {"vkUnmapMemory", offsetof(DeviceVtbl, UnmapMemory)}, |
| 363 | {"vkUpdateDescriptorSets", offsetof(DeviceVtbl, UpdateDescriptorSets)}, |
| 364 | {"vkWaitForFences", offsetof(DeviceVtbl, WaitForFences)}, |
| 365 | // clang-format on |
| 366 | }; |
| 367 | |
| 368 | } // namespace |
| 369 | |
| 370 | namespace vulkan { |
| 371 | |
| 372 | PFN_vkVoidFunction GetGlobalInstanceProcAddr(const char* name) { |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 373 | const NameProcEntry* entry = FindProcEntry(kInstanceProcTbl, name); |
| 374 | if (entry) |
| 375 | return entry->proc; |
| 376 | // vkGetDeviceProcAddr must be available at the global/instance level for |
| 377 | // bootstrapping |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 378 | if (strcmp(name, "vkGetDeviceProcAddr") == 0) |
| 379 | return reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceProcAddr); |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 380 | // special-case extension functions until they can be auto-generated |
| 381 | if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0) |
| 382 | return reinterpret_cast<PFN_vkVoidFunction>( |
| 383 | vkGetPhysicalDeviceSurfaceSupportKHR); |
| 384 | return nullptr; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 385 | } |
| 386 | |
| 387 | PFN_vkVoidFunction GetGlobalDeviceProcAddr(const char* name) { |
| 388 | const NameProcEntry* entry = FindProcEntry(kDeviceProcTbl, name); |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 389 | if (entry) |
| 390 | return entry->proc; |
| 391 | // special-case extension functions until they can be auto-generated |
| 392 | if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0) |
| 393 | return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePropertiesKHR); |
| 394 | if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0) |
| 395 | return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfaceFormatsKHR); |
| 396 | if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0) |
| 397 | return reinterpret_cast<PFN_vkVoidFunction>( |
| 398 | vkGetSurfacePresentModesKHR); |
| 399 | if (strcmp(name, "vkCreateSwapchainKHR") == 0) |
| 400 | return reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR); |
| 401 | if (strcmp(name, "vkDestroySwapchainKHR") == 0) |
| 402 | return reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR); |
| 403 | if (strcmp(name, "vkGetSwapchainImagesKHR") == 0) |
| 404 | return reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR); |
| 405 | if (strcmp(name, "vkAcquireNextImageKHR") == 0) |
| 406 | return reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR); |
| 407 | if (strcmp(name, "vkQueuePresentKHR") == 0) |
| 408 | return reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR); |
| 409 | return nullptr; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | PFN_vkVoidFunction GetSpecificInstanceProcAddr(const InstanceVtbl* vtbl, |
| 413 | const char* name) { |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 414 | size_t offset; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 415 | const NameOffsetEntry* entry = FindProcEntry(kInstanceOffsetTbl, name); |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 416 | if (entry) |
| 417 | offset = entry->offset; |
| 418 | else if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0) |
| 419 | offset = offsetof(InstanceVtbl, GetPhysicalDeviceSurfaceSupportKHR); |
| 420 | else |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 421 | return nullptr; |
| 422 | const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl); |
| 423 | return reinterpret_cast<PFN_vkVoidFunction>( |
| 424 | const_cast<unsigned char*>(base) + entry->offset); |
| 425 | } |
| 426 | |
| 427 | PFN_vkVoidFunction GetSpecificDeviceProcAddr(const DeviceVtbl* vtbl, |
| 428 | const char* name) { |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 429 | size_t offset; |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 430 | const NameOffsetEntry* entry = FindProcEntry(kDeviceOffsetTbl, name); |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 431 | if (entry) |
| 432 | offset = entry->offset; |
| 433 | else if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0) |
| 434 | offset = offsetof(DeviceVtbl, GetSurfacePropertiesKHR); |
| 435 | else if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0) |
| 436 | offset = offsetof(DeviceVtbl, GetSurfaceFormatsKHR); |
| 437 | else if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0) |
| 438 | offset = offsetof(DeviceVtbl, GetSurfacePresentModesKHR); |
| 439 | else if (strcmp(name, "vkCreateSwapchainKHR") == 0) |
| 440 | offset = offsetof(DeviceVtbl, CreateSwapchainKHR); |
| 441 | else if (strcmp(name, "vkDestroySwapchainKHR") == 0) |
| 442 | offset = offsetof(DeviceVtbl, DestroySwapchainKHR); |
| 443 | else if (strcmp(name, "vkGetSwapchainImagesKHR") == 0) |
| 444 | offset = offsetof(DeviceVtbl, GetSwapchainImagesKHR); |
| 445 | else if (strcmp(name, "vkAcquireNextImageKHR") == 0) |
| 446 | offset = offsetof(DeviceVtbl, AcquireNextImageKHR); |
| 447 | else if (strcmp(name, "vkQueuePresentKHR") == 0) |
| 448 | offset = offsetof(DeviceVtbl, QueuePresentKHR); |
| 449 | else |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 450 | return nullptr; |
| 451 | const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl); |
| 452 | return reinterpret_cast<PFN_vkVoidFunction>( |
| 453 | const_cast<unsigned char*>(base) + entry->offset); |
| 454 | } |
| 455 | |
| 456 | bool LoadInstanceVtbl(VkInstance instance, |
| 457 | PFN_vkGetInstanceProcAddr get_proc_addr, |
| 458 | InstanceVtbl& vtbl) { |
| 459 | bool success = true; |
| 460 | // clang-format off |
| 461 | vtbl.DestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(get_proc_addr(instance, "vkDestroyInstance")); |
| 462 | if (UNLIKELY(!vtbl.DestroyInstance)) { |
| 463 | ALOGE("missing instance proc: %s", "vkDestroyInstance"); |
| 464 | success = false; |
| 465 | } |
| 466 | vtbl.EnumeratePhysicalDevices = reinterpret_cast<PFN_vkEnumeratePhysicalDevices>(get_proc_addr(instance, "vkEnumeratePhysicalDevices")); |
| 467 | if (UNLIKELY(!vtbl.EnumeratePhysicalDevices)) { |
| 468 | ALOGE("missing instance proc: %s", "vkEnumeratePhysicalDevices"); |
| 469 | success = false; |
| 470 | } |
| 471 | vtbl.GetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(get_proc_addr(instance, "vkGetInstanceProcAddr")); |
| 472 | if (UNLIKELY(!vtbl.GetInstanceProcAddr)) { |
| 473 | ALOGE("missing instance proc: %s", "vkGetInstanceProcAddr"); |
| 474 | success = false; |
| 475 | } |
| 476 | vtbl.GetPhysicalDeviceProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceProperties")); |
| 477 | if (UNLIKELY(!vtbl.GetPhysicalDeviceProperties)) { |
| 478 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceProperties"); |
| 479 | success = false; |
| 480 | } |
| 481 | vtbl.GetPhysicalDeviceQueueCount = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueCount>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueCount")); |
| 482 | if (UNLIKELY(!vtbl.GetPhysicalDeviceQueueCount)) { |
| 483 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueCount"); |
| 484 | success = false; |
| 485 | } |
| 486 | vtbl.GetPhysicalDeviceQueueProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueProperties")); |
| 487 | if (UNLIKELY(!vtbl.GetPhysicalDeviceQueueProperties)) { |
| 488 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueProperties"); |
| 489 | success = false; |
| 490 | } |
| 491 | vtbl.GetPhysicalDeviceMemoryProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceMemoryProperties")); |
| 492 | if (UNLIKELY(!vtbl.GetPhysicalDeviceMemoryProperties)) { |
| 493 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceMemoryProperties"); |
| 494 | success = false; |
| 495 | } |
| 496 | vtbl.GetPhysicalDeviceFeatures = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures>(get_proc_addr(instance, "vkGetPhysicalDeviceFeatures")); |
| 497 | if (UNLIKELY(!vtbl.GetPhysicalDeviceFeatures)) { |
| 498 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceFeatures"); |
| 499 | success = false; |
| 500 | } |
| 501 | vtbl.GetPhysicalDeviceFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceFormatProperties")); |
| 502 | if (UNLIKELY(!vtbl.GetPhysicalDeviceFormatProperties)) { |
| 503 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceFormatProperties"); |
| 504 | success = false; |
| 505 | } |
| 506 | vtbl.GetPhysicalDeviceImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceImageFormatProperties")); |
| 507 | if (UNLIKELY(!vtbl.GetPhysicalDeviceImageFormatProperties)) { |
| 508 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceImageFormatProperties"); |
| 509 | success = false; |
| 510 | } |
| 511 | vtbl.GetPhysicalDeviceLimits = reinterpret_cast<PFN_vkGetPhysicalDeviceLimits>(get_proc_addr(instance, "vkGetPhysicalDeviceLimits")); |
| 512 | if (UNLIKELY(!vtbl.GetPhysicalDeviceLimits)) { |
| 513 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceLimits"); |
| 514 | success = false; |
| 515 | } |
| 516 | vtbl.CreateDevice = reinterpret_cast<PFN_vkCreateDevice>(get_proc_addr(instance, "vkCreateDevice")); |
| 517 | if (UNLIKELY(!vtbl.CreateDevice)) { |
| 518 | ALOGE("missing instance proc: %s", "vkCreateDevice"); |
| 519 | success = false; |
| 520 | } |
| 521 | vtbl.GetPhysicalDeviceLayerProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceLayerProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceLayerProperties")); |
| 522 | if (UNLIKELY(!vtbl.GetPhysicalDeviceLayerProperties)) { |
| 523 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceLayerProperties"); |
| 524 | success = false; |
| 525 | } |
| 526 | vtbl.GetPhysicalDeviceExtensionProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceExtensionProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceExtensionProperties")); |
| 527 | if (UNLIKELY(!vtbl.GetPhysicalDeviceExtensionProperties)) { |
| 528 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceExtensionProperties"); |
| 529 | success = false; |
| 530 | } |
| 531 | vtbl.GetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties")); |
| 532 | if (UNLIKELY(!vtbl.GetPhysicalDeviceSparseImageFormatProperties)) { |
| 533 | ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSparseImageFormatProperties"); |
| 534 | success = false; |
| 535 | } |
| 536 | // clang-format on |
| 537 | return success; |
| 538 | } |
| 539 | |
| 540 | bool LoadDeviceVtbl(VkDevice device, |
| 541 | PFN_vkGetDeviceProcAddr get_proc_addr, |
| 542 | DeviceVtbl& vtbl) { |
| 543 | bool success = true; |
| 544 | // clang-format off |
| 545 | vtbl.GetDeviceProcAddr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(get_proc_addr(device, "vkGetDeviceProcAddr")); |
| 546 | if (UNLIKELY(!vtbl.GetDeviceProcAddr)) { |
| 547 | ALOGE("missing device proc: %s", "vkGetDeviceProcAddr"); |
| 548 | success = false; |
| 549 | } |
| 550 | vtbl.DestroyDevice = reinterpret_cast<PFN_vkDestroyDevice>(get_proc_addr(device, "vkDestroyDevice")); |
| 551 | if (UNLIKELY(!vtbl.DestroyDevice)) { |
| 552 | ALOGE("missing device proc: %s", "vkDestroyDevice"); |
| 553 | success = false; |
| 554 | } |
| 555 | vtbl.GetDeviceQueue = reinterpret_cast<PFN_vkGetDeviceQueue>(get_proc_addr(device, "vkGetDeviceQueue")); |
| 556 | if (UNLIKELY(!vtbl.GetDeviceQueue)) { |
| 557 | ALOGE("missing device proc: %s", "vkGetDeviceQueue"); |
| 558 | success = false; |
| 559 | } |
| 560 | vtbl.QueueSubmit = reinterpret_cast<PFN_vkQueueSubmit>(get_proc_addr(device, "vkQueueSubmit")); |
| 561 | if (UNLIKELY(!vtbl.QueueSubmit)) { |
| 562 | ALOGE("missing device proc: %s", "vkQueueSubmit"); |
| 563 | success = false; |
| 564 | } |
| 565 | vtbl.QueueWaitIdle = reinterpret_cast<PFN_vkQueueWaitIdle>(get_proc_addr(device, "vkQueueWaitIdle")); |
| 566 | if (UNLIKELY(!vtbl.QueueWaitIdle)) { |
| 567 | ALOGE("missing device proc: %s", "vkQueueWaitIdle"); |
| 568 | success = false; |
| 569 | } |
| 570 | vtbl.DeviceWaitIdle = reinterpret_cast<PFN_vkDeviceWaitIdle>(get_proc_addr(device, "vkDeviceWaitIdle")); |
| 571 | if (UNLIKELY(!vtbl.DeviceWaitIdle)) { |
| 572 | ALOGE("missing device proc: %s", "vkDeviceWaitIdle"); |
| 573 | success = false; |
| 574 | } |
| 575 | vtbl.AllocMemory = reinterpret_cast<PFN_vkAllocMemory>(get_proc_addr(device, "vkAllocMemory")); |
| 576 | if (UNLIKELY(!vtbl.AllocMemory)) { |
| 577 | ALOGE("missing device proc: %s", "vkAllocMemory"); |
| 578 | success = false; |
| 579 | } |
| 580 | vtbl.FreeMemory = reinterpret_cast<PFN_vkFreeMemory>(get_proc_addr(device, "vkFreeMemory")); |
| 581 | if (UNLIKELY(!vtbl.FreeMemory)) { |
| 582 | ALOGE("missing device proc: %s", "vkFreeMemory"); |
| 583 | success = false; |
| 584 | } |
| 585 | vtbl.MapMemory = reinterpret_cast<PFN_vkMapMemory>(get_proc_addr(device, "vkMapMemory")); |
| 586 | if (UNLIKELY(!vtbl.MapMemory)) { |
| 587 | ALOGE("missing device proc: %s", "vkMapMemory"); |
| 588 | success = false; |
| 589 | } |
| 590 | vtbl.UnmapMemory = reinterpret_cast<PFN_vkUnmapMemory>(get_proc_addr(device, "vkUnmapMemory")); |
| 591 | if (UNLIKELY(!vtbl.UnmapMemory)) { |
| 592 | ALOGE("missing device proc: %s", "vkUnmapMemory"); |
| 593 | success = false; |
| 594 | } |
| 595 | vtbl.FlushMappedMemoryRanges = reinterpret_cast<PFN_vkFlushMappedMemoryRanges>(get_proc_addr(device, "vkFlushMappedMemoryRanges")); |
| 596 | if (UNLIKELY(!vtbl.FlushMappedMemoryRanges)) { |
| 597 | ALOGE("missing device proc: %s", "vkFlushMappedMemoryRanges"); |
| 598 | success = false; |
| 599 | } |
| 600 | vtbl.InvalidateMappedMemoryRanges = reinterpret_cast<PFN_vkInvalidateMappedMemoryRanges>(get_proc_addr(device, "vkInvalidateMappedMemoryRanges")); |
| 601 | if (UNLIKELY(!vtbl.InvalidateMappedMemoryRanges)) { |
| 602 | ALOGE("missing device proc: %s", "vkInvalidateMappedMemoryRanges"); |
| 603 | success = false; |
| 604 | } |
| 605 | vtbl.GetDeviceMemoryCommitment = reinterpret_cast<PFN_vkGetDeviceMemoryCommitment>(get_proc_addr(device, "vkGetDeviceMemoryCommitment")); |
| 606 | if (UNLIKELY(!vtbl.GetDeviceMemoryCommitment)) { |
| 607 | ALOGE("missing device proc: %s", "vkGetDeviceMemoryCommitment"); |
| 608 | success = false; |
| 609 | } |
| 610 | vtbl.GetBufferMemoryRequirements = reinterpret_cast<PFN_vkGetBufferMemoryRequirements>(get_proc_addr(device, "vkGetBufferMemoryRequirements")); |
| 611 | if (UNLIKELY(!vtbl.GetBufferMemoryRequirements)) { |
| 612 | ALOGE("missing device proc: %s", "vkGetBufferMemoryRequirements"); |
| 613 | success = false; |
| 614 | } |
| 615 | vtbl.BindBufferMemory = reinterpret_cast<PFN_vkBindBufferMemory>(get_proc_addr(device, "vkBindBufferMemory")); |
| 616 | if (UNLIKELY(!vtbl.BindBufferMemory)) { |
| 617 | ALOGE("missing device proc: %s", "vkBindBufferMemory"); |
| 618 | success = false; |
| 619 | } |
| 620 | vtbl.GetImageMemoryRequirements = reinterpret_cast<PFN_vkGetImageMemoryRequirements>(get_proc_addr(device, "vkGetImageMemoryRequirements")); |
| 621 | if (UNLIKELY(!vtbl.GetImageMemoryRequirements)) { |
| 622 | ALOGE("missing device proc: %s", "vkGetImageMemoryRequirements"); |
| 623 | success = false; |
| 624 | } |
| 625 | vtbl.BindImageMemory = reinterpret_cast<PFN_vkBindImageMemory>(get_proc_addr(device, "vkBindImageMemory")); |
| 626 | if (UNLIKELY(!vtbl.BindImageMemory)) { |
| 627 | ALOGE("missing device proc: %s", "vkBindImageMemory"); |
| 628 | success = false; |
| 629 | } |
| 630 | vtbl.GetImageSparseMemoryRequirements = reinterpret_cast<PFN_vkGetImageSparseMemoryRequirements>(get_proc_addr(device, "vkGetImageSparseMemoryRequirements")); |
| 631 | if (UNLIKELY(!vtbl.GetImageSparseMemoryRequirements)) { |
| 632 | ALOGE("missing device proc: %s", "vkGetImageSparseMemoryRequirements"); |
| 633 | success = false; |
| 634 | } |
| 635 | vtbl.QueueBindSparseBufferMemory = reinterpret_cast<PFN_vkQueueBindSparseBufferMemory>(get_proc_addr(device, "vkQueueBindSparseBufferMemory")); |
| 636 | if (UNLIKELY(!vtbl.QueueBindSparseBufferMemory)) { |
| 637 | ALOGE("missing device proc: %s", "vkQueueBindSparseBufferMemory"); |
| 638 | success = false; |
| 639 | } |
| 640 | vtbl.QueueBindSparseImageOpaqueMemory = reinterpret_cast<PFN_vkQueueBindSparseImageOpaqueMemory>(get_proc_addr(device, "vkQueueBindSparseImageOpaqueMemory")); |
| 641 | if (UNLIKELY(!vtbl.QueueBindSparseImageOpaqueMemory)) { |
| 642 | ALOGE("missing device proc: %s", "vkQueueBindSparseImageOpaqueMemory"); |
| 643 | success = false; |
| 644 | } |
| 645 | vtbl.QueueBindSparseImageMemory = reinterpret_cast<PFN_vkQueueBindSparseImageMemory>(get_proc_addr(device, "vkQueueBindSparseImageMemory")); |
| 646 | if (UNLIKELY(!vtbl.QueueBindSparseImageMemory)) { |
| 647 | ALOGE("missing device proc: %s", "vkQueueBindSparseImageMemory"); |
| 648 | success = false; |
| 649 | } |
| 650 | vtbl.CreateFence = reinterpret_cast<PFN_vkCreateFence>(get_proc_addr(device, "vkCreateFence")); |
| 651 | if (UNLIKELY(!vtbl.CreateFence)) { |
| 652 | ALOGE("missing device proc: %s", "vkCreateFence"); |
| 653 | success = false; |
| 654 | } |
| 655 | vtbl.DestroyFence = reinterpret_cast<PFN_vkDestroyFence>(get_proc_addr(device, "vkDestroyFence")); |
| 656 | if (UNLIKELY(!vtbl.DestroyFence)) { |
| 657 | ALOGE("missing device proc: %s", "vkDestroyFence"); |
| 658 | success = false; |
| 659 | } |
| 660 | vtbl.ResetFences = reinterpret_cast<PFN_vkResetFences>(get_proc_addr(device, "vkResetFences")); |
| 661 | if (UNLIKELY(!vtbl.ResetFences)) { |
| 662 | ALOGE("missing device proc: %s", "vkResetFences"); |
| 663 | success = false; |
| 664 | } |
| 665 | vtbl.GetFenceStatus = reinterpret_cast<PFN_vkGetFenceStatus>(get_proc_addr(device, "vkGetFenceStatus")); |
| 666 | if (UNLIKELY(!vtbl.GetFenceStatus)) { |
| 667 | ALOGE("missing device proc: %s", "vkGetFenceStatus"); |
| 668 | success = false; |
| 669 | } |
| 670 | vtbl.WaitForFences = reinterpret_cast<PFN_vkWaitForFences>(get_proc_addr(device, "vkWaitForFences")); |
| 671 | if (UNLIKELY(!vtbl.WaitForFences)) { |
| 672 | ALOGE("missing device proc: %s", "vkWaitForFences"); |
| 673 | success = false; |
| 674 | } |
| 675 | vtbl.CreateSemaphore = reinterpret_cast<PFN_vkCreateSemaphore>(get_proc_addr(device, "vkCreateSemaphore")); |
| 676 | if (UNLIKELY(!vtbl.CreateSemaphore)) { |
| 677 | ALOGE("missing device proc: %s", "vkCreateSemaphore"); |
| 678 | success = false; |
| 679 | } |
| 680 | vtbl.DestroySemaphore = reinterpret_cast<PFN_vkDestroySemaphore>(get_proc_addr(device, "vkDestroySemaphore")); |
| 681 | if (UNLIKELY(!vtbl.DestroySemaphore)) { |
| 682 | ALOGE("missing device proc: %s", "vkDestroySemaphore"); |
| 683 | success = false; |
| 684 | } |
| 685 | vtbl.QueueSignalSemaphore = reinterpret_cast<PFN_vkQueueSignalSemaphore>(get_proc_addr(device, "vkQueueSignalSemaphore")); |
| 686 | if (UNLIKELY(!vtbl.QueueSignalSemaphore)) { |
| 687 | ALOGE("missing device proc: %s", "vkQueueSignalSemaphore"); |
| 688 | success = false; |
| 689 | } |
| 690 | vtbl.QueueWaitSemaphore = reinterpret_cast<PFN_vkQueueWaitSemaphore>(get_proc_addr(device, "vkQueueWaitSemaphore")); |
| 691 | if (UNLIKELY(!vtbl.QueueWaitSemaphore)) { |
| 692 | ALOGE("missing device proc: %s", "vkQueueWaitSemaphore"); |
| 693 | success = false; |
| 694 | } |
| 695 | vtbl.CreateEvent = reinterpret_cast<PFN_vkCreateEvent>(get_proc_addr(device, "vkCreateEvent")); |
| 696 | if (UNLIKELY(!vtbl.CreateEvent)) { |
| 697 | ALOGE("missing device proc: %s", "vkCreateEvent"); |
| 698 | success = false; |
| 699 | } |
| 700 | vtbl.DestroyEvent = reinterpret_cast<PFN_vkDestroyEvent>(get_proc_addr(device, "vkDestroyEvent")); |
| 701 | if (UNLIKELY(!vtbl.DestroyEvent)) { |
| 702 | ALOGE("missing device proc: %s", "vkDestroyEvent"); |
| 703 | success = false; |
| 704 | } |
| 705 | vtbl.GetEventStatus = reinterpret_cast<PFN_vkGetEventStatus>(get_proc_addr(device, "vkGetEventStatus")); |
| 706 | if (UNLIKELY(!vtbl.GetEventStatus)) { |
| 707 | ALOGE("missing device proc: %s", "vkGetEventStatus"); |
| 708 | success = false; |
| 709 | } |
| 710 | vtbl.SetEvent = reinterpret_cast<PFN_vkSetEvent>(get_proc_addr(device, "vkSetEvent")); |
| 711 | if (UNLIKELY(!vtbl.SetEvent)) { |
| 712 | ALOGE("missing device proc: %s", "vkSetEvent"); |
| 713 | success = false; |
| 714 | } |
| 715 | vtbl.ResetEvent = reinterpret_cast<PFN_vkResetEvent>(get_proc_addr(device, "vkResetEvent")); |
| 716 | if (UNLIKELY(!vtbl.ResetEvent)) { |
| 717 | ALOGE("missing device proc: %s", "vkResetEvent"); |
| 718 | success = false; |
| 719 | } |
| 720 | vtbl.CreateQueryPool = reinterpret_cast<PFN_vkCreateQueryPool>(get_proc_addr(device, "vkCreateQueryPool")); |
| 721 | if (UNLIKELY(!vtbl.CreateQueryPool)) { |
| 722 | ALOGE("missing device proc: %s", "vkCreateQueryPool"); |
| 723 | success = false; |
| 724 | } |
| 725 | vtbl.DestroyQueryPool = reinterpret_cast<PFN_vkDestroyQueryPool>(get_proc_addr(device, "vkDestroyQueryPool")); |
| 726 | if (UNLIKELY(!vtbl.DestroyQueryPool)) { |
| 727 | ALOGE("missing device proc: %s", "vkDestroyQueryPool"); |
| 728 | success = false; |
| 729 | } |
| 730 | vtbl.GetQueryPoolResults = reinterpret_cast<PFN_vkGetQueryPoolResults>(get_proc_addr(device, "vkGetQueryPoolResults")); |
| 731 | if (UNLIKELY(!vtbl.GetQueryPoolResults)) { |
| 732 | ALOGE("missing device proc: %s", "vkGetQueryPoolResults"); |
| 733 | success = false; |
| 734 | } |
| 735 | vtbl.CreateBuffer = reinterpret_cast<PFN_vkCreateBuffer>(get_proc_addr(device, "vkCreateBuffer")); |
| 736 | if (UNLIKELY(!vtbl.CreateBuffer)) { |
| 737 | ALOGE("missing device proc: %s", "vkCreateBuffer"); |
| 738 | success = false; |
| 739 | } |
| 740 | vtbl.DestroyBuffer = reinterpret_cast<PFN_vkDestroyBuffer>(get_proc_addr(device, "vkDestroyBuffer")); |
| 741 | if (UNLIKELY(!vtbl.DestroyBuffer)) { |
| 742 | ALOGE("missing device proc: %s", "vkDestroyBuffer"); |
| 743 | success = false; |
| 744 | } |
| 745 | vtbl.CreateBufferView = reinterpret_cast<PFN_vkCreateBufferView>(get_proc_addr(device, "vkCreateBufferView")); |
| 746 | if (UNLIKELY(!vtbl.CreateBufferView)) { |
| 747 | ALOGE("missing device proc: %s", "vkCreateBufferView"); |
| 748 | success = false; |
| 749 | } |
| 750 | vtbl.DestroyBufferView = reinterpret_cast<PFN_vkDestroyBufferView>(get_proc_addr(device, "vkDestroyBufferView")); |
| 751 | if (UNLIKELY(!vtbl.DestroyBufferView)) { |
| 752 | ALOGE("missing device proc: %s", "vkDestroyBufferView"); |
| 753 | success = false; |
| 754 | } |
| 755 | vtbl.CreateImage = reinterpret_cast<PFN_vkCreateImage>(get_proc_addr(device, "vkCreateImage")); |
| 756 | if (UNLIKELY(!vtbl.CreateImage)) { |
| 757 | ALOGE("missing device proc: %s", "vkCreateImage"); |
| 758 | success = false; |
| 759 | } |
| 760 | vtbl.DestroyImage = reinterpret_cast<PFN_vkDestroyImage>(get_proc_addr(device, "vkDestroyImage")); |
| 761 | if (UNLIKELY(!vtbl.DestroyImage)) { |
| 762 | ALOGE("missing device proc: %s", "vkDestroyImage"); |
| 763 | success = false; |
| 764 | } |
| 765 | vtbl.GetImageSubresourceLayout = reinterpret_cast<PFN_vkGetImageSubresourceLayout>(get_proc_addr(device, "vkGetImageSubresourceLayout")); |
| 766 | if (UNLIKELY(!vtbl.GetImageSubresourceLayout)) { |
| 767 | ALOGE("missing device proc: %s", "vkGetImageSubresourceLayout"); |
| 768 | success = false; |
| 769 | } |
| 770 | vtbl.CreateImageView = reinterpret_cast<PFN_vkCreateImageView>(get_proc_addr(device, "vkCreateImageView")); |
| 771 | if (UNLIKELY(!vtbl.CreateImageView)) { |
| 772 | ALOGE("missing device proc: %s", "vkCreateImageView"); |
| 773 | success = false; |
| 774 | } |
| 775 | vtbl.DestroyImageView = reinterpret_cast<PFN_vkDestroyImageView>(get_proc_addr(device, "vkDestroyImageView")); |
| 776 | if (UNLIKELY(!vtbl.DestroyImageView)) { |
| 777 | ALOGE("missing device proc: %s", "vkDestroyImageView"); |
| 778 | success = false; |
| 779 | } |
| 780 | vtbl.CreateAttachmentView = reinterpret_cast<PFN_vkCreateAttachmentView>(get_proc_addr(device, "vkCreateAttachmentView")); |
| 781 | if (UNLIKELY(!vtbl.CreateAttachmentView)) { |
| 782 | ALOGE("missing device proc: %s", "vkCreateAttachmentView"); |
| 783 | success = false; |
| 784 | } |
| 785 | vtbl.DestroyAttachmentView = reinterpret_cast<PFN_vkDestroyAttachmentView>(get_proc_addr(device, "vkDestroyAttachmentView")); |
| 786 | if (UNLIKELY(!vtbl.DestroyAttachmentView)) { |
| 787 | ALOGE("missing device proc: %s", "vkDestroyAttachmentView"); |
| 788 | success = false; |
| 789 | } |
| 790 | vtbl.CreateShaderModule = reinterpret_cast<PFN_vkCreateShaderModule>(get_proc_addr(device, "vkCreateShaderModule")); |
| 791 | if (UNLIKELY(!vtbl.CreateShaderModule)) { |
| 792 | ALOGE("missing device proc: %s", "vkCreateShaderModule"); |
| 793 | success = false; |
| 794 | } |
| 795 | vtbl.DestroyShaderModule = reinterpret_cast<PFN_vkDestroyShaderModule>(get_proc_addr(device, "vkDestroyShaderModule")); |
| 796 | if (UNLIKELY(!vtbl.DestroyShaderModule)) { |
| 797 | ALOGE("missing device proc: %s", "vkDestroyShaderModule"); |
| 798 | success = false; |
| 799 | } |
| 800 | vtbl.CreateShader = reinterpret_cast<PFN_vkCreateShader>(get_proc_addr(device, "vkCreateShader")); |
| 801 | if (UNLIKELY(!vtbl.CreateShader)) { |
| 802 | ALOGE("missing device proc: %s", "vkCreateShader"); |
| 803 | success = false; |
| 804 | } |
| 805 | vtbl.DestroyShader = reinterpret_cast<PFN_vkDestroyShader>(get_proc_addr(device, "vkDestroyShader")); |
| 806 | if (UNLIKELY(!vtbl.DestroyShader)) { |
| 807 | ALOGE("missing device proc: %s", "vkDestroyShader"); |
| 808 | success = false; |
| 809 | } |
| 810 | vtbl.CreatePipelineCache = reinterpret_cast<PFN_vkCreatePipelineCache>(get_proc_addr(device, "vkCreatePipelineCache")); |
| 811 | if (UNLIKELY(!vtbl.CreatePipelineCache)) { |
| 812 | ALOGE("missing device proc: %s", "vkCreatePipelineCache"); |
| 813 | success = false; |
| 814 | } |
| 815 | vtbl.DestroyPipelineCache = reinterpret_cast<PFN_vkDestroyPipelineCache>(get_proc_addr(device, "vkDestroyPipelineCache")); |
| 816 | if (UNLIKELY(!vtbl.DestroyPipelineCache)) { |
| 817 | ALOGE("missing device proc: %s", "vkDestroyPipelineCache"); |
| 818 | success = false; |
| 819 | } |
| 820 | vtbl.GetPipelineCacheSize = reinterpret_cast<PFN_vkGetPipelineCacheSize>(get_proc_addr(device, "vkGetPipelineCacheSize")); |
| 821 | if (UNLIKELY(!vtbl.GetPipelineCacheSize)) { |
| 822 | ALOGE("missing device proc: %s", "vkGetPipelineCacheSize"); |
| 823 | success = false; |
| 824 | } |
| 825 | vtbl.GetPipelineCacheData = reinterpret_cast<PFN_vkGetPipelineCacheData>(get_proc_addr(device, "vkGetPipelineCacheData")); |
| 826 | if (UNLIKELY(!vtbl.GetPipelineCacheData)) { |
| 827 | ALOGE("missing device proc: %s", "vkGetPipelineCacheData"); |
| 828 | success = false; |
| 829 | } |
| 830 | vtbl.MergePipelineCaches = reinterpret_cast<PFN_vkMergePipelineCaches>(get_proc_addr(device, "vkMergePipelineCaches")); |
| 831 | if (UNLIKELY(!vtbl.MergePipelineCaches)) { |
| 832 | ALOGE("missing device proc: %s", "vkMergePipelineCaches"); |
| 833 | success = false; |
| 834 | } |
| 835 | vtbl.CreateGraphicsPipelines = reinterpret_cast<PFN_vkCreateGraphicsPipelines>(get_proc_addr(device, "vkCreateGraphicsPipelines")); |
| 836 | if (UNLIKELY(!vtbl.CreateGraphicsPipelines)) { |
| 837 | ALOGE("missing device proc: %s", "vkCreateGraphicsPipelines"); |
| 838 | success = false; |
| 839 | } |
| 840 | vtbl.CreateComputePipelines = reinterpret_cast<PFN_vkCreateComputePipelines>(get_proc_addr(device, "vkCreateComputePipelines")); |
| 841 | if (UNLIKELY(!vtbl.CreateComputePipelines)) { |
| 842 | ALOGE("missing device proc: %s", "vkCreateComputePipelines"); |
| 843 | success = false; |
| 844 | } |
| 845 | vtbl.DestroyPipeline = reinterpret_cast<PFN_vkDestroyPipeline>(get_proc_addr(device, "vkDestroyPipeline")); |
| 846 | if (UNLIKELY(!vtbl.DestroyPipeline)) { |
| 847 | ALOGE("missing device proc: %s", "vkDestroyPipeline"); |
| 848 | success = false; |
| 849 | } |
| 850 | vtbl.CreatePipelineLayout = reinterpret_cast<PFN_vkCreatePipelineLayout>(get_proc_addr(device, "vkCreatePipelineLayout")); |
| 851 | if (UNLIKELY(!vtbl.CreatePipelineLayout)) { |
| 852 | ALOGE("missing device proc: %s", "vkCreatePipelineLayout"); |
| 853 | success = false; |
| 854 | } |
| 855 | vtbl.DestroyPipelineLayout = reinterpret_cast<PFN_vkDestroyPipelineLayout>(get_proc_addr(device, "vkDestroyPipelineLayout")); |
| 856 | if (UNLIKELY(!vtbl.DestroyPipelineLayout)) { |
| 857 | ALOGE("missing device proc: %s", "vkDestroyPipelineLayout"); |
| 858 | success = false; |
| 859 | } |
| 860 | vtbl.CreateSampler = reinterpret_cast<PFN_vkCreateSampler>(get_proc_addr(device, "vkCreateSampler")); |
| 861 | if (UNLIKELY(!vtbl.CreateSampler)) { |
| 862 | ALOGE("missing device proc: %s", "vkCreateSampler"); |
| 863 | success = false; |
| 864 | } |
| 865 | vtbl.DestroySampler = reinterpret_cast<PFN_vkDestroySampler>(get_proc_addr(device, "vkDestroySampler")); |
| 866 | if (UNLIKELY(!vtbl.DestroySampler)) { |
| 867 | ALOGE("missing device proc: %s", "vkDestroySampler"); |
| 868 | success = false; |
| 869 | } |
| 870 | vtbl.CreateDescriptorSetLayout = reinterpret_cast<PFN_vkCreateDescriptorSetLayout>(get_proc_addr(device, "vkCreateDescriptorSetLayout")); |
| 871 | if (UNLIKELY(!vtbl.CreateDescriptorSetLayout)) { |
| 872 | ALOGE("missing device proc: %s", "vkCreateDescriptorSetLayout"); |
| 873 | success = false; |
| 874 | } |
| 875 | vtbl.DestroyDescriptorSetLayout = reinterpret_cast<PFN_vkDestroyDescriptorSetLayout>(get_proc_addr(device, "vkDestroyDescriptorSetLayout")); |
| 876 | if (UNLIKELY(!vtbl.DestroyDescriptorSetLayout)) { |
| 877 | ALOGE("missing device proc: %s", "vkDestroyDescriptorSetLayout"); |
| 878 | success = false; |
| 879 | } |
| 880 | vtbl.CreateDescriptorPool = reinterpret_cast<PFN_vkCreateDescriptorPool>(get_proc_addr(device, "vkCreateDescriptorPool")); |
| 881 | if (UNLIKELY(!vtbl.CreateDescriptorPool)) { |
| 882 | ALOGE("missing device proc: %s", "vkCreateDescriptorPool"); |
| 883 | success = false; |
| 884 | } |
| 885 | vtbl.DestroyDescriptorPool = reinterpret_cast<PFN_vkDestroyDescriptorPool>(get_proc_addr(device, "vkDestroyDescriptorPool")); |
| 886 | if (UNLIKELY(!vtbl.DestroyDescriptorPool)) { |
| 887 | ALOGE("missing device proc: %s", "vkDestroyDescriptorPool"); |
| 888 | success = false; |
| 889 | } |
| 890 | vtbl.ResetDescriptorPool = reinterpret_cast<PFN_vkResetDescriptorPool>(get_proc_addr(device, "vkResetDescriptorPool")); |
| 891 | if (UNLIKELY(!vtbl.ResetDescriptorPool)) { |
| 892 | ALOGE("missing device proc: %s", "vkResetDescriptorPool"); |
| 893 | success = false; |
| 894 | } |
| 895 | vtbl.AllocDescriptorSets = reinterpret_cast<PFN_vkAllocDescriptorSets>(get_proc_addr(device, "vkAllocDescriptorSets")); |
| 896 | if (UNLIKELY(!vtbl.AllocDescriptorSets)) { |
| 897 | ALOGE("missing device proc: %s", "vkAllocDescriptorSets"); |
| 898 | success = false; |
| 899 | } |
| 900 | vtbl.FreeDescriptorSets = reinterpret_cast<PFN_vkFreeDescriptorSets>(get_proc_addr(device, "vkFreeDescriptorSets")); |
| 901 | if (UNLIKELY(!vtbl.FreeDescriptorSets)) { |
| 902 | ALOGE("missing device proc: %s", "vkFreeDescriptorSets"); |
| 903 | success = false; |
| 904 | } |
| 905 | vtbl.UpdateDescriptorSets = reinterpret_cast<PFN_vkUpdateDescriptorSets>(get_proc_addr(device, "vkUpdateDescriptorSets")); |
| 906 | if (UNLIKELY(!vtbl.UpdateDescriptorSets)) { |
| 907 | ALOGE("missing device proc: %s", "vkUpdateDescriptorSets"); |
| 908 | success = false; |
| 909 | } |
| 910 | vtbl.CreateDynamicViewportState = reinterpret_cast<PFN_vkCreateDynamicViewportState>(get_proc_addr(device, "vkCreateDynamicViewportState")); |
| 911 | if (UNLIKELY(!vtbl.CreateDynamicViewportState)) { |
| 912 | ALOGE("missing device proc: %s", "vkCreateDynamicViewportState"); |
| 913 | success = false; |
| 914 | } |
| 915 | vtbl.DestroyDynamicViewportState = reinterpret_cast<PFN_vkDestroyDynamicViewportState>(get_proc_addr(device, "vkDestroyDynamicViewportState")); |
| 916 | if (UNLIKELY(!vtbl.DestroyDynamicViewportState)) { |
| 917 | ALOGE("missing device proc: %s", "vkDestroyDynamicViewportState"); |
| 918 | success = false; |
| 919 | } |
| 920 | vtbl.CreateDynamicRasterState = reinterpret_cast<PFN_vkCreateDynamicRasterState>(get_proc_addr(device, "vkCreateDynamicRasterState")); |
| 921 | if (UNLIKELY(!vtbl.CreateDynamicRasterState)) { |
| 922 | ALOGE("missing device proc: %s", "vkCreateDynamicRasterState"); |
| 923 | success = false; |
| 924 | } |
| 925 | vtbl.DestroyDynamicRasterState = reinterpret_cast<PFN_vkDestroyDynamicRasterState>(get_proc_addr(device, "vkDestroyDynamicRasterState")); |
| 926 | if (UNLIKELY(!vtbl.DestroyDynamicRasterState)) { |
| 927 | ALOGE("missing device proc: %s", "vkDestroyDynamicRasterState"); |
| 928 | success = false; |
| 929 | } |
| 930 | vtbl.CreateDynamicColorBlendState = reinterpret_cast<PFN_vkCreateDynamicColorBlendState>(get_proc_addr(device, "vkCreateDynamicColorBlendState")); |
| 931 | if (UNLIKELY(!vtbl.CreateDynamicColorBlendState)) { |
| 932 | ALOGE("missing device proc: %s", "vkCreateDynamicColorBlendState"); |
| 933 | success = false; |
| 934 | } |
| 935 | vtbl.DestroyDynamicColorBlendState = reinterpret_cast<PFN_vkDestroyDynamicColorBlendState>(get_proc_addr(device, "vkDestroyDynamicColorBlendState")); |
| 936 | if (UNLIKELY(!vtbl.DestroyDynamicColorBlendState)) { |
| 937 | ALOGE("missing device proc: %s", "vkDestroyDynamicColorBlendState"); |
| 938 | success = false; |
| 939 | } |
| 940 | vtbl.CreateDynamicDepthStencilState = reinterpret_cast<PFN_vkCreateDynamicDepthStencilState>(get_proc_addr(device, "vkCreateDynamicDepthStencilState")); |
| 941 | if (UNLIKELY(!vtbl.CreateDynamicDepthStencilState)) { |
| 942 | ALOGE("missing device proc: %s", "vkCreateDynamicDepthStencilState"); |
| 943 | success = false; |
| 944 | } |
| 945 | vtbl.DestroyDynamicDepthStencilState = reinterpret_cast<PFN_vkDestroyDynamicDepthStencilState>(get_proc_addr(device, "vkDestroyDynamicDepthStencilState")); |
| 946 | if (UNLIKELY(!vtbl.DestroyDynamicDepthStencilState)) { |
| 947 | ALOGE("missing device proc: %s", "vkDestroyDynamicDepthStencilState"); |
| 948 | success = false; |
| 949 | } |
| 950 | vtbl.CreateFramebuffer = reinterpret_cast<PFN_vkCreateFramebuffer>(get_proc_addr(device, "vkCreateFramebuffer")); |
| 951 | if (UNLIKELY(!vtbl.CreateFramebuffer)) { |
| 952 | ALOGE("missing device proc: %s", "vkCreateFramebuffer"); |
| 953 | success = false; |
| 954 | } |
| 955 | vtbl.DestroyFramebuffer = reinterpret_cast<PFN_vkDestroyFramebuffer>(get_proc_addr(device, "vkDestroyFramebuffer")); |
| 956 | if (UNLIKELY(!vtbl.DestroyFramebuffer)) { |
| 957 | ALOGE("missing device proc: %s", "vkDestroyFramebuffer"); |
| 958 | success = false; |
| 959 | } |
| 960 | vtbl.CreateRenderPass = reinterpret_cast<PFN_vkCreateRenderPass>(get_proc_addr(device, "vkCreateRenderPass")); |
| 961 | if (UNLIKELY(!vtbl.CreateRenderPass)) { |
| 962 | ALOGE("missing device proc: %s", "vkCreateRenderPass"); |
| 963 | success = false; |
| 964 | } |
| 965 | vtbl.DestroyRenderPass = reinterpret_cast<PFN_vkDestroyRenderPass>(get_proc_addr(device, "vkDestroyRenderPass")); |
| 966 | if (UNLIKELY(!vtbl.DestroyRenderPass)) { |
| 967 | ALOGE("missing device proc: %s", "vkDestroyRenderPass"); |
| 968 | success = false; |
| 969 | } |
| 970 | vtbl.GetRenderAreaGranularity = reinterpret_cast<PFN_vkGetRenderAreaGranularity>(get_proc_addr(device, "vkGetRenderAreaGranularity")); |
| 971 | if (UNLIKELY(!vtbl.GetRenderAreaGranularity)) { |
| 972 | ALOGE("missing device proc: %s", "vkGetRenderAreaGranularity"); |
| 973 | success = false; |
| 974 | } |
| 975 | vtbl.CreateCommandPool = reinterpret_cast<PFN_vkCreateCommandPool>(get_proc_addr(device, "vkCreateCommandPool")); |
| 976 | if (UNLIKELY(!vtbl.CreateCommandPool)) { |
| 977 | ALOGE("missing device proc: %s", "vkCreateCommandPool"); |
| 978 | success = false; |
| 979 | } |
| 980 | vtbl.DestroyCommandPool = reinterpret_cast<PFN_vkDestroyCommandPool>(get_proc_addr(device, "vkDestroyCommandPool")); |
| 981 | if (UNLIKELY(!vtbl.DestroyCommandPool)) { |
| 982 | ALOGE("missing device proc: %s", "vkDestroyCommandPool"); |
| 983 | success = false; |
| 984 | } |
| 985 | vtbl.ResetCommandPool = reinterpret_cast<PFN_vkResetCommandPool>(get_proc_addr(device, "vkResetCommandPool")); |
| 986 | if (UNLIKELY(!vtbl.ResetCommandPool)) { |
| 987 | ALOGE("missing device proc: %s", "vkResetCommandPool"); |
| 988 | success = false; |
| 989 | } |
| 990 | vtbl.CreateCommandBuffer = reinterpret_cast<PFN_vkCreateCommandBuffer>(get_proc_addr(device, "vkCreateCommandBuffer")); |
| 991 | if (UNLIKELY(!vtbl.CreateCommandBuffer)) { |
| 992 | ALOGE("missing device proc: %s", "vkCreateCommandBuffer"); |
| 993 | success = false; |
| 994 | } |
| 995 | vtbl.DestroyCommandBuffer = reinterpret_cast<PFN_vkDestroyCommandBuffer>(get_proc_addr(device, "vkDestroyCommandBuffer")); |
| 996 | if (UNLIKELY(!vtbl.DestroyCommandBuffer)) { |
| 997 | ALOGE("missing device proc: %s", "vkDestroyCommandBuffer"); |
| 998 | success = false; |
| 999 | } |
| 1000 | vtbl.BeginCommandBuffer = reinterpret_cast<PFN_vkBeginCommandBuffer>(get_proc_addr(device, "vkBeginCommandBuffer")); |
| 1001 | if (UNLIKELY(!vtbl.BeginCommandBuffer)) { |
| 1002 | ALOGE("missing device proc: %s", "vkBeginCommandBuffer"); |
| 1003 | success = false; |
| 1004 | } |
| 1005 | vtbl.EndCommandBuffer = reinterpret_cast<PFN_vkEndCommandBuffer>(get_proc_addr(device, "vkEndCommandBuffer")); |
| 1006 | if (UNLIKELY(!vtbl.EndCommandBuffer)) { |
| 1007 | ALOGE("missing device proc: %s", "vkEndCommandBuffer"); |
| 1008 | success = false; |
| 1009 | } |
| 1010 | vtbl.ResetCommandBuffer = reinterpret_cast<PFN_vkResetCommandBuffer>(get_proc_addr(device, "vkResetCommandBuffer")); |
| 1011 | if (UNLIKELY(!vtbl.ResetCommandBuffer)) { |
| 1012 | ALOGE("missing device proc: %s", "vkResetCommandBuffer"); |
| 1013 | success = false; |
| 1014 | } |
| 1015 | vtbl.CmdBindPipeline = reinterpret_cast<PFN_vkCmdBindPipeline>(get_proc_addr(device, "vkCmdBindPipeline")); |
| 1016 | if (UNLIKELY(!vtbl.CmdBindPipeline)) { |
| 1017 | ALOGE("missing device proc: %s", "vkCmdBindPipeline"); |
| 1018 | success = false; |
| 1019 | } |
| 1020 | vtbl.CmdBindDynamicViewportState = reinterpret_cast<PFN_vkCmdBindDynamicViewportState>(get_proc_addr(device, "vkCmdBindDynamicViewportState")); |
| 1021 | if (UNLIKELY(!vtbl.CmdBindDynamicViewportState)) { |
| 1022 | ALOGE("missing device proc: %s", "vkCmdBindDynamicViewportState"); |
| 1023 | success = false; |
| 1024 | } |
| 1025 | vtbl.CmdBindDynamicRasterState = reinterpret_cast<PFN_vkCmdBindDynamicRasterState>(get_proc_addr(device, "vkCmdBindDynamicRasterState")); |
| 1026 | if (UNLIKELY(!vtbl.CmdBindDynamicRasterState)) { |
| 1027 | ALOGE("missing device proc: %s", "vkCmdBindDynamicRasterState"); |
| 1028 | success = false; |
| 1029 | } |
| 1030 | vtbl.CmdBindDynamicColorBlendState = reinterpret_cast<PFN_vkCmdBindDynamicColorBlendState>(get_proc_addr(device, "vkCmdBindDynamicColorBlendState")); |
| 1031 | if (UNLIKELY(!vtbl.CmdBindDynamicColorBlendState)) { |
| 1032 | ALOGE("missing device proc: %s", "vkCmdBindDynamicColorBlendState"); |
| 1033 | success = false; |
| 1034 | } |
| 1035 | vtbl.CmdBindDynamicDepthStencilState = reinterpret_cast<PFN_vkCmdBindDynamicDepthStencilState>(get_proc_addr(device, "vkCmdBindDynamicDepthStencilState")); |
| 1036 | if (UNLIKELY(!vtbl.CmdBindDynamicDepthStencilState)) { |
| 1037 | ALOGE("missing device proc: %s", "vkCmdBindDynamicDepthStencilState"); |
| 1038 | success = false; |
| 1039 | } |
| 1040 | vtbl.CmdBindDescriptorSets = reinterpret_cast<PFN_vkCmdBindDescriptorSets>(get_proc_addr(device, "vkCmdBindDescriptorSets")); |
| 1041 | if (UNLIKELY(!vtbl.CmdBindDescriptorSets)) { |
| 1042 | ALOGE("missing device proc: %s", "vkCmdBindDescriptorSets"); |
| 1043 | success = false; |
| 1044 | } |
| 1045 | vtbl.CmdBindIndexBuffer = reinterpret_cast<PFN_vkCmdBindIndexBuffer>(get_proc_addr(device, "vkCmdBindIndexBuffer")); |
| 1046 | if (UNLIKELY(!vtbl.CmdBindIndexBuffer)) { |
| 1047 | ALOGE("missing device proc: %s", "vkCmdBindIndexBuffer"); |
| 1048 | success = false; |
| 1049 | } |
| 1050 | vtbl.CmdBindVertexBuffers = reinterpret_cast<PFN_vkCmdBindVertexBuffers>(get_proc_addr(device, "vkCmdBindVertexBuffers")); |
| 1051 | if (UNLIKELY(!vtbl.CmdBindVertexBuffers)) { |
| 1052 | ALOGE("missing device proc: %s", "vkCmdBindVertexBuffers"); |
| 1053 | success = false; |
| 1054 | } |
| 1055 | vtbl.CmdDraw = reinterpret_cast<PFN_vkCmdDraw>(get_proc_addr(device, "vkCmdDraw")); |
| 1056 | if (UNLIKELY(!vtbl.CmdDraw)) { |
| 1057 | ALOGE("missing device proc: %s", "vkCmdDraw"); |
| 1058 | success = false; |
| 1059 | } |
| 1060 | vtbl.CmdDrawIndexed = reinterpret_cast<PFN_vkCmdDrawIndexed>(get_proc_addr(device, "vkCmdDrawIndexed")); |
| 1061 | if (UNLIKELY(!vtbl.CmdDrawIndexed)) { |
| 1062 | ALOGE("missing device proc: %s", "vkCmdDrawIndexed"); |
| 1063 | success = false; |
| 1064 | } |
| 1065 | vtbl.CmdDrawIndirect = reinterpret_cast<PFN_vkCmdDrawIndirect>(get_proc_addr(device, "vkCmdDrawIndirect")); |
| 1066 | if (UNLIKELY(!vtbl.CmdDrawIndirect)) { |
| 1067 | ALOGE("missing device proc: %s", "vkCmdDrawIndirect"); |
| 1068 | success = false; |
| 1069 | } |
| 1070 | vtbl.CmdDrawIndexedIndirect = reinterpret_cast<PFN_vkCmdDrawIndexedIndirect>(get_proc_addr(device, "vkCmdDrawIndexedIndirect")); |
| 1071 | if (UNLIKELY(!vtbl.CmdDrawIndexedIndirect)) { |
| 1072 | ALOGE("missing device proc: %s", "vkCmdDrawIndexedIndirect"); |
| 1073 | success = false; |
| 1074 | } |
| 1075 | vtbl.CmdDispatch = reinterpret_cast<PFN_vkCmdDispatch>(get_proc_addr(device, "vkCmdDispatch")); |
| 1076 | if (UNLIKELY(!vtbl.CmdDispatch)) { |
| 1077 | ALOGE("missing device proc: %s", "vkCmdDispatch"); |
| 1078 | success = false; |
| 1079 | } |
| 1080 | vtbl.CmdDispatchIndirect = reinterpret_cast<PFN_vkCmdDispatchIndirect>(get_proc_addr(device, "vkCmdDispatchIndirect")); |
| 1081 | if (UNLIKELY(!vtbl.CmdDispatchIndirect)) { |
| 1082 | ALOGE("missing device proc: %s", "vkCmdDispatchIndirect"); |
| 1083 | success = false; |
| 1084 | } |
| 1085 | vtbl.CmdCopyBuffer = reinterpret_cast<PFN_vkCmdCopyBuffer>(get_proc_addr(device, "vkCmdCopyBuffer")); |
| 1086 | if (UNLIKELY(!vtbl.CmdCopyBuffer)) { |
| 1087 | ALOGE("missing device proc: %s", "vkCmdCopyBuffer"); |
| 1088 | success = false; |
| 1089 | } |
| 1090 | vtbl.CmdCopyImage = reinterpret_cast<PFN_vkCmdCopyImage>(get_proc_addr(device, "vkCmdCopyImage")); |
| 1091 | if (UNLIKELY(!vtbl.CmdCopyImage)) { |
| 1092 | ALOGE("missing device proc: %s", "vkCmdCopyImage"); |
| 1093 | success = false; |
| 1094 | } |
| 1095 | vtbl.CmdBlitImage = reinterpret_cast<PFN_vkCmdBlitImage>(get_proc_addr(device, "vkCmdBlitImage")); |
| 1096 | if (UNLIKELY(!vtbl.CmdBlitImage)) { |
| 1097 | ALOGE("missing device proc: %s", "vkCmdBlitImage"); |
| 1098 | success = false; |
| 1099 | } |
| 1100 | vtbl.CmdCopyBufferToImage = reinterpret_cast<PFN_vkCmdCopyBufferToImage>(get_proc_addr(device, "vkCmdCopyBufferToImage")); |
| 1101 | if (UNLIKELY(!vtbl.CmdCopyBufferToImage)) { |
| 1102 | ALOGE("missing device proc: %s", "vkCmdCopyBufferToImage"); |
| 1103 | success = false; |
| 1104 | } |
| 1105 | vtbl.CmdCopyImageToBuffer = reinterpret_cast<PFN_vkCmdCopyImageToBuffer>(get_proc_addr(device, "vkCmdCopyImageToBuffer")); |
| 1106 | if (UNLIKELY(!vtbl.CmdCopyImageToBuffer)) { |
| 1107 | ALOGE("missing device proc: %s", "vkCmdCopyImageToBuffer"); |
| 1108 | success = false; |
| 1109 | } |
| 1110 | vtbl.CmdUpdateBuffer = reinterpret_cast<PFN_vkCmdUpdateBuffer>(get_proc_addr(device, "vkCmdUpdateBuffer")); |
| 1111 | if (UNLIKELY(!vtbl.CmdUpdateBuffer)) { |
| 1112 | ALOGE("missing device proc: %s", "vkCmdUpdateBuffer"); |
| 1113 | success = false; |
| 1114 | } |
| 1115 | vtbl.CmdFillBuffer = reinterpret_cast<PFN_vkCmdFillBuffer>(get_proc_addr(device, "vkCmdFillBuffer")); |
| 1116 | if (UNLIKELY(!vtbl.CmdFillBuffer)) { |
| 1117 | ALOGE("missing device proc: %s", "vkCmdFillBuffer"); |
| 1118 | success = false; |
| 1119 | } |
| 1120 | vtbl.CmdClearColorImage = reinterpret_cast<PFN_vkCmdClearColorImage>(get_proc_addr(device, "vkCmdClearColorImage")); |
| 1121 | if (UNLIKELY(!vtbl.CmdClearColorImage)) { |
| 1122 | ALOGE("missing device proc: %s", "vkCmdClearColorImage"); |
| 1123 | success = false; |
| 1124 | } |
| 1125 | vtbl.CmdClearDepthStencilImage = reinterpret_cast<PFN_vkCmdClearDepthStencilImage>(get_proc_addr(device, "vkCmdClearDepthStencilImage")); |
| 1126 | if (UNLIKELY(!vtbl.CmdClearDepthStencilImage)) { |
| 1127 | ALOGE("missing device proc: %s", "vkCmdClearDepthStencilImage"); |
| 1128 | success = false; |
| 1129 | } |
| 1130 | vtbl.CmdClearColorAttachment = reinterpret_cast<PFN_vkCmdClearColorAttachment>(get_proc_addr(device, "vkCmdClearColorAttachment")); |
| 1131 | if (UNLIKELY(!vtbl.CmdClearColorAttachment)) { |
| 1132 | ALOGE("missing device proc: %s", "vkCmdClearColorAttachment"); |
| 1133 | success = false; |
| 1134 | } |
| 1135 | vtbl.CmdClearDepthStencilAttachment = reinterpret_cast<PFN_vkCmdClearDepthStencilAttachment>(get_proc_addr(device, "vkCmdClearDepthStencilAttachment")); |
| 1136 | if (UNLIKELY(!vtbl.CmdClearDepthStencilAttachment)) { |
| 1137 | ALOGE("missing device proc: %s", "vkCmdClearDepthStencilAttachment"); |
| 1138 | success = false; |
| 1139 | } |
| 1140 | vtbl.CmdResolveImage = reinterpret_cast<PFN_vkCmdResolveImage>(get_proc_addr(device, "vkCmdResolveImage")); |
| 1141 | if (UNLIKELY(!vtbl.CmdResolveImage)) { |
| 1142 | ALOGE("missing device proc: %s", "vkCmdResolveImage"); |
| 1143 | success = false; |
| 1144 | } |
| 1145 | vtbl.CmdSetEvent = reinterpret_cast<PFN_vkCmdSetEvent>(get_proc_addr(device, "vkCmdSetEvent")); |
| 1146 | if (UNLIKELY(!vtbl.CmdSetEvent)) { |
| 1147 | ALOGE("missing device proc: %s", "vkCmdSetEvent"); |
| 1148 | success = false; |
| 1149 | } |
| 1150 | vtbl.CmdResetEvent = reinterpret_cast<PFN_vkCmdResetEvent>(get_proc_addr(device, "vkCmdResetEvent")); |
| 1151 | if (UNLIKELY(!vtbl.CmdResetEvent)) { |
| 1152 | ALOGE("missing device proc: %s", "vkCmdResetEvent"); |
| 1153 | success = false; |
| 1154 | } |
| 1155 | vtbl.CmdWaitEvents = reinterpret_cast<PFN_vkCmdWaitEvents>(get_proc_addr(device, "vkCmdWaitEvents")); |
| 1156 | if (UNLIKELY(!vtbl.CmdWaitEvents)) { |
| 1157 | ALOGE("missing device proc: %s", "vkCmdWaitEvents"); |
| 1158 | success = false; |
| 1159 | } |
| 1160 | vtbl.CmdPipelineBarrier = reinterpret_cast<PFN_vkCmdPipelineBarrier>(get_proc_addr(device, "vkCmdPipelineBarrier")); |
| 1161 | if (UNLIKELY(!vtbl.CmdPipelineBarrier)) { |
| 1162 | ALOGE("missing device proc: %s", "vkCmdPipelineBarrier"); |
| 1163 | success = false; |
| 1164 | } |
| 1165 | vtbl.CmdBeginQuery = reinterpret_cast<PFN_vkCmdBeginQuery>(get_proc_addr(device, "vkCmdBeginQuery")); |
| 1166 | if (UNLIKELY(!vtbl.CmdBeginQuery)) { |
| 1167 | ALOGE("missing device proc: %s", "vkCmdBeginQuery"); |
| 1168 | success = false; |
| 1169 | } |
| 1170 | vtbl.CmdEndQuery = reinterpret_cast<PFN_vkCmdEndQuery>(get_proc_addr(device, "vkCmdEndQuery")); |
| 1171 | if (UNLIKELY(!vtbl.CmdEndQuery)) { |
| 1172 | ALOGE("missing device proc: %s", "vkCmdEndQuery"); |
| 1173 | success = false; |
| 1174 | } |
| 1175 | vtbl.CmdResetQueryPool = reinterpret_cast<PFN_vkCmdResetQueryPool>(get_proc_addr(device, "vkCmdResetQueryPool")); |
| 1176 | if (UNLIKELY(!vtbl.CmdResetQueryPool)) { |
| 1177 | ALOGE("missing device proc: %s", "vkCmdResetQueryPool"); |
| 1178 | success = false; |
| 1179 | } |
| 1180 | vtbl.CmdWriteTimestamp = reinterpret_cast<PFN_vkCmdWriteTimestamp>(get_proc_addr(device, "vkCmdWriteTimestamp")); |
| 1181 | if (UNLIKELY(!vtbl.CmdWriteTimestamp)) { |
| 1182 | ALOGE("missing device proc: %s", "vkCmdWriteTimestamp"); |
| 1183 | success = false; |
| 1184 | } |
| 1185 | vtbl.CmdCopyQueryPoolResults = reinterpret_cast<PFN_vkCmdCopyQueryPoolResults>(get_proc_addr(device, "vkCmdCopyQueryPoolResults")); |
| 1186 | if (UNLIKELY(!vtbl.CmdCopyQueryPoolResults)) { |
| 1187 | ALOGE("missing device proc: %s", "vkCmdCopyQueryPoolResults"); |
| 1188 | success = false; |
| 1189 | } |
| 1190 | vtbl.CmdPushConstants = reinterpret_cast<PFN_vkCmdPushConstants>(get_proc_addr(device, "vkCmdPushConstants")); |
| 1191 | if (UNLIKELY(!vtbl.CmdPushConstants)) { |
| 1192 | ALOGE("missing device proc: %s", "vkCmdPushConstants"); |
| 1193 | success = false; |
| 1194 | } |
| 1195 | vtbl.CmdBeginRenderPass = reinterpret_cast<PFN_vkCmdBeginRenderPass>(get_proc_addr(device, "vkCmdBeginRenderPass")); |
| 1196 | if (UNLIKELY(!vtbl.CmdBeginRenderPass)) { |
| 1197 | ALOGE("missing device proc: %s", "vkCmdBeginRenderPass"); |
| 1198 | success = false; |
| 1199 | } |
| 1200 | vtbl.CmdNextSubpass = reinterpret_cast<PFN_vkCmdNextSubpass>(get_proc_addr(device, "vkCmdNextSubpass")); |
| 1201 | if (UNLIKELY(!vtbl.CmdNextSubpass)) { |
| 1202 | ALOGE("missing device proc: %s", "vkCmdNextSubpass"); |
| 1203 | success = false; |
| 1204 | } |
| 1205 | vtbl.CmdEndRenderPass = reinterpret_cast<PFN_vkCmdEndRenderPass>(get_proc_addr(device, "vkCmdEndRenderPass")); |
| 1206 | if (UNLIKELY(!vtbl.CmdEndRenderPass)) { |
| 1207 | ALOGE("missing device proc: %s", "vkCmdEndRenderPass"); |
| 1208 | success = false; |
| 1209 | } |
| 1210 | vtbl.CmdExecuteCommands = reinterpret_cast<PFN_vkCmdExecuteCommands>(get_proc_addr(device, "vkCmdExecuteCommands")); |
| 1211 | if (UNLIKELY(!vtbl.CmdExecuteCommands)) { |
| 1212 | ALOGE("missing device proc: %s", "vkCmdExecuteCommands"); |
| 1213 | success = false; |
| 1214 | } |
Jesse Hall | b1352bc | 2015-09-04 16:12:33 -0700 | [diff] [blame^] | 1215 | vtbl.ImportNativeFenceANDROID = reinterpret_cast<PFN_vkImportNativeFenceANDROID>(get_proc_addr(device, "vkImportNativeFenceANDROID")); |
| 1216 | if (UNLIKELY(!vtbl.ImportNativeFenceANDROID)) { |
| 1217 | ALOGE("missing device proc: %s", "vkImportNativeFenceANDROID"); |
| 1218 | success = false; |
| 1219 | } |
| 1220 | vtbl.QueueSignalNativeFenceANDROID = reinterpret_cast<PFN_vkQueueSignalNativeFenceANDROID>(get_proc_addr(device, "vkQueueSignalNativeFenceANDROID")); |
| 1221 | if (UNLIKELY(!vtbl.QueueSignalNativeFenceANDROID)) { |
| 1222 | ALOGE("missing device proc: %s", "vkQueueSignalNativeFenceANDROID"); |
| 1223 | success = false; |
| 1224 | } |
Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame] | 1225 | // clang-format on |
| 1226 | return success; |
| 1227 | } |
| 1228 | |
| 1229 | } // namespace vulkan |