From bb2a44432400f6c7613905eceb14c6544687ed1f Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Fri, 19 Aug 2022 14:17:28 +0200 Subject: [PATCH] vulkan/wsi: Take max extent into consideration for modifier selection. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For AMD we kinda have some modifiers with a max size ... (Which is really a compositor/kms issue, but getting them to try kinda falls into the unsolved "how to allocate/what pitch to use" bucket, so we solve it on the allocating side) Cc: mesa-stable Tested-by: Michel Dänzer Reviewed-by: Joshua Ashton Part-of: --- src/vulkan/wsi/wsi_common_drm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index a767cb4d549..628715079f7 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -400,7 +400,9 @@ wsi_configure_native_image(const struct wsi_swapchain *chain, result = wsi->GetPhysicalDeviceImageFormatProperties2(wsi->pdevice, &format_info, &format_props); - if (result == VK_SUCCESS) + if (result == VK_SUCCESS && + pCreateInfo->imageExtent.width <= format_props.imageFormatProperties.maxExtent.width && + pCreateInfo->imageExtent.height <= format_props.imageFormatProperties.maxExtent.height) info->modifier_props[info->modifier_prop_count++] = info->modifier_props[i]; }