[Mesa-dev] [PATCH 6/7] st/mesa: check in advance in st_draw_vbo whether the bitmap cache is empty

Marek Olšák maraeo at gmail.com
Fri Apr 14 15:07:13 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 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 dd374ae..d710284 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -173,21 +173,23 @@ st_draw_vbo(struct gl_context *ctx,
             struct gl_buffer_object *indirect)
 {
    struct st_context *st = st_context(ctx);
    struct pipe_draw_info info;
    const struct gl_vertex_array **arrays = ctx->Array._DrawArrays;
    unsigned i;
 
    /* 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. */
    if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK ||
        st->gfx_shaders_may_be_dirty) {
       st_validate_state(st, ST_PIPELINE_RENDER);
    }
 
    if (st->vertex_array_out_of_memory) {
       return;
-- 
2.7.4



More information about the mesa-dev mailing list