From 7de72fc3a65ea53637bc74a2619d8dd31322f9dd Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 12 Dec 2025 13:46:07 -0500 Subject: [PATCH] iris: Fix pipe control around fast-clears Use the right pipe control helper function so that texture invalidates occur after the end-of-pipe sync rather than during. Fixes: 23658920d13 ("anv,iris: Skip tex invalidate for clear conversion") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12550 Reviewed-by: Lionel Landwerlin (cherry picked from commit 18e67d853f2efb7d631b5a914a294f16273e3bba) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_clear.c | 30 ++++++++++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d6743dfb54a..63467f63dd9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -24,7 +24,7 @@ "description": "iris: Fix pipe control around fast-clears", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "23658920d138fc12b730a320325d8f5f1a9978bd", "notes": null diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index fcb281660e9..fa0abfb3767 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -280,14 +280,28 @@ fast_clear_color(struct iris_context *ice, * and again afterwards to ensure that the resolve is complete before we * do any more regular drawing. */ - iris_emit_end_of_pipe_sync(batch, "fast clear: pre-flush", - PIPE_CONTROL_RENDER_TARGET_FLUSH | - (devinfo->ver == 12 ? PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE | - PIPE_CONTROL_TILE_CACHE_FLUSH : 0) | - (devinfo->verx10 == 120 ? PIPE_CONTROL_DEPTH_STALL : 0) | - (devinfo->verx10 == 125 ? PIPE_CONTROL_FLUSH_HDC | - PIPE_CONTROL_DATA_CACHE_FLUSH : 0) | - PIPE_CONTROL_PSS_STALL_SYNC); + if (devinfo->ver >= 20) { + iris_emit_pipe_control_flush(batch, "fast clear: pre-flush", + PIPE_CONTROL_RENDER_TARGET_FLUSH | + PIPE_CONTROL_PSS_STALL_SYNC); + } else if (devinfo->verx10 >= 125) { + iris_emit_pipe_control_flush(batch, "fast clear: pre-flush", + PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE | + PIPE_CONTROL_DATA_CACHE_FLUSH | + PIPE_CONTROL_FLUSH_HDC | + PIPE_CONTROL_RENDER_TARGET_FLUSH | + PIPE_CONTROL_TILE_CACHE_FLUSH | + PIPE_CONTROL_PSS_STALL_SYNC); + } else if (devinfo->verx10 >= 120) { + iris_emit_pipe_control_flush(batch, "fast clear: pre-flush", + PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE | + PIPE_CONTROL_RENDER_TARGET_FLUSH | + PIPE_CONTROL_TILE_CACHE_FLUSH | + PIPE_CONTROL_DEPTH_STALL); + } else { + iris_emit_end_of_pipe_sync(batch, "fast clear: pre-flush", + PIPE_CONTROL_RENDER_TARGET_FLUSH); + } /* Update the clear color now that previous rendering is complete. */ if (color_changed && res->aux.clear_color_bo)