st/mesa: move bitmap cache flushing out of state validation
authorBrian Paul <brianp@vmware.com>
Wed, 6 Jan 2016 01:28:57 +0000 (18:28 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 6 Jan 2016 22:53:46 +0000 (15:53 -0700)
Just do it where needed (before drawing, clearing, etc).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_drawtex.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw_feedback.c

index c1a9d00..337213c 100644 (file)
@@ -33,7 +33,6 @@
 #include "pipe/p_defines.h"
 #include "st_context.h"
 #include "st_atom.h"
-#include "st_cb_bitmap.h"
 #include "st_program.h"
 #include "st_manager.h"
 
@@ -181,9 +180,6 @@ void st_validate_state( struct st_context *st )
 
    check_attrib_edgeflag(st);
 
-   if (state->mesa)
-      st_flush_bitmap_cache(st);
-
    check_program_state( st );
 
    st_manager_validate_framebuffers(st);
index e09f5ec..7b6d10e 100644 (file)
@@ -41,6 +41,7 @@
 #include "program/prog_instruction.h"
 #include "st_context.h"
 #include "st_atom.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_clear.h"
 #include "st_cb_fbo.h"
 #include "st_format.h"
@@ -466,6 +467,8 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
    GLbitfield clear_buffers = 0x0;
    GLuint i;
 
+   st_flush_bitmap_cache(st);
+
    /* This makes sure the pipe has the latest scissor, etc values */
    st_validate_state( st );
 
index 86e8a55..7ed52dd 100644 (file)
@@ -50,6 +50,7 @@
 
 #include "st_atom.h"
 #include "st_atom_constbuf.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_drawpixels.h"
 #include "st_cb_readpixels.h"
 #include "st_cb_fbo.h"
@@ -1063,6 +1064,8 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
    /* Mesa state should be up to date by now */
    assert(ctx->NewState == 0x0);
 
+   st_flush_bitmap_cache(st);
+
    st_validate_state(st);
 
    /* Limit the size of the glDrawPixels to the max texture size.
@@ -1422,6 +1425,8 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
    GLint readX, readY, readW, readH;
    struct gl_pixelstore_attrib pack = ctx->DefaultPacking;
 
+   st_flush_bitmap_cache(st);
+
    st_validate_state(st);
 
    if (type == GL_DEPTH_STENCIL) {
index b3e4b5b..e6ab77f 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "st_context.h"
 #include "st_atom.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_drawtex.h"
 
 #include "pipe/p_context.h"
@@ -113,6 +114,8 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
    struct pipe_vertex_element velements[2 + MAX_TEXTURE_UNITS];
    unsigned offset;
 
+   st_flush_bitmap_cache(st);
+
    st_validate_state(st);
 
    /* determine if we need vertex color */
index 63b4622..d7a9716 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "st_context.h"
 #include "st_atom.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_bufferobjects.h"
 #include "st_cb_xformfb.h"
 #include "st_debug.h"
@@ -197,6 +198,8 @@ st_draw_vbo(struct gl_context *ctx,
    /* Mesa core state should have been validated already */
    assert(ctx->NewState == 0x0);
 
+   st_flush_bitmap_cache(st);
+
    /* Validate state. */
    if (st->dirty.st || ctx->NewDriverState) {
       st_validate_state(st);
index 88c10a8..b6e6dea 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "st_context.h"
 #include "st_atom.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_bufferobjects.h"
 #include "st_draw.h"
 #include "st_program.h"
@@ -137,6 +138,8 @@ st_feedback_draw_vbo(struct gl_context *ctx,
 
    assert(draw);
 
+   st_flush_bitmap_cache(st);
+
    st_validate_state(st);
 
    if (!index_bounds_valid)