From 18e67d853f2efb7d631b5a914a294f16273e3bba 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 Part-of: --- src/gallium/drivers/iris/iris_clear.c | 30 ++++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) 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)