anv: Fix some usage flags not propagated to ISL for explicit layouts
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41376>
This commit is contained in:
Calder Young 2026-05-05 21:24:30 -07:00 committed by Marge Bot
parent 5636a57f60
commit efc6a3053d

View file

@ -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;