Mesa (main): mesa/st: remove the viewport driver state flags

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


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

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

mesa/st: remove the viewport driver state flags

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/attrib.c              | 3 ++-
 src/mesa/main/mtypes.h              | 3 ---
 src/mesa/main/viewport.c            | 9 ++++-----
 src/mesa/state_tracker/st_context.c | 1 -
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index aa734c36aa5..7b844828893 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -62,6 +62,7 @@
 
 #include "state_tracker/st_cb_texture.h"
 #include "state_tracker/st_cb_viewport.h"
+#include "state_tracker/st_context.h"
 
 static inline bool
 copy_texture_attribs(struct gl_texture_object *dst,
@@ -1093,7 +1094,7 @@ _mesa_PopAttrib(void)
 
          if (memcmp(&ctx->ViewportArray[i].X, &vp->X, sizeof(float) * 6)) {
             ctx->NewState |= _NEW_VIEWPORT;
-            ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
+            ctx->NewDriverState |= ST_NEW_VIEWPORT;
 
             memcpy(&ctx->ViewportArray[i].X, &vp->X, sizeof(float) * 6);
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index c60657f64cc..29c964c8f50 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4866,9 +4866,6 @@ struct gl_driver_flags
    /** gl_context::PolygonStipple */
    uint64_t NewPolygonStipple;
 
-   /** gl_context::ViewportArray */
-   uint64_t NewViewport;
-
    /** Shader constants (uniforms, program parameters, state constants) */
    uint64_t NewShaderConstants[MESA_SHADER_STAGES];
 
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 12b0736f020..07e6ab1cc42 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -75,9 +75,8 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx,
        ctx->ViewportArray[idx].Height == height)
       return;
 
-   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewViewport ? 0 : _NEW_VIEWPORT,
-                  GL_VIEWPORT_BIT);
-   ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
+   FLUSH_VERTICES(ctx, 0, GL_VIEWPORT_BIT);
+   ctx->NewDriverState |= ST_NEW_VIEWPORT;
 
    ctx->ViewportArray[idx].X = x;
    ctx->ViewportArray[idx].Width = width;
@@ -295,7 +294,7 @@ set_depth_range_no_notify(struct gl_context *ctx, unsigned idx,
 
    /* The depth range is needed by program state constants. */
    FLUSH_VERTICES(ctx, _NEW_VIEWPORT, GL_VIEWPORT_BIT);
-   ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
+   ctx->NewDriverState |= ST_NEW_VIEWPORT;
 
    ctx->ViewportArray[idx].Near = SATURATE(nearval);
    ctx->ViewportArray[idx].Far = SATURATE(farval);
@@ -655,7 +654,7 @@ set_viewport_swizzle(struct gl_context *ctx, GLuint index,
       return;
 
    FLUSH_VERTICES(ctx, _NEW_VIEWPORT, GL_VIEWPORT_BIT);
-   ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
+   ctx->NewDriverState |= ST_NEW_VIEWPORT;
 
    viewport->SwizzleX = swizzlex;
    viewport->SwizzleY = swizzley;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 10c93a3ac79..c9db9b25668 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -512,7 +512,6 @@ st_init_driver_flags(struct st_context *st)
       f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
 
    f->NewPolygonStipple = ST_NEW_POLY_STIPPLE;
-   f->NewViewport = ST_NEW_VIEWPORT;
 
    if (st->emulate_gl_clamp)
       f->NewSamplersWithClamp = ST_NEW_SAMPLERS |



More information about the mesa-commit mailing list