mesa/st: move invalidate_on_gl_viewport to ctx
authorDave Airlie <airlied@redhat.com>
Mon, 24 Jan 2022 06:30:18 +0000 (16:30 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 24 Jan 2022 21:04:23 +0000 (07:04 +1000)
This is cleaner in the gl context now.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>

src/mesa/main/attrib.c
src/mesa/main/mtypes.h
src/mesa/main/viewport.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_manager.c

index 667b890..b69edd7 100644 (file)
@@ -62,7 +62,6 @@
 
 #include "state_tracker/st_cb_texture.h"
 #include "state_tracker/st_manager.h"
-#include "state_tracker/st_context.h"
 #include "state_tracker/st_sampler_view.h"
 
 static inline bool
@@ -1093,7 +1092,7 @@ _mesa_PopAttrib(void)
 
             memcpy(&ctx->ViewportArray[i].X, &vp->X, sizeof(float) * 6);
 
-            if (st_context(ctx)->invalidate_on_gl_viewport)
+            if (ctx->invalidate_on_gl_viewport)
                st_manager_invalidate_drawables(ctx);
          }
       }
index a5adc7f..62ad6bc 100644 (file)
@@ -3585,6 +3585,11 @@ struct gl_context
    struct st_config_options *st_opts;
    struct cso_context *cso_context;
    bool has_invalidate_buffer;
+   /* On old libGL's for linux we need to invalidate the drawables
+    * on glViewpport calls, this is set via a option.
+    */
+   bool invalidate_on_gl_viewport;
+
    /*@}*/
 
    /**
index da4d873..9b31eb9 100644 (file)
@@ -116,7 +116,7 @@ viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width,
    for (unsigned i = 0; i < ctx->Const.MaxViewports; i++)
       set_viewport_no_notify(ctx, i, input.X, input.Y, input.Width, input.Height);
 
-   if (st_context(ctx)->invalidate_on_gl_viewport)
+   if (ctx->invalidate_on_gl_viewport)
       st_manager_invalidate_drawables(ctx);
 }
 
@@ -169,7 +169,7 @@ _mesa_set_viewport(struct gl_context *ctx, unsigned idx, GLfloat x, GLfloat y,
    clamp_viewport(ctx, &x, &y, &width, &height);
    set_viewport_no_notify(ctx, idx, x, y, width, height);
 
-   if (st_context(ctx)->invalidate_on_gl_viewport)
+   if (ctx->invalidate_on_gl_viewport)
       st_manager_invalidate_drawables(ctx);
 }
 
@@ -185,7 +185,7 @@ viewport_array(struct gl_context *ctx, GLuint first, GLsizei count,
                              inputs[i].Width, inputs[i].Height);
    }
 
-   if (st_context(ctx)->invalidate_on_gl_viewport)
+   if (ctx->invalidate_on_gl_viewport)
       st_manager_invalidate_drawables(ctx);
 }
 
index 9065110..af629ba 100644 (file)
@@ -186,10 +186,6 @@ struct st_context
    boolean emulate_gl_clamp;
    boolean texture_buffer_sampler;
 
-   /* On old libGL's for linux we need to invalidate the drawables
-    * on glViewpport calls, this is set via a option.
-    */
-   boolean invalidate_on_gl_viewport;
    boolean draw_needs_minmax_index;
    boolean has_hw_atomics;
 
index 04c22fe..a3ac106 100644 (file)
@@ -1118,7 +1118,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
 
    st->can_scissor_clear = !!st->screen->get_param(st->screen, PIPE_CAP_CLEAR_SCISSORED);
 
-   st->invalidate_on_gl_viewport =
+   st->ctx->invalidate_on_gl_viewport =
       smapi->get_param(smapi, ST_MANAGER_BROKEN_INVALIDATE);
 
    st->iface.destroy = st_context_destroy;