/* * Copyright 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // WARNING: This file is generated. See ../README.md for instructions. #include #include "null_driver_gen.h" using namespace null_driver; namespace { struct NameProc { const char* name; PFN_vkVoidFunction proc; }; PFN_vkVoidFunction Lookup(const char* name, const NameProc* begin, const NameProc* end) { const auto& entry = std::lower_bound( begin, end, name, [](const NameProc& e, const char* n) { return strcmp(e.name, n) < 0; }); if (entry == end || strcmp(entry->name, name) != 0) return nullptr; return entry->proc; } template PFN_vkVoidFunction Lookup(const char* name, const NameProc (&procs)[N]) { return Lookup(name, procs, procs + N); } const NameProc kGlobalProcs[] = { // clang-format off {"vkCreateInstance", reinterpret_cast(static_cast(CreateInstance))}, {"vkEnumerateInstanceExtensionProperties", reinterpret_cast(static_cast(EnumerateInstanceExtensionProperties))}, {"vkEnumerateInstanceLayerProperties", reinterpret_cast(static_cast(EnumerateInstanceLayerProperties))}, {"vkEnumerateInstanceVersion", reinterpret_cast(static_cast(EnumerateInstanceVersion))}, // clang-format on }; const NameProc kInstanceProcs[] = { // clang-format off {"vkAcquireImageANDROID", reinterpret_cast(static_cast(AcquireImageANDROID))}, {"vkAllocateCommandBuffers", reinterpret_cast(static_cast(AllocateCommandBuffers))}, {"vkAllocateDescriptorSets", reinterpret_cast(static_cast(AllocateDescriptorSets))}, {"vkAllocateMemory", reinterpret_cast(static_cast(AllocateMemory))}, {"vkBeginCommandBuffer", reinterpret_cast(static_cast(BeginCommandBuffer))}, {"vkBindBufferMemory", reinterpret_cast(static_cast(BindBufferMemory))}, {"vkBindBufferMemory2", reinterpret_cast(static_cast(BindBufferMemory2))}, {"vkBindImageMemory", reinterpret_cast(static_cast(BindImageMemory))}, {"vkBindImageMemory2", reinterpret_cast(static_cast(BindImageMemory2))}, {"vkCmdBeginQuery", reinterpret_cast(static_cast(CmdBeginQuery))}, {"vkCmdBeginRenderPass", reinterpret_cast(static_cast(CmdBeginRenderPass))}, {"vkCmdBindDescriptorSets", reinterpret_cast(static_cast(CmdBindDescriptorSets))}, {"vkCmdBindIndexBuffer", reinterpret_cast(static_cast(CmdBindIndexBuffer))}, {"vkCmdBindPipeline", reinterpret_cast(static_cast(CmdBindPipeline))}, {"vkCmdBindVertexBuffers", reinterpret_cast(static_cast(CmdBindVertexBuffers))}, {"vkCmdBlitImage", reinterpret_cast(static_cast(CmdBlitImage))}, {"vkCmdClearAttachments", reinterpret_cast(static_cast(CmdClearAttachments))}, {"vkCmdClearColorImage", reinterpret_cast(static_cast(CmdClearColorImage))}, {"vkCmdClearDepthStencilImage", reinterpret_cast(static_cast(CmdClearDepthStencilImage))}, {"vkCmdCopyBuffer", reinterpret_cast(static_cast(CmdCopyBuffer))}, {"vkCmdCopyBufferToImage", reinterpret_cast(static_cast(CmdCopyBufferToImage))}, {"vkCmdCopyImage", reinterpret_cast(static_cast(CmdCopyImage))}, {"vkCmdCopyImageToBuffer", reinterpret_cast(static_cast(CmdCopyImageToBuffer))}, {"vkCmdCopyQueryPoolResults", reinterpret_cast(static_cast(CmdCopyQueryPoolResults))}, {"vkCmdDispatch", reinterpret_cast(static_cast(CmdDispatch))}, {"vkCmdDispatchBase", reinterpret_cast(static_cast(CmdDispatchBase))}, {"vkCmdDispatchIndirect", reinterpret_cast(static_cast(CmdDispatchIndirect))}, {"vkCmdDraw", reinterpret_cast(static_cast(CmdDraw))}, {"vkCmdDrawIndexed", reinterpret_cast(static_cast(CmdDrawIndexed))}, {"vkCmdDrawIndexedIndirect", reinterpret_cast(static_cast(CmdDrawIndexedIndirect))}, {"vkCmdDrawIndirect", reinterpret_cast(static_cast(CmdDrawIndirect))}, {"vkCmdEndQuery", reinterpret_cast(static_cast(CmdEndQuery))}, {"vkCmdEndRenderPass", reinterpret_cast(static_cast(CmdEndRenderPass))}, {"vkCmdExecuteCommands", reinterpret_cast(static_cast(CmdExecuteCommands))}, {"vkCmdFillBuffer", reinterpret_cast(static_cast(CmdFillBuffer))}, {"vkCmdNextSubpass", reinterpret_cast(static_cast(CmdNextSubpass))}, {"vkCmdPipelineBarrier", reinterpret_cast(static_cast(CmdPipelineBarrier))}, {"vkCmdPushConstants", reinterpret_cast(static_cast(CmdPushConstants))}, {"vkCmdResetEvent", reinterpret_cast(static_cast(CmdResetEvent))}, {"vkCmdResetQueryPool", reinterpret_cast(static_cast(CmdResetQueryPool))}, {"vkCmdResolveImage", reinterpret_cast(static_cast(CmdResolveImage))}, {"vkCmdSetBlendConstants", reinterpret_cast(static_cast(CmdSetBlendConstants))}, {"vkCmdSetDepthBias", reinterpret_cast(static_cast(CmdSetDepthBias))}, {"vkCmdSetDepthBounds", reinterpret_cast(static_cast(CmdSetDepthBounds))}, {"vkCmdSetDeviceMask", reinterpret_cast(static_cast(CmdSetDeviceMask))}, {"vkCmdSetEvent", reinterpret_cast(static_cast(CmdSetEvent))}, {"vkCmdSetLineWidth", reinterpret_cast(static_cast(CmdSetLineWidth))}, {"vkCmdSetScissor", reinterpret_cast(static_cast(CmdSetScissor))}, {"vkCmdSetStencilCompareMask", reinterpret_cast(static_cast(CmdSetStencilCompareMask))}, {"vkCmdSetStencilReference", reinterpret_cast(static_cast(CmdSetStencilReference))}, {"vkCmdSetStencilWriteMask", reinterpret_cast(static_cast(CmdSetStencilWriteMask))}, {"vkCmdSetViewport", reinterpret_cast(static_cast(CmdSetViewport))}, {"vkCmdUpdateBuffer", reinterpret_cast(static_cast(CmdUpdateBuffer))}, {"vkCmdWaitEvents", reinterpret_cast(static_cast(CmdWaitEvents))}, {"vkCmdWriteTimestamp", reinterpret_cast(static_cast(CmdWriteTimestamp))}, {"vkCreateBuffer", reinterpret_cast(static_cast(CreateBuffer))}, {"vkCreateBufferView", reinterpret_cast(static_cast(CreateBufferView))}, {"vkCreateCommandPool", reinterpret_cast(static_cast(CreateCommandPool))}, {"vkCreateComputePipelines", reinterpret_cast(static_cast(CreateComputePipelines))}, {"vkCreateDebugReportCallbackEXT", reinterpret_cast(static_cast(CreateDebugReportCallbackEXT))}, {"vkCreateDescriptorPool", reinterpret_cast(static_cast(CreateDescriptorPool))}, {"vkCreateDescriptorSetLayout", reinterpret_cast(static_cast(CreateDescriptorSetLayout))}, {"vkCreateDescriptorUpdateTemplate", reinterpret_cast(static_cast(CreateDescriptorUpdateTemplate))}, {"vkCreateDevice", reinterpret_cast(static_cast(CreateDevice))}, {"vkCreateEvent", reinterpret_cast(static_cast(CreateEvent))}, {"vkCreateFence", reinterpret_cast(static_cast(CreateFence))}, {"vkCreateFramebuffer", reinterpret_cast(static_cast(CreateFramebuffer))}, {"vkCreateGraphicsPipelines", reinterpret_cast(static_cast(CreateGraphicsPipelines))}, {"vkCreateImage", reinterpret_cast(static_cast(CreateImage))}, {"vkCreateImageView", reinterpret_cast(static_cast(CreateImageView))}, {"vkCreateInstance", reinterpret_cast(static_cast(CreateInstance))}, {"vkCreatePipelineCache", reinterpret_cast(static_cast(CreatePipelineCache))}, {"vkCreatePipelineLayout", reinterpret_cast(static_cast(CreatePipelineLayout))}, {"vkCreateQueryPool", reinterpret_cast(static_cast(CreateQueryPool))}, {"vkCreateRenderPass", reinterpret_cast(static_cast(CreateRenderPass))}, {"vkCreateSampler", reinterpret_cast(static_cast(CreateSampler))}, {"vkCreateSamplerYcbcrConversion", reinterpret_cast(static_cast(CreateSamplerYcbcrConversion))}, {"vkCreateSemaphore", reinterpret_cast(static_cast(CreateSemaphore))}, {"vkCreateShaderModule", reinterpret_cast(static_cast(CreateShaderModule))}, {"vkDebugReportMessageEXT", reinterpret_cast(static_cast(DebugReportMessageEXT))}, {"vkDestroyBuffer", reinterpret_cast(static_cast(DestroyBuffer))}, {"vkDestroyBufferView", reinterpret_cast(static_cast(DestroyBufferView))}, {"vkDestroyCommandPool", reinterpret_cast(static_cast(DestroyCommandPool))}, {"vkDestroyDebugReportCallbackEXT", reinterpret_cast(static_cast(DestroyDebugReportCallbackEXT))}, {"vkDestroyDescriptorPool", reinterpret_cast(static_cast(DestroyDescriptorPool))}, {"vkDestroyDescriptorSetLayout", reinterpret_cast(static_cast(DestroyDescriptorSetLayout))}, {"vkDestroyDescriptorUpdateTemplate", reinterpret_cast(static_cast(DestroyDescriptorUpdateTemplate))}, {"vkDestroyDevice", reinterpret_cast(static_cast(DestroyDevice))}, {"vkDestroyEvent", reinterpret_cast(static_cast(DestroyEvent))}, {"vkDestroyFence", reinterpret_cast(static_cast(DestroyFence))}, {"vkDestroyFramebuffer", reinterpret_cast(static_cast(DestroyFramebuffer))}, {"vkDestroyImage", reinterpret_cast(static_cast(DestroyImage))}, {"vkDestroyImageView", reinterpret_cast(static_cast(DestroyImageView))}, {"vkDestroyInstance", reinterpret_cast(static_cast(DestroyInstance))}, {"vkDestroyPipeline", reinterpret_cast(static_cast(DestroyPipeline))}, {"vkDestroyPipelineCache", reinterpret_cast(static_cast(DestroyPipelineCache))}, {"vkDestroyPipelineLayout", reinterpret_cast(static_cast(DestroyPipelineLayout))}, {"vkDestroyQueryPool", reinterpret_cast(static_cast(DestroyQueryPool))}, {"vkDestroyRenderPass", reinterpret_cast(static_cast(DestroyRenderPass))}, {"vkDestroySampler", reinterpret_cast(static_cast(DestroySampler))}, {"vkDestroySamplerYcbcrConversion", reinterpret_cast(static_cast(DestroySamplerYcbcrConversion))}, {"vkDestroySemaphore", reinterpret_cast(static_cast(DestroySemaphore))}, {"vkDestroyShaderModule", reinterpret_cast(static_cast(DestroyShaderModule))}, {"vkDeviceWaitIdle", reinterpret_cast(static_cast(DeviceWaitIdle))}, {"vkEndCommandBuffer", reinterpret_cast(static_cast(EndCommandBuffer))}, {"vkEnumerateDeviceExtensionProperties", reinterpret_cast(static_cast(EnumerateDeviceExtensionProperties))}, {"vkEnumerateDeviceLayerProperties", reinterpret_cast(static_cast(EnumerateDeviceLayerProperties))}, {"vkEnumerateInstanceExtensionProperties", reinterpret_cast(static_cast(EnumerateInstanceExtensionProperties))}, {"vkEnumerateInstanceLayerProperties", reinterpret_cast(static_cast(EnumerateInstanceLayerProperties))}, {"vkEnumerateInstanceVersion", reinterpret_cast(static_cast(EnumerateInstanceVersion))}, {"vkEnumeratePhysicalDeviceGroups", reinterpret_cast(static_cast(EnumeratePhysicalDeviceGroups))}, {"vkEnumeratePhysicalDevices", reinterpret_cast(static_cast(EnumeratePhysicalDevices))}, {"vkFlushMappedMemoryRanges", reinterpret_cast(static_cast(FlushMappedMemoryRanges))}, {"vkFreeCommandBuffers", reinterpret_cast(static_cast(FreeCommandBuffers))}, {"vkFreeDescriptorSets", reinterpret_cast(static_cast(FreeDescriptorSets))}, {"vkFreeMemory", reinterpret_cast(static_cast(FreeMemory))}, {"vkGetBufferMemoryRequirements", reinterpret_cast(static_cast(GetBufferMemoryRequirements))}, {"vkGetBufferMemoryRequirements2", reinterpret_cast(static_cast(GetBufferMemoryRequirements2))}, {"vkGetDescriptorSetLayoutSupport", reinterpret_cast(static_cast(GetDescriptorSetLayoutSupport))}, {"vkGetDeviceGroupPeerMemoryFeatures", reinterpret_cast(static_cast(GetDeviceGroupPeerMemoryFeatures))}, {"vkGetDeviceMemoryCommitment", reinterpret_cast(static_cast(GetDeviceMemoryCommitment))}, {"vkGetDeviceProcAddr", reinterpret_cast(static_cast(GetDeviceProcAddr))}, {"vkGetDeviceQueue", reinterpret_cast(static_cast(GetDeviceQueue))}, {"vkGetDeviceQueue2", reinterpret_cast(static_cast(GetDeviceQueue2))}, {"vkGetEventStatus", reinterpret_cast(static_cast(GetEventStatus))}, {"vkGetFenceStatus", reinterpret_cast(static_cast(GetFenceStatus))}, {"vkGetImageMemoryRequirements", reinterpret_cast(static_cast(GetImageMemoryRequirements))}, {"vkGetImageMemoryRequirements2", reinterpret_cast(static_cast(GetImageMemoryRequirements2))}, {"vkGetImageSparseMemoryRequirements", reinterpret_cast(static_cast(GetImageSparseMemoryRequirements))}, {"vkGetImageSparseMemoryRequirements2", reinterpret_cast(static_cast(GetImageSparseMemoryRequirements2))}, {"vkGetImageSubresourceLayout", reinterpret_cast(static_cast(GetImageSubresourceLayout))}, {"vkGetInstanceProcAddr", reinterpret_cast(static_cast(GetInstanceProcAddr))}, {"vkGetPhysicalDeviceExternalBufferProperties", reinterpret_cast(static_cast(GetPhysicalDeviceExternalBufferProperties))}, {"vkGetPhysicalDeviceExternalFenceProperties", reinterpret_cast(static_cast(GetPhysicalDeviceExternalFenceProperties))}, {"vkGetPhysicalDeviceExternalSemaphoreProperties", reinterpret_cast(static_cast(GetPhysicalDeviceExternalSemaphoreProperties))}, {"vkGetPhysicalDeviceFeatures", reinterpret_cast(static_cast(GetPhysicalDeviceFeatures))}, {"vkGetPhysicalDeviceFeatures2", reinterpret_cast(static_cast(GetPhysicalDeviceFeatures2))}, {"vkGetPhysicalDeviceFeatures2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceFeatures2KHR))}, {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast(static_cast(GetPhysicalDeviceFormatProperties))}, {"vkGetPhysicalDeviceFormatProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceFormatProperties2))}, {"vkGetPhysicalDeviceFormatProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceFormatProperties2KHR))}, {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast(static_cast(GetPhysicalDeviceImageFormatProperties))}, {"vkGetPhysicalDeviceImageFormatProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceImageFormatProperties2))}, {"vkGetPhysicalDeviceImageFormatProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceImageFormatProperties2KHR))}, {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast(static_cast(GetPhysicalDeviceMemoryProperties))}, {"vkGetPhysicalDeviceMemoryProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceMemoryProperties2))}, {"vkGetPhysicalDeviceMemoryProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceMemoryProperties2KHR))}, {"vkGetPhysicalDeviceProperties", reinterpret_cast(static_cast(GetPhysicalDeviceProperties))}, {"vkGetPhysicalDeviceProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceProperties2))}, {"vkGetPhysicalDeviceProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceProperties2KHR))}, {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast(static_cast(GetPhysicalDeviceQueueFamilyProperties))}, {"vkGetPhysicalDeviceQueueFamilyProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceQueueFamilyProperties2))}, {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceQueueFamilyProperties2KHR))}, {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast(static_cast(GetPhysicalDeviceSparseImageFormatProperties))}, {"vkGetPhysicalDeviceSparseImageFormatProperties2", reinterpret_cast(static_cast(GetPhysicalDeviceSparseImageFormatProperties2))}, {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", reinterpret_cast(static_cast(GetPhysicalDeviceSparseImageFormatProperties2KHR))}, {"vkGetPipelineCacheData", reinterpret_cast(static_cast(GetPipelineCacheData))}, {"vkGetQueryPoolResults", reinterpret_cast(static_cast(GetQueryPoolResults))}, {"vkGetRenderAreaGranularity", reinterpret_cast(static_cast(GetRenderAreaGranularity))}, {"vkGetSwapchainGrallocUsage2ANDROID", reinterpret_cast(static_cast(GetSwapchainGrallocUsage2ANDROID))}, {"vkGetSwapchainGrallocUsageANDROID", reinterpret_cast(static_cast(GetSwapchainGrallocUsageANDROID))}, {"vkInvalidateMappedMemoryRanges", reinterpret_cast(static_cast(InvalidateMappedMemoryRanges))}, {"vkMapMemory", reinterpret_cast(static_cast(MapMemory))}, {"vkMergePipelineCaches", reinterpret_cast(static_cast(MergePipelineCaches))}, {"vkQueueBindSparse", reinterpret_cast(static_cast(QueueBindSparse))}, {"vkQueueSignalReleaseImageANDROID", reinterpret_cast(static_cast(QueueSignalReleaseImageANDROID))}, {"vkQueueSubmit", reinterpret_cast(static_cast(QueueSubmit))}, {"vkQueueWaitIdle", reinterpret_cast(static_cast(QueueWaitIdle))}, {"vkResetCommandBuffer", reinterpret_cast(static_cast(ResetCommandBuffer))}, {"vkResetCommandPool", reinterpret_cast(static_cast(ResetCommandPool))}, {"vkResetDescriptorPool", reinterpret_cast(static_cast(ResetDescriptorPool))}, {"vkResetEvent", reinterpret_cast(static_cast(ResetEvent))}, {"vkResetFences", reinterpret_cast(static_cast(ResetFences))}, {"vkSetEvent", reinterpret_cast(static_cast(SetEvent))}, {"vkTrimCommandPool", reinterpret_cast(static_cast(TrimCommandPool))}, {"vkUnmapMemory", reinterpret_cast(static_cast(UnmapMemory))}, {"vkUpdateDescriptorSetWithTemplate", reinterpret_cast(static_cast(UpdateDescriptorSetWithTemplate))}, {"vkUpdateDescriptorSets", reinterpret_cast(static_cast(UpdateDescriptorSets))}, {"vkWaitForFences", reinterpret_cast(static_cast(WaitForFences))}, // clang-format on }; } // namespace namespace null_driver { PFN_vkVoidFunction GetGlobalProcAddr(const char* name) { return Lookup(name, kGlobalProcs); } PFN_vkVoidFunction GetInstanceProcAddr(const char* name) { return Lookup(name, kInstanceProcs); } } // namespace null_driver