mesa/st: move invalidate_on_gl_viewport to ctx

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>
This commit is contained in:
Dave Airlie 2022-01-24 16:30:18 +10:00
parent 0ba5def21a
commit 840aabe752
5 changed files with 10 additions and 10 deletions

View 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);
}
}

View 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;
/*@}*/
/**

View 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);
}

View 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;

View 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;