vulkan/wsi: Take max extent into consideration for modifier selection.

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 <mdaenzer@redhat.com>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18139>
(cherry picked from commit bb2a444324)
This commit is contained in:
Bas Nieuwenhuizen
2022-08-19 14:17:28 +02:00
committed by Dylan Baker
parent a3e250c789
commit 78e12c983e
2 changed files with 4 additions and 2 deletions

View File

@@ -11425,7 +11425,7 @@
"description": "vulkan/wsi: Take max extent into consideration for modifier selection.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -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];
}