diff --git a/.pick_status.json b/.pick_status.json index d6553e7bff0..a806f395b77 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1384,7 +1384,7 @@ "description": "vulkan/wsi/headless: populate VkSurfacePresentModeCompatibilityKHR", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/vulkan/wsi/wsi_common_headless.c b/src/vulkan/wsi/wsi_common_headless.c index 236e092c522..a7d73e7c3e3 100644 --- a/src/vulkan/wsi/wsi_common_headless.c +++ b/src/vulkan/wsi/wsi_common_headless.c @@ -100,6 +100,9 @@ wsi_headless_surface_get_capabilities2(VkIcdSurfaceBase *surface, { assert(caps->sType == VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR); + const VkSurfacePresentModeKHR *present_mode = + vk_find_struct_const(info_next, SURFACE_PRESENT_MODE_EXT); + VkResult result = wsi_headless_surface_get_capabilities(surface, wsi_device, &caps->surfaceCapabilities); @@ -111,6 +114,23 @@ wsi_headless_surface_get_capabilities2(VkIcdSurfaceBase *surface, protected->supportsProtected = VK_FALSE; break; } + case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_KHR: { + /* Unsupported */ + VkSurfacePresentModeCompatibilityKHR *compat = (void *)ext; + if (compat->pPresentModes == NULL) { + if (!present_mode) { + wsi_common_vk_warn_once("Use of VkSurfacePresentModeCompatibilityKHR " + "without a VkSurfacePresentModeKHR set. This is an " + "application bug.\n"); + } + compat->presentModeCount = 1; + } else if (compat->presentModeCount) { + assert(present_mode); + compat->presentModeCount = 1; + compat->pPresentModes[0] = present_mode->presentMode; + } + break; + } default: /* Ignored */