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 <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/vulkan/VulkanFunctions.cpp b/src/dawn_native/vulkan/VulkanFunctions.cpp
index 261aabe..2e052e7 100644
--- a/src/dawn_native/vulkan/VulkanFunctions.cpp
+++ b/src/dawn_native/vulkan/VulkanFunctions.cpp
@@ -300,6 +300,20 @@
             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 @@
         }
 #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 2e6218e..eb20ee6 100644
--- a/src/dawn_native/vulkan/VulkanFunctions.h
+++ b/src/dawn_native/vulkan/VulkanFunctions.h
@@ -267,13 +267,6 @@
         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 @@
         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;