From df4f0672d3f419baf078b29507db31bdec351048 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 Dec 2021 12:13:40 +1000 Subject: [PATCH] mesa/st: merge NewDepthClamp state flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Kenneth Graunke Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/enable.c | 15 ++++++--------- src/mesa/main/mtypes.h | 3 --- src/mesa/state_tracker/st_context.c | 2 -- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9e1a348ecdf..e94e098040e 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1178,10 +1178,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Transform.DepthClampNear == state && ctx->Transform.DepthClampFar == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM, + FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; + ctx->NewDriverState |= ST_NEW_RASTERIZER; ctx->Transform.DepthClampNear = state; ctx->Transform.DepthClampFar = state; break; @@ -1191,10 +1190,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Transform.DepthClampNear == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM, + FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; + ctx->NewDriverState |= ST_NEW_RASTERIZER; ctx->Transform.DepthClampNear = state; break; @@ -1203,10 +1201,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) goto invalid_enum_error; if (ctx->Transform.DepthClampFar == state) return; - FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 : - _NEW_TRANSFORM, + FLUSH_VERTICES(ctx, 0, GL_TRANSFORM_BIT | GL_ENABLE_BIT); - ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp; + ctx->NewDriverState |= ST_NEW_RASTERIZER; ctx->Transform.DepthClampFar = state; break; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d87a3299f54..c3fc03c030c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -4888,9 +4888,6 @@ struct gl_driver_flags /** gl_context::Color::ClampFragmentColor */ uint64_t NewFragClamp; - /** gl_context::Transform::DepthClamp */ - uint64_t NewDepthClamp; - /** gl_context::Line */ uint64_t NewLineState; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 36a46d628d8..979b338901f 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -509,8 +509,6 @@ st_init_driver_flags(struct st_context *st) f->NewFragClamp = ST_NEW_RASTERIZER; } - f->NewDepthClamp = ST_NEW_RASTERIZER; - if (st->lower_ucp) f->NewClipPlaneEnable = ST_NEW_VS_STATE | ST_NEW_GS_STATE; else