From 8eddb8e456268c873e87f176d22eab3982400215 Mon Sep 17 00:00:00 2001 From: Nataraj Deshpande Date: Thu, 14 Aug 2025 11:12:18 -0700 Subject: [PATCH] anv: add feature flags for linearly tiled ASTC images In case of emulated ASTC on supported platforms, currently returning 0 for linear tiled images causes vpGetPhysicalDeviceProfileSupport failure during AndroidBaselineProfile test. The patch handles it similar to linearly-tiled images that are used for transfers. Fixes android.graphics.cts.VulkanFeaturesTest#testAndroidBaselineProfile2021Support. Cc: mesa-stable Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit f67edacf8b4217606d6ad9b5938a2ea6dd10d2db) --- .pick_status.json | 2 +- src/intel/vulkan/anv_formats.c | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d4a89b84028..9dc90b97132 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -8404,7 +8404,7 @@ "description": "anv: add feature flags for linearly tiled ASTC images", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index 66804c65f9b..cf7d9925527 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -660,17 +660,19 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device if (anv_is_compressed_format_emulated(physical_device, vk_format)) { assert(isl_format_is_compressed(anv_format->planes[0].isl_format)); - /* require optimal tiling so that we can decompress on upload */ - if (vk_tiling != VK_IMAGE_TILING_OPTIMAL) - return 0; - - /* required features for compressed formats */ - flags |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT | - VK_FORMAT_FEATURE_2_BLIT_SRC_BIT | - VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT | - VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT | - VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT; - + /* Require optimal tiling so that we can decompress on upload */ + if (vk_tiling == VK_IMAGE_TILING_OPTIMAL) { + /* Required features for compressed formats */ + flags |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT | + VK_FORMAT_FEATURE_2_BLIT_SRC_BIT | + VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT | + VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT | + VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT; + } else if (vk_tiling == VK_IMAGE_TILING_LINEAR) { + /* Images used for transfers */ + flags |= VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT | + VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT; + } return flags; }