diff --git a/src/imagination/vulkan/pvr_formats.c b/src/imagination/vulkan/pvr_formats.c index b46a8454b79..16e0a18acc0 100644 --- a/src/imagination/vulkan/pvr_formats.c +++ b/src/imagination/vulkan/pvr_formats.c @@ -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) */