aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-09 20:51:20 +0200
committerMarek Olšák <[email protected]>2017-06-22 01:51:02 +0200
commit480bf7731bf54ac936ec7edfa977aeeb377745b6 (patch)
tree15f17a18a1eb04857a5c051967c36930ae336740 /src/mesa/main/enable.c
parentc2408838c83719cb133332c7adac71ef50503259 (diff)
mesa: stop using _NEW_STENCIL with st/mesa, use DriverFlags.NewStencil instead
This bypasses _mesa_update_state_locked. Before: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 3.99 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.56 million After: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.93 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 5.84 million It's quite a difference in the draw call rate when ctx->NewState stays equal to 0 the whole time. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 066beb6422b..522b71ecfc7 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -679,7 +679,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_STENCIL_TEST:
if (ctx->Stencil.Enabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL);
+ ctx->NewDriverState |= ctx->DriverFlags.NewStencil;
ctx->Stencil.Enabled = state;
break;
case GL_TEXTURE_1D:
@@ -905,7 +906,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
CHECK_EXTENSION(EXT_stencil_two_side, cap);
if (ctx->Stencil.TestTwoSide == state)
return;
- FLUSH_VERTICES(ctx, _NEW_STENCIL);
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL);
+ ctx->NewDriverState |= ctx->DriverFlags.NewStencil;
ctx->Stencil.TestTwoSide = state;
if (state) {
ctx->Stencil._BackFace = 2;