From be15028ede59bc1936be315321e8add7553641f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 10 Jun 2017 00:30:18 +0200 Subject: [PATCH] mesa: don't flag _NEW_SCISSOR for st/mesa MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Not needed and we get to bypass _mesa_update_state_locked that would be a no-op. Reviewed-by: Nicolai Hähnle Reviewed-by: Brian Paul Reviewed-by: Timothy Arceri --- src/mesa/main/enable.c | 6 ++++-- src/mesa/main/scissor.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 522b71e..9410d5e 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -670,7 +670,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) GLbitfield newEnabled = state * ((1 << ctx->Const.MaxViewports) - 1); if (newEnabled != ctx->Scissor.EnableFlags) { - FLUSH_VERTICES(ctx, _NEW_SCISSOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewScissorTest ? 0 : + _NEW_SCISSOR); ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; ctx->Scissor.EnableFlags = newEnabled; } @@ -1115,7 +1116,8 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap, return; } if (((ctx->Scissor.EnableFlags >> index) & 1) != state) { - FLUSH_VERTICES(ctx, _NEW_SCISSOR); + FLUSH_VERTICES(ctx, + ctx->DriverFlags.NewScissorTest ? 0 : _NEW_SCISSOR); ctx->NewDriverState |= ctx->DriverFlags.NewScissorTest; if (state) ctx->Scissor.EnableFlags |= (1 << index); diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c index 2f2e226..b38db06 100644 --- a/src/mesa/main/scissor.c +++ b/src/mesa/main/scissor.c @@ -48,7 +48,7 @@ set_scissor_no_notify(struct gl_context *ctx, unsigned idx, height == ctx->Scissor.ScissorArray[idx].Height) return; - FLUSH_VERTICES(ctx, _NEW_SCISSOR); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewScissorRect ? 0 : _NEW_SCISSOR); ctx->NewDriverState |= ctx->DriverFlags.NewScissorRect; ctx->Scissor.ScissorArray[idx].X = x; -- 2.7.4