Mesa (main): mesa/st: remove conditionals for driver state bits that are always set.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 23 19:35:10 UTC 2021


Module: Mesa
Branch: main
Commit: d2148af2cabcf2118e7008d8368384c020ec480c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d2148af2cabcf2118e7008d8368384c020ec480c

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Dec 20 13:23:41 2021 +1000

mesa/st: remove conditionals for driver state bits that are always set.

Just removes some conditional checks that never work out now.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14261>

---

 src/mesa/main/blend.c       | 3 +--
 src/mesa/main/enable.c      | 9 +++------
 src/mesa/main/multisample.c | 4 +---
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 93d632a17c7..0bc21a42ccc 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -850,8 +850,7 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
    case GL_NOTEQUAL:
    case GL_GEQUAL:
    case GL_ALWAYS:
-      FLUSH_VERTICES(ctx, ctx->DriverFlags.NewAlphaTest ? 0 : _NEW_COLOR,
-                     GL_COLOR_BUFFER_BIT);
+      FLUSH_VERTICES(ctx, 0, GL_COLOR_BUFFER_BIT);
       ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest;
       ctx->Color.AlphaFunc = func;
       ctx->Color.AlphaRefUnclamped = ref;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 059288c36f7..d033d626f52 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -353,8 +353,7 @@ _mesa_set_multisample(struct gl_context *ctx, GLboolean state)
    /* GL compatibility needs Multisample.Enable to determine program state
     * constants.
     */
-   if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES ||
-       !ctx->DriverFlags.NewMultisampleEnable) {
+   if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
       FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
    } else {
       FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
@@ -462,8 +461,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             /* The compatibility profile needs _NEW_TRANSFORM to transform
              * clip planes according to the projection matrix.
              */
-            if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES ||
-                !ctx->DriverFlags.NewClipPlaneEnable) {
+            if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
                FLUSH_VERTICES(ctx, _NEW_TRANSFORM,
                               GL_TRANSFORM_BIT | GL_ENABLE_BIT);
             } else {
@@ -1048,8 +1046,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             goto invalid_enum_error;
          if (ctx->Multisample.SampleShading == state)
             return;
-         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleShading ? 0 :
-                                                         _NEW_MULTISAMPLE,
+         FLUSH_VERTICES(ctx, 0,
                         GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
          ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading;
          ctx->Multisample.SampleShading = state;
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index a955a105a40..91592d7c691 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -192,9 +192,7 @@ min_sample_shading(struct gl_context *ctx, GLclampf value)
    if (ctx->Multisample.MinSampleShadingValue == value)
       return;
 
-   FLUSH_VERTICES(ctx,
-                  ctx->DriverFlags.NewSampleShading ? 0 : _NEW_MULTISAMPLE,
-                  GL_MULTISAMPLE_BIT);
+   FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT);
    ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading;
    ctx->Multisample.MinSampleShadingValue = value;
 }



More information about the mesa-commit mailing list