From efc6a3053d113ee51ccc47e5caec58dc72f9362a Mon Sep 17 00:00:00 2001 From: Calder Young Date: Tue, 5 May 2026 21:24:30 -0700 Subject: [PATCH] anv: Fix some usage flags not propagated to ISL for explicit layouts Some vulkancts tests rely on vkGetImageMemoryRequirements to return the same exact size after exporting and importing an image. This broke when we started adding padding to sampled surfaces to manage overfetch, because the texture usage flag does not get applied to the ISL surface when the image is recreated using an explicit layout. Fixes: 8d13628f7 ("isl: Add additional alignment/padding requirements to prevent overfetch") Reviewed-by: Lionel Landwerlin Cc: mesa-stable Part-of: --- src/intel/vulkan/anv_image.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 45e16754d62..33af7b44dfa 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1557,12 +1557,20 @@ add_all_surfaces_explicit_layout( plane, image->vk.tiling); const VkSubresourceLayout *primary_layout = &drm_info->pPlaneLayouts[plane]; + VkImageUsageFlags vk_usage = vk_image_usage(&image->vk, aspect); + isl_surf_usage_flags_t isl_usage = + anv_image_choose_isl_surf_usage(device->physical, + image->vk.format, + format_list_info, + image->vk.create_flags, vk_usage, + isl_extra_usage_flags, aspect, + image->vk.compr_flags); + result = add_primary_surface(device, image, plane, format_plane, primary_layout->offset, primary_layout->rowPitch, - isl_tiling_flags, - isl_extra_usage_flags); + isl_tiling_flags, isl_usage); if (result != VK_SUCCESS) return result;