diff options
author | Marek Olšák <[email protected]> | 2017-06-10 00:58:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-06-22 01:51:02 +0200 |
commit | 37b834923d31bb170ffbfac882476659060b78b2 (patch) | |
tree | 2ec1e7563df2c6839549b7e738e80a035a27e57b /src | |
parent | a9315627bc35d5447484a804ecd891c8711a49d3 (diff) |
mesa: don't flag _NEW_DEPTH for st/mesa
skipping _mesa_update_state_locked
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/depth.c | 9 | ||||
-rw-r--r-- | src/mesa/main/enable.c | 6 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 4 |
4 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index c3534407599..1ea7d1af5c0 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -83,7 +83,8 @@ _mesa_DepthFunc( GLenum func ) return; } - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.Func = func; if (ctx->Driver.DepthFunc) @@ -107,7 +108,8 @@ _mesa_DepthMask( GLboolean flag ) if (ctx->Depth.Mask == flag) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.Mask = flag; if (ctx->Driver.DepthMask) @@ -138,7 +140,8 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ) if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.BoundsMin = (GLfloat) zmin; ctx->Depth.BoundsMax = (GLfloat) zmax; } diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9410d5ea94e..5a37770d009 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -365,7 +365,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_DEPTH_TEST: if (ctx->Depth.Test == state) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.Test = state; break; case GL_DEBUG_OUTPUT: @@ -934,7 +935,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) CHECK_EXTENSION(EXT_depth_bounds_test, cap); if (ctx->Depth.BoundsTest == state) return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH); + ctx->NewDriverState |= ctx->DriverFlags.NewDepth; ctx->Depth.BoundsTest = state; break; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5fb4fc50441..e78554bd0b0 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -4475,6 +4475,9 @@ struct gl_driver_flags /** gl_context::Scissor::ScissorArray */ uint64_t NewScissorRect; + /** gl_context::Depth */ + uint64_t NewDepth; + /** gl_context::Stencil */ uint64_t NewStencil; }; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b7bdc47bd53..dff40c67604 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -193,9 +193,6 @@ st_invalidate_state(struct gl_context * ctx) /* These set a subset of flags set by _NEW_BUFFERS, so we only have to * check them when _NEW_BUFFERS isn't set. */ - if (new_state & _NEW_DEPTH) - st->dirty |= ST_NEW_DSA; - if (new_state & _NEW_PROGRAM) st->dirty |= ST_NEW_RASTERIZER; @@ -522,6 +519,7 @@ static void st_init_driver_flags(struct st_context *st) f->NewFramebufferSRGB = ST_NEW_FB_STATE; f->NewScissorRect = ST_NEW_SCISSOR; f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER; + f->NewDepth = ST_NEW_DSA; f->NewStencil = ST_NEW_DSA; } |