Merge branch 'pvr-allow-storage-wsi-images' into 'main'

pvr: allow STORAGE usage for WSI images

See merge request mesa/mesa!41382
This commit is contained in:
Icenowy Zheng 2026-05-08 08:10:17 +08:00
commit 9bc78b2405

View file

@ -629,6 +629,16 @@ pvr_get_image_format_properties(struct pvr_physical_device *pdevice,
goto err_unsupported_format;
}
/* Allow STORAGE usage for WSI linear images, which is expected by the
* Vulkan specification (because WSI images should be as capable as optimal
* images). WSI images are expected to be all 2D.
*/
if (vk_find_struct_const(info->pNext, WSI_IMAGE_CREATE_INFO_MESA) &&
tiling == VK_IMAGE_TILING_LINEAR &&
(pvr_format->bind & PVR_BIND_STORAGE_IMAGE)) {
tiling_features2 |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT;
}
/* If VK_IMAGE_CREATE_EXTENDED_USAGE_BIT is set, the driver can't decide if a
* specific format isn't supported based on the usage.
*/
@ -809,7 +819,8 @@ VkResult pvr_GetPhysicalDeviceImageFormatProperties2(
/* Extract input structs */
vk_foreach_struct_const (ext, pImageFormatInfo->pNext) {
switch (ext->sType) {
/* Casting to accept Mesa-private types w/o compiler warning */
switch ((unsigned)ext->sType) {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
external_info = (const void *)ext;
break;
@ -817,6 +828,7 @@ VkResult pvr_GetPhysicalDeviceImageFormatProperties2(
break;
case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO:
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT:
case VK_STRUCTURE_TYPE_WSI_IMAGE_CREATE_INFO_MESA:
/* Nothing to do here, it's handled in
* pvr_get_image_format_properties)
*/