From 0766ce6ed1b607ad8353d6bf93e456dcf32c0e0a Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 7 Dec 2021 09:32:08 +0000 Subject: [PATCH] Vulkan: Load procs for VK_KHR_get_memory_requirements2 Bug: dawn:1223 Change-Id: I14f6bfd66ac35a2d80b70fd121bd3be5e9670352 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71761 Reviewed-by: Austin Eng Reviewed-by: Loko Kung Commit-Queue: Corentin Wallez --- src/dawn_native/vulkan/VulkanFunctions.cpp | 22 ++++++++++++++-------- src/dawn_native/vulkan/VulkanFunctions.h | 19 ++++++++++++------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/dawn_native/vulkan/VulkanFunctions.cpp b/src/dawn_native/vulkan/VulkanFunctions.cpp index 261aabe7a8..2e052e73b4 100644 --- a/src/dawn_native/vulkan/VulkanFunctions.cpp +++ b/src/dawn_native/vulkan/VulkanFunctions.cpp @@ -300,6 +300,20 @@ namespace dawn_native { namespace vulkan { GET_DEVICE_PROC(GetSemaphoreFdKHR); } + if (deviceInfo.HasExt(DeviceExt::Swapchain)) { + GET_DEVICE_PROC(CreateSwapchainKHR); + GET_DEVICE_PROC(DestroySwapchainKHR); + GET_DEVICE_PROC(GetSwapchainImagesKHR); + GET_DEVICE_PROC(AcquireNextImageKHR); + GET_DEVICE_PROC(QueuePresentKHR); + } + + if (deviceInfo.HasExt(DeviceExt::GetMemoryRequirements2)) { + GET_DEVICE_PROC(GetBufferMemoryRequirements2); + GET_DEVICE_PROC(GetImageMemoryRequirements2); + GET_DEVICE_PROC(GetImageSparseMemoryRequirements2); + } + #if VK_USE_PLATFORM_FUCHSIA if (deviceInfo.HasExt(DeviceExt::ExternalMemoryZirconHandle)) { GET_DEVICE_PROC(GetMemoryZirconHandleFUCHSIA); @@ -312,14 +326,6 @@ namespace dawn_native { namespace vulkan { } #endif - if (deviceInfo.HasExt(DeviceExt::Swapchain)) { - GET_DEVICE_PROC(CreateSwapchainKHR); - GET_DEVICE_PROC(DestroySwapchainKHR); - GET_DEVICE_PROC(GetSwapchainImagesKHR); - GET_DEVICE_PROC(AcquireNextImageKHR); - GET_DEVICE_PROC(QueuePresentKHR); - } - return {}; } diff --git a/src/dawn_native/vulkan/VulkanFunctions.h b/src/dawn_native/vulkan/VulkanFunctions.h index 2e6218ee27..eb20ee67be 100644 --- a/src/dawn_native/vulkan/VulkanFunctions.h +++ b/src/dawn_native/vulkan/VulkanFunctions.h @@ -267,13 +267,6 @@ namespace dawn_native { namespace vulkan { PFN_vkUpdateDescriptorSets UpdateDescriptorSets = nullptr; PFN_vkWaitForFences WaitForFences = nullptr; - // VK_KHR_swapchain - PFN_vkCreateSwapchainKHR CreateSwapchainKHR = nullptr; - PFN_vkDestroySwapchainKHR DestroySwapchainKHR = nullptr; - PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR = nullptr; - PFN_vkAcquireNextImageKHR AcquireNextImageKHR = nullptr; - PFN_vkQueuePresentKHR QueuePresentKHR = nullptr; - // VK_KHR_external_memory_fd PFN_vkGetMemoryFdKHR GetMemoryFdKHR = nullptr; PFN_vkGetMemoryFdPropertiesKHR GetMemoryFdPropertiesKHR = nullptr; @@ -282,6 +275,18 @@ namespace dawn_native { namespace vulkan { PFN_vkImportSemaphoreFdKHR ImportSemaphoreFdKHR = nullptr; PFN_vkGetSemaphoreFdKHR GetSemaphoreFdKHR = nullptr; + // VK_KHR_get_memory_requirements2 + PFN_vkGetBufferMemoryRequirements2KHR GetBufferMemoryRequirements2 = nullptr; + PFN_vkGetImageMemoryRequirements2KHR GetImageMemoryRequirements2 = nullptr; + PFN_vkGetImageSparseMemoryRequirements2KHR GetImageSparseMemoryRequirements2 = nullptr; + + // VK_KHR_swapchain + PFN_vkCreateSwapchainKHR CreateSwapchainKHR = nullptr; + PFN_vkDestroySwapchainKHR DestroySwapchainKHR = nullptr; + PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR = nullptr; + PFN_vkAcquireNextImageKHR AcquireNextImageKHR = nullptr; + PFN_vkQueuePresentKHR QueuePresentKHR = nullptr; + #if VK_USE_PLATFORM_FUCHSIA // VK_FUCHSIA_external_memory PFN_vkGetMemoryZirconHandleFUCHSIA GetMemoryZirconHandleFUCHSIA = nullptr;