anv: don't try to fast clear D/S with multiview

If multiview is enabled on the render pass, baseLayer and layerCount
will be 0 and 1 respectively and throw us off.
We can still fast clear if view_mask == 1, but anything else hits the
BLORP_BATCH_NO_EMIT_DEPTH_STENCIL restriction.

Fixes: e488773b29 ("anv: Fast clear depth/stencil surface in vkCmdClearAttachments")

Signed-off-by: Iván Briano <ivan.briano@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit 5d22f307d5)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
Iván Briano 2026-03-04 15:14:28 -08:00 committed by Eric Engestrom
parent 2a2dba1bc7
commit 836a22d1a2
2 changed files with 3 additions and 2 deletions

View file

@ -1024,7 +1024,7 @@
"description": "anv: don't try to fast clear D/S with multiview",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e488773b29d971a2f24904465cf027c9f4650a94",
"notes": null

View file

@ -2025,7 +2025,8 @@ can_hiz_clear_att(struct anv_cmd_buffer *cmd_buffer,
* clear the first slice of the currently configured depth/stencil view.
*/
assert(batch->flags & BLORP_BATCH_NO_EMIT_DEPTH_STENCIL);
if (pRects[0].layerCount > 1 || pRects[0].baseArrayLayer > 0)
if (cmd_buffer->state.gfx.view_mask > 1 ||
pRects[0].layerCount > 1 || pRects[0].baseArrayLayer > 0)
return false;
return anv_can_hiz_clear_image(cmd_buffer, ds_att->iview->image,