From 86f99c1e4c9aec6433ae1c6a68f8f9d395cbfac6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 9 Apr 2017 16:48:40 +0200 Subject: [PATCH] st/mesa: check in advance in st_draw_vbo whether the bitmap cache is empty Reviewed-by: Ilia Mirkin Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 8069f107880..d16160b656b 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -182,7 +182,9 @@ st_draw_vbo(struct gl_context *ctx, /* Mesa core state should have been validated already */ assert(ctx->NewState == 0x0); - st_flush_bitmap_cache(st); + if (unlikely(!st->bitmap.cache.empty)) + st_flush_bitmap_cache(st); + st_invalidate_readpix_cache(st); /* Validate state. */ -- 2.30.2