mesa: make use of NewScissorTest driver flags
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Jun 2017 13:23:58 +0000 (15:23 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 9 Jun 2017 07:33:28 +0000 (09:33 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/enable.c
src/mesa/state_tracker/st_context.c

index 52c791587ef41ed5b5ade0e2c4360c76d777d0b6..91c1f0d44726f290424d103cab2bbd416d26561c 100644 (file)
@@ -671,6 +671,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
                state * ((1 << ctx->Const.MaxViewports) - 1);
             if (newEnabled != ctx->Scissor.EnableFlags) {
                FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+               ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest;
                ctx->Scissor.EnableFlags = newEnabled;
             }
          }
@@ -1113,6 +1114,7 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
       }
       if (((ctx->Scissor.EnableFlags >> index) & 1) != state) {
          FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+         ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest;
          if (state)
             ctx->Scissor.EnableFlags |= (1 << index);
          else
index 1c1c55afe3c6d61848cad1ebebcdea1fc3dd3590..b99a53b3c7f6a391d7406fdd4da3d8ed5e38b438 100644 (file)
@@ -200,9 +200,6 @@ st_invalidate_state(struct gl_context * ctx)
       if (new_state & _NEW_PROGRAM)
          st->dirty |= ST_NEW_RASTERIZER;
 
-      if (new_state & _NEW_SCISSOR)
-         st->dirty |= ST_NEW_RASTERIZER;
-
       if (new_state & _NEW_FOG)
          st->dirty |= ST_NEW_FS_STATE;
 
@@ -523,6 +520,7 @@ static void st_init_driver_flags(struct st_context *st)
    f->NewWindowRectangles = ST_NEW_WINDOW_RECTANGLES;
    f->NewFramebufferSRGB = ST_NEW_FRAMEBUFFER;
    f->NewScissorRect = ST_NEW_SCISSOR;
+   f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
 }
 
 struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,