Add support for querying device group present capabilities
These functions are part of the VK_KHR_swapchain + VK1.1 interaction.
Test: dEQP-VK.wsi.xlib.*
Bug: b/124265819
Change-Id: Ic79bb0c290e68ab73ddc589c95f979603ecd1a82
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29168
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkGetProcAddress.cpp b/src/Vulkan/VkGetProcAddress.cpp
index 8416b3b..e1d3f9c 100644
--- a/src/Vulkan/VkGetProcAddress.cpp
+++ b/src/Vulkan/VkGetProcAddress.cpp
@@ -264,6 +264,8 @@
MAKE_VULKAN_DEVICE_ENTRY(vkGetSwapchainImagesKHR),
MAKE_VULKAN_DEVICE_ENTRY(vkAcquireNextImageKHR),
MAKE_VULKAN_DEVICE_ENTRY(vkQueuePresentKHR),
+ MAKE_VULKAN_DEVICE_ENTRY(vkGetDeviceGroupPresentCapabilitiesKHR),
+ MAKE_VULKAN_DEVICE_ENTRY(vkGetDeviceGroupSurfacePresentModesKHR),
#endif
};
#undef MAKE_VULKAN_DEVICE_ENTRY
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index f4d7d32..b2e9b91 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -2467,6 +2467,33 @@
return VK_SUCCESS;
}
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities)
+{
+ TRACE("(VkDevice device = 0x%X, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities = 0x%X)",
+ device, pDeviceGroupPresentCapabilities);
+
+ for (int i = 0; i < VK_MAX_DEVICE_GROUP_SIZE; i++)
+ {
+ // The only real physical device in the presentation group is device 0,
+ // and it can present to itself.
+ pDeviceGroupPresentCapabilities->presentMask[i] = (i == 0) ? 1 : 0;
+ }
+
+ pDeviceGroupPresentCapabilities->modes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR;
+
+ return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes)
+{
+ TRACE("(VkDevice device = 0x%X, VkSurfaceKHR surface = 0x%X, VkDeviceGroupPresentModeFlagsKHR *pModes = 0x%X)",
+ device, surface, pModes);
+
+ *pModes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR;
+ return VK_SUCCESS;
+}
+
#endif // ! __ANDROID__
}