diff options
| author | Nanley Chery <nanley.g.chery@intel.com> | 2023-07-20 09:40:04 -0400 |
|---|---|---|
| committer | Eric Engestrom <eric@engestrom.ch> | 2023-07-21 18:08:11 +0100 |
| commit | 186da6f7db6236907cb2b9f1408d6c87ac69c355 (patch) | |
| tree | 5e2176a42e6fed052c37c906af217873106b22fb | |
| parent | 3ed532d994ffa344cbf3992e09bc4150d8144ce4 (diff) | |
anv: Don't support ASTC images with modifiers
Before this change, anv_get_image_format_features2 reported support for
ASTC formats with any modifier (even those not supported by anv). But,
we didn't intend to support that compressed image format with modifiers.
With this change, the format feature function reports no support for
modifiers on ASTC-formatted images.
This prevents the next patch from causing assertion failures due to
unsupported modifiers.
Fixes: 355f3188438 ("anv: Allow transfer-only linear ASTC images")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
(cherry picked from commit e50af52e3d9ad7a0a2bdeef5cfea19c973b25aa4)
| -rw-r--r-- | .pick_status.json | 2 | ||||
| -rw-r--r-- | src/intel/vulkan/anv_formats.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 1b9294ebf6e..5e19e48cbdf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -463,7 +463,7 @@ "description": "anv: Don't support ASTC images with modifiers", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "355f3188438d22712850d65e48660d8f46316dc5" }, diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index 4ef35802106..52ae9f28521 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -577,11 +577,16 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device enum isl_format base_isl_format = base_plane_format.isl_format; if (isl_format_supports_sampling(devinfo, plane_format.isl_format)) { - /* ASTC textures must be in Y-tiled memory, and we reject compressed - * formats with modifiers. We do however interpret ASTC textures with - * uncompressed formats during data transfers. + + /* Unlike other surface formats, our sampler requires that the ASTC + * format only be used on surfaces in non-linearly-tiled memory. + * Thankfully, we can make an exception for linearly-tiled images that + * are only used for transfers. blorp_copy will reinterpret any + * compressed format to an uncompressed one. + * + * We handle modifier tilings further down in this function. */ - if (vk_tiling != VK_IMAGE_TILING_OPTIMAL && + if (vk_tiling == VK_IMAGE_TILING_LINEAR && isl_format_get_layout(plane_format.isl_format)->txc == ISL_TXC_ASTC) return VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT; |
