mesa: make use of NewWindowRectangles driver flags
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 2 Jun 2017 12:31:49 +0000 (14:31 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Jun 2017 09:47:31 +0000 (11:47 +0200)
Now, st_update_window_rectangles() won't be called when the
scissor is going to be updated.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/scissor.c
src/mesa/state_tracker/st_context.c

index fe2e4dbff657bdc95a052956e1f3cc4bf690ac82..13934f9ca205f6d8ce0ea2ae3b187a0bff022074 100644 (file)
@@ -253,7 +253,9 @@ _mesa_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box)
       box += 4;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+   FLUSH_VERTICES(ctx, 0);
+   ctx->NewDriverState |= ctx->DriverFlags.NewWindowRectangles;
+
    memcpy(ctx->Scissor.WindowRects, newval,
           sizeof(struct gl_scissor_rect) * count);
    ctx->Scissor.NumWindowRects = count;
index c901764668775d1ca2d14b74c1508c2af43f618b..8a5dd2f72549b215696a321dc88c5cb8eaac42a2 100644 (file)
@@ -193,8 +193,7 @@ void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state)
 
       if (new_state & _NEW_SCISSOR)
          st->dirty |= ST_NEW_RASTERIZER |
-                      ST_NEW_SCISSOR |
-                      ST_NEW_WINDOW_RECTANGLES;
+                      ST_NEW_SCISSOR;
 
       if (new_state & _NEW_FOG)
          st->dirty |= ST_NEW_FS_STATE;
@@ -514,6 +513,7 @@ static void st_init_driver_flags(struct gl_driver_flags *f)
    f->NewAtomicBuffer = ST_NEW_ATOMIC_BUFFER;
    f->NewShaderStorageBuffer = ST_NEW_STORAGE_BUFFER;
    f->NewImageUnits = ST_NEW_IMAGE_UNITS;
+   f->NewWindowRectangles = ST_NEW_WINDOW_RECTANGLES;
 }
 
 struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,