Index: src/gpu/vk/GrVkInterface.cpp |
diff --git a/src/gpu/vk/GrVkInterface.cpp b/src/gpu/vk/GrVkInterface.cpp |
index 4b12e13f0cfeb1bea7ef793bdb5ce46416131cd1..4d445a498916955e38379e0cbc28deeb8378ed4c 100644 |
--- a/src/gpu/vk/GrVkInterface.cpp |
+++ b/src/gpu/vk/GrVkInterface.cpp |
@@ -13,8 +13,10 @@ GrVkInterface::GrVkInterface() { |
#define GET_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetInstanceProcAddr(instance, "vk" #F) |
#define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcAddr(inst, "vk" #F) |
+#define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(device, "vk" #F) |
-const GrVkInterface* GrVkCreateInterface(VkInstance instance) { |
+const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkPhysicalDevice physDev, |
+ VkDevice device) { |
GET_PROC_LOCAL(nullptr, EnumerateInstanceExtensionProperties); |
GET_PROC_LOCAL(instance, EnumerateDeviceExtensionProperties); |
@@ -23,6 +25,7 @@ const GrVkInterface* GrVkCreateInterface(VkInstance instance) { |
GrVkExtensions extensions; |
if (!extensions.init(kGrVkMinimumVersion, |
+ physDev, |
EnumerateInstanceExtensionProperties, |
EnumerateDeviceExtensionProperties, |
EnumerateInstanceLayerProperties, |
@@ -48,137 +51,137 @@ const GrVkInterface* GrVkCreateInterface(VkInstance instance) { |
GET_PROC(EnumerateDeviceExtensionProperties); |
GET_PROC(EnumerateInstanceLayerProperties); |
GET_PROC(EnumerateDeviceLayerProperties); |
- GET_PROC(GetDeviceQueue); |
- GET_PROC(QueueSubmit); |
- GET_PROC(QueueWaitIdle); |
- GET_PROC(DeviceWaitIdle); |
- GET_PROC(AllocateMemory); |
- GET_PROC(FreeMemory); |
- GET_PROC(MapMemory); |
- GET_PROC(UnmapMemory); |
- GET_PROC(FlushMappedMemoryRanges); |
- GET_PROC(InvalidateMappedMemoryRanges); |
- GET_PROC(GetDeviceMemoryCommitment); |
- GET_PROC(BindBufferMemory); |
- GET_PROC(BindImageMemory); |
- GET_PROC(GetBufferMemoryRequirements); |
- GET_PROC(GetImageMemoryRequirements); |
- GET_PROC(GetImageSparseMemoryRequirements); |
+ GET_DEV_PROC(GetDeviceQueue); |
+ GET_DEV_PROC(QueueSubmit); |
+ GET_DEV_PROC(QueueWaitIdle); |
+ GET_DEV_PROC(DeviceWaitIdle); |
+ GET_DEV_PROC(AllocateMemory); |
+ GET_DEV_PROC(FreeMemory); |
+ GET_DEV_PROC(MapMemory); |
+ GET_DEV_PROC(UnmapMemory); |
+ GET_DEV_PROC(FlushMappedMemoryRanges); |
+ GET_DEV_PROC(InvalidateMappedMemoryRanges); |
+ GET_DEV_PROC(GetDeviceMemoryCommitment); |
+ GET_DEV_PROC(BindBufferMemory); |
+ GET_DEV_PROC(BindImageMemory); |
+ GET_DEV_PROC(GetBufferMemoryRequirements); |
+ GET_DEV_PROC(GetImageMemoryRequirements); |
+ GET_DEV_PROC(GetImageSparseMemoryRequirements); |
GET_PROC(GetPhysicalDeviceSparseImageFormatProperties); |
- GET_PROC(QueueBindSparse); |
- GET_PROC(CreateFence); |
- GET_PROC(DestroyFence); |
- GET_PROC(ResetFences); |
- GET_PROC(GetFenceStatus); |
- GET_PROC(WaitForFences); |
- GET_PROC(CreateSemaphore); |
- GET_PROC(DestroySemaphore); |
- GET_PROC(CreateEvent); |
- GET_PROC(DestroyEvent); |
- GET_PROC(GetEventStatus); |
- GET_PROC(SetEvent); |
- GET_PROC(ResetEvent); |
- GET_PROC(CreateQueryPool); |
- GET_PROC(DestroyQueryPool); |
- GET_PROC(GetQueryPoolResults); |
- GET_PROC(CreateBuffer); |
- GET_PROC(DestroyBuffer); |
- GET_PROC(CreateBufferView); |
- GET_PROC(DestroyBufferView); |
- GET_PROC(CreateImage); |
- GET_PROC(DestroyImage); |
- GET_PROC(GetImageSubresourceLayout); |
- GET_PROC(CreateImageView); |
- GET_PROC(DestroyImageView); |
- GET_PROC(CreateShaderModule); |
- GET_PROC(DestroyShaderModule); |
- GET_PROC(CreatePipelineCache); |
- GET_PROC(DestroyPipelineCache); |
- GET_PROC(GetPipelineCacheData); |
- GET_PROC(MergePipelineCaches); |
- GET_PROC(CreateGraphicsPipelines); |
- GET_PROC(CreateComputePipelines); |
- GET_PROC(DestroyPipeline); |
- GET_PROC(CreatePipelineLayout); |
- GET_PROC(DestroyPipelineLayout); |
- GET_PROC(CreateSampler); |
- GET_PROC(DestroySampler); |
- GET_PROC(CreateDescriptorSetLayout); |
- GET_PROC(DestroyDescriptorSetLayout); |
- GET_PROC(CreateDescriptorPool); |
- GET_PROC(DestroyDescriptorPool); |
- GET_PROC(ResetDescriptorPool); |
- GET_PROC(AllocateDescriptorSets); |
- GET_PROC(FreeDescriptorSets); |
- GET_PROC(UpdateDescriptorSets); |
- GET_PROC(CreateFramebuffer); |
- GET_PROC(DestroyFramebuffer); |
- GET_PROC(CreateRenderPass); |
- GET_PROC(DestroyRenderPass); |
- GET_PROC(GetRenderAreaGranularity); |
- GET_PROC(CreateCommandPool); |
- GET_PROC(DestroyCommandPool); |
- GET_PROC(ResetCommandPool); |
- GET_PROC(AllocateCommandBuffers); |
- GET_PROC(FreeCommandBuffers); |
- GET_PROC(BeginCommandBuffer); |
- GET_PROC(EndCommandBuffer); |
- GET_PROC(ResetCommandBuffer); |
- GET_PROC(CmdBindPipeline); |
- GET_PROC(CmdSetViewport); |
- GET_PROC(CmdSetScissor); |
- GET_PROC(CmdSetLineWidth); |
- GET_PROC(CmdSetDepthBias); |
- GET_PROC(CmdSetBlendConstants); |
- GET_PROC(CmdSetDepthBounds); |
- GET_PROC(CmdSetStencilCompareMask); |
- GET_PROC(CmdSetStencilWriteMask); |
- GET_PROC(CmdSetStencilReference); |
- GET_PROC(CmdBindDescriptorSets); |
- GET_PROC(CmdBindIndexBuffer); |
- GET_PROC(CmdBindVertexBuffers); |
- GET_PROC(CmdDraw); |
- GET_PROC(CmdDrawIndexed); |
- GET_PROC(CmdDrawIndirect); |
- GET_PROC(CmdDrawIndexedIndirect); |
- GET_PROC(CmdDispatch); |
- GET_PROC(CmdDispatchIndirect); |
- GET_PROC(CmdCopyBuffer); |
- GET_PROC(CmdCopyImage); |
- GET_PROC(CmdBlitImage); |
- GET_PROC(CmdCopyBufferToImage); |
- GET_PROC(CmdCopyImageToBuffer); |
- GET_PROC(CmdUpdateBuffer); |
- GET_PROC(CmdFillBuffer); |
- GET_PROC(CmdClearColorImage); |
- GET_PROC(CmdClearDepthStencilImage); |
- GET_PROC(CmdClearAttachments); |
- GET_PROC(CmdResolveImage); |
- GET_PROC(CmdSetEvent); |
- GET_PROC(CmdResetEvent); |
- GET_PROC(CmdWaitEvents); |
- GET_PROC(CmdPipelineBarrier); |
- GET_PROC(CmdBeginQuery); |
- GET_PROC(CmdEndQuery); |
- GET_PROC(CmdResetQueryPool); |
- GET_PROC(CmdWriteTimestamp); |
- GET_PROC(CmdCopyQueryPoolResults); |
- GET_PROC(CmdPushConstants); |
- GET_PROC(CmdBeginRenderPass); |
- GET_PROC(CmdNextSubpass); |
- GET_PROC(CmdEndRenderPass); |
- GET_PROC(CmdExecuteCommands); |
+ GET_DEV_PROC(QueueBindSparse); |
+ GET_DEV_PROC(CreateFence); |
+ GET_DEV_PROC(DestroyFence); |
+ GET_DEV_PROC(ResetFences); |
+ GET_DEV_PROC(GetFenceStatus); |
+ GET_DEV_PROC(WaitForFences); |
+ GET_DEV_PROC(CreateSemaphore); |
+ GET_DEV_PROC(DestroySemaphore); |
+ GET_DEV_PROC(CreateEvent); |
+ GET_DEV_PROC(DestroyEvent); |
+ GET_DEV_PROC(GetEventStatus); |
+ GET_DEV_PROC(SetEvent); |
+ GET_DEV_PROC(ResetEvent); |
+ GET_DEV_PROC(CreateQueryPool); |
+ GET_DEV_PROC(DestroyQueryPool); |
+ GET_DEV_PROC(GetQueryPoolResults); |
+ GET_DEV_PROC(CreateBuffer); |
+ GET_DEV_PROC(DestroyBuffer); |
+ GET_DEV_PROC(CreateBufferView); |
+ GET_DEV_PROC(DestroyBufferView); |
+ GET_DEV_PROC(CreateImage); |
+ GET_DEV_PROC(DestroyImage); |
+ GET_DEV_PROC(GetImageSubresourceLayout); |
+ GET_DEV_PROC(CreateImageView); |
+ GET_DEV_PROC(DestroyImageView); |
+ GET_DEV_PROC(CreateShaderModule); |
+ GET_DEV_PROC(DestroyShaderModule); |
+ GET_DEV_PROC(CreatePipelineCache); |
+ GET_DEV_PROC(DestroyPipelineCache); |
+ GET_DEV_PROC(GetPipelineCacheData); |
+ GET_DEV_PROC(MergePipelineCaches); |
+ GET_DEV_PROC(CreateGraphicsPipelines); |
+ GET_DEV_PROC(CreateComputePipelines); |
+ GET_DEV_PROC(DestroyPipeline); |
+ GET_DEV_PROC(CreatePipelineLayout); |
+ GET_DEV_PROC(DestroyPipelineLayout); |
+ GET_DEV_PROC(CreateSampler); |
+ GET_DEV_PROC(DestroySampler); |
+ GET_DEV_PROC(CreateDescriptorSetLayout); |
+ GET_DEV_PROC(DestroyDescriptorSetLayout); |
+ GET_DEV_PROC(CreateDescriptorPool); |
+ GET_DEV_PROC(DestroyDescriptorPool); |
+ GET_DEV_PROC(ResetDescriptorPool); |
+ GET_DEV_PROC(AllocateDescriptorSets); |
+ GET_DEV_PROC(FreeDescriptorSets); |
+ GET_DEV_PROC(UpdateDescriptorSets); |
+ GET_DEV_PROC(CreateFramebuffer); |
+ GET_DEV_PROC(DestroyFramebuffer); |
+ GET_DEV_PROC(CreateRenderPass); |
+ GET_DEV_PROC(DestroyRenderPass); |
+ GET_DEV_PROC(GetRenderAreaGranularity); |
+ GET_DEV_PROC(CreateCommandPool); |
+ GET_DEV_PROC(DestroyCommandPool); |
+ GET_DEV_PROC(ResetCommandPool); |
+ GET_DEV_PROC(AllocateCommandBuffers); |
+ GET_DEV_PROC(FreeCommandBuffers); |
+ GET_DEV_PROC(BeginCommandBuffer); |
+ GET_DEV_PROC(EndCommandBuffer); |
+ GET_DEV_PROC(ResetCommandBuffer); |
+ GET_DEV_PROC(CmdBindPipeline); |
+ GET_DEV_PROC(CmdSetViewport); |
+ GET_DEV_PROC(CmdSetScissor); |
+ GET_DEV_PROC(CmdSetLineWidth); |
+ GET_DEV_PROC(CmdSetDepthBias); |
+ GET_DEV_PROC(CmdSetBlendConstants); |
+ GET_DEV_PROC(CmdSetDepthBounds); |
+ GET_DEV_PROC(CmdSetStencilCompareMask); |
+ GET_DEV_PROC(CmdSetStencilWriteMask); |
+ GET_DEV_PROC(CmdSetStencilReference); |
+ GET_DEV_PROC(CmdBindDescriptorSets); |
+ GET_DEV_PROC(CmdBindIndexBuffer); |
+ GET_DEV_PROC(CmdBindVertexBuffers); |
+ GET_DEV_PROC(CmdDraw); |
+ GET_DEV_PROC(CmdDrawIndexed); |
+ GET_DEV_PROC(CmdDrawIndirect); |
+ GET_DEV_PROC(CmdDrawIndexedIndirect); |
+ GET_DEV_PROC(CmdDispatch); |
+ GET_DEV_PROC(CmdDispatchIndirect); |
+ GET_DEV_PROC(CmdCopyBuffer); |
+ GET_DEV_PROC(CmdCopyImage); |
+ GET_DEV_PROC(CmdBlitImage); |
+ GET_DEV_PROC(CmdCopyBufferToImage); |
+ GET_DEV_PROC(CmdCopyImageToBuffer); |
+ GET_DEV_PROC(CmdUpdateBuffer); |
+ GET_DEV_PROC(CmdFillBuffer); |
+ GET_DEV_PROC(CmdClearColorImage); |
+ GET_DEV_PROC(CmdClearDepthStencilImage); |
+ GET_DEV_PROC(CmdClearAttachments); |
+ GET_DEV_PROC(CmdResolveImage); |
+ GET_DEV_PROC(CmdSetEvent); |
+ GET_DEV_PROC(CmdResetEvent); |
+ GET_DEV_PROC(CmdWaitEvents); |
+ GET_DEV_PROC(CmdPipelineBarrier); |
+ GET_DEV_PROC(CmdBeginQuery); |
+ GET_DEV_PROC(CmdEndQuery); |
+ GET_DEV_PROC(CmdResetQueryPool); |
+ GET_DEV_PROC(CmdWriteTimestamp); |
+ GET_DEV_PROC(CmdCopyQueryPoolResults); |
+ GET_DEV_PROC(CmdPushConstants); |
+ GET_DEV_PROC(CmdBeginRenderPass); |
+ GET_DEV_PROC(CmdNextSubpass); |
+ GET_DEV_PROC(CmdEndRenderPass); |
+ GET_DEV_PROC(CmdExecuteCommands); |
// TODO: break these out with extension checks |
GET_PROC(DestroySurfaceKHR); |
GET_PROC(GetPhysicalDeviceSurfaceSupportKHR); |
GET_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR); |
GET_PROC(GetPhysicalDeviceSurfaceFormatsKHR); |
GET_PROC(GetPhysicalDeviceSurfacePresentModesKHR); |
- GET_PROC(CreateSwapchainKHR); |
- GET_PROC(DestroySwapchainKHR); |
- GET_PROC(GetSwapchainImagesKHR); |
- GET_PROC(AcquireNextImageKHR); |
- GET_PROC(QueuePresentKHR); |
+ GET_DEV_PROC(CreateSwapchainKHR); |
+ GET_DEV_PROC(DestroySwapchainKHR); |
+ GET_DEV_PROC(GetSwapchainImagesKHR); |
+ GET_DEV_PROC(AcquireNextImageKHR); |
+ GET_DEV_PROC(QueuePresentKHR); |
GET_PROC(GetPhysicalDeviceDisplayPropertiesKHR); |
GET_PROC(GetPhysicalDeviceDisplayPlanePropertiesKHR); |
GET_PROC(GetDisplayPlaneSupportedDisplaysKHR); |
@@ -186,7 +189,7 @@ const GrVkInterface* GrVkCreateInterface(VkInstance instance) { |
GET_PROC(CreateDisplayModeKHR); |
GET_PROC(GetDisplayPlaneCapabilitiesKHR); |
GET_PROC(CreateDisplayPlaneSurfaceKHR); |
- GET_PROC(CreateSharedSwapchainsKHR); |
+ GET_DEV_PROC(CreateSharedSwapchainsKHR); |
if (extensions.hasInstanceExtension(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) { |
GET_PROC(CreateDebugReportCallbackEXT); |