From 26280cbc2344a3ce550175ea198d136eba454a51 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 27 May 2026 20:09:24 +1000 Subject: [PATCH] mesa: flush bitmap cache when scissor box changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The glBitmap calls will flush the cache when scissors are enabled or disabled but doesn't handle a change in the scissor box itself. Fixes: 33ca53ac79ad ("st/mesa: fix the glBitmap cache wrt FS, scissor, and clamp color changes") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15505 Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/scissor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index b5abb64573f..b1e26962246 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -51,6 +51,12 @@ set_scissor_no_notify(struct gl_context *ctx, unsigned idx, height == ctx->Scissor.ScissorArray[idx].Height) return; + /* Flush bitmap cache if needed */ + struct st_context *st_ctx = st_context(ctx); + if (st_ctx && st_ctx->bitmap.cache.empty == GL_FALSE && idx == 0) { + st_flush_bitmap_cache(st_ctx); + } + FLUSH_VERTICES(ctx, 0, GL_SCISSOR_BIT); ST_SET_STATE(ctx->NewDriverState, ST_NEW_SCISSOR);