From 826281a2f6617e6e2aa4fd906002a6e7ea229117 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 (cherry picked from commit efc6a3053d113ee51ccc47e5caec58dc72f9362a) Part-of: --- .pick_status.json | 2 +- src/intel/vulkan/anv_image.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e0266ebf447..f08bd93927b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2814,7 +2814,7 @@ "description": "anv: Fix some usage flags not propagated to ISL for explicit layouts", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "8d13628f7f4a7ae139fc91521c2bb7be1571004e", "notes": null diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 61db8b0e5b4..724829d4fd7 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1538,12 +1538,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;