anv: Use image view base-layer in can_fast_clear_color_att()

We currently only support fast clearing the first layer of an image.
Attachments use VkImageView which can specify a base-layer of the view
for an image attachment.

Fixes: 44351d67f8 ("anv: Change params of anv_can_fast_clear_color_view")
Ref: https://projects.blender.org/blender/blender/issues/141181
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37562>
This commit is contained in:
Jordan Justen 2025-09-23 11:03:08 -07:00 committed by Marge Bot
parent 8949473023
commit be61c12f3e

View file

@ -1790,6 +1790,16 @@ can_fast_clear_color_att(struct anv_cmd_buffer *cmd_buffer,
if (pRects[0].layerCount > 1)
return false;
if (att->iview->n_planes != 1) {
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
"Fast clears for vkCmdClearAttachments not supported on "
"multiplanar images");
return false;
}
VkClearRect rect = pRects[0];
rect.baseArrayLayer += att->iview->planes[0].isl.base_array_layer;
bool is_multiview = cmd_buffer->state.gfx.view_mask != 0;
if (is_multiview && (cmd_buffer->state.gfx.view_mask != 1))
return false;
@ -1797,7 +1807,7 @@ can_fast_clear_color_att(struct anv_cmd_buffer *cmd_buffer,
return anv_can_fast_clear_color(cmd_buffer, att->iview->image,
att->iview->vk.aspects,
att->iview->vk.base_mip_level,
pRects, att->layout,
&rect, att->layout,
att->iview->planes[0].isl.format,
clear_color);
}