mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 16:18:06 +02:00
vulkan/wsi/headless: populate VkSurfacePresentModeCompatibilityKHR
Previously, we ignored this struct which caused VVL to treat the compatible mode list as NULL, causing false positive validation errors on headless applications. Closes: #14622 Cc: mesa-stable Signed-off-by: llyyr <llyyr.public@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39218>
This commit is contained in:
parent
28cda1732a
commit
9cd5a4849a
1 changed files with 20 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue