lavapipe: skip format checks for EXTENDED_USAGE
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 9 Mar 2022 19:26:19 +0000 (14:26 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Mar 2022 20:24:01 +0000 (20:24 +0000)
we can effectively skip any kind of checks here and just assume that one
of two scenarios is in effect:
* the user is about to attempt some incredibly illegal behavior that VVL will catch
* the user is about to attempt a pro gamer move and we'll be fine

in either case, it's EXTENDED_USAGE, so hopefully we're about to make a texture
view from a compatible and supported format

cc: mesa-stable

fixes:
dEQP-VK.image.extended_usage_bit_compatibility.image_format_properties*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15320>

src/gallium/frontends/lavapipe/lvp_formats.c

index b30853a..6831a65 100644 (file)
@@ -230,6 +230,9 @@ static VkResult lvp_get_image_format_properties(struct lvp_physical_device *phys
       break;
    }
 
+   if (info->flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT)
+      goto skip_checks;
+
    if (info->usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
       if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
          goto unsupported;
@@ -273,6 +276,7 @@ static VkResult lvp_get_image_format_properties(struct lvp_physical_device *phys
       }
    }
 
+skip_checks:
    *pImageFormatProperties = (VkImageFormatProperties) {
       .maxExtent = maxExtent,
       .maxMipLevels = maxMipLevels,