mesa/st: remove emulate_gl_clamp from st_context

emulate_gl_clamp is the negation of screen->caps.gl_clamp.
Replace all call sites with !screen->caps.gl_clamp directly.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41184>
This commit is contained in:
Vishnu Vardan 2026-04-25 22:08:51 -04:00 committed by Marge Bot
parent 22c321327c
commit 9455710aaf
4 changed files with 4 additions and 7 deletions

View file

@ -75,7 +75,7 @@ get_texture_index(struct gl_context *ctx, const unsigned unit)
static void
update_gl_clamp(struct st_context *st, struct gl_program *prog, uint32_t *gl_clamp)
{
if (!st->emulate_gl_clamp)
if (st->screen->caps.gl_clamp)
return;
if (!st->ctx->Texture.NumSamplersWithClamp)

View file

@ -418,7 +418,7 @@ st_init_driver_flags(struct st_context *st)
ST_NEW_TES_STATE);
}
if (st->emulate_gl_clamp) {
if (!st->screen->caps.gl_clamp) {
ST_SET_SHADER_STATES(f->NewSamplersWithClamp, SAMPLERS);
ST_SET_SHADER_STATES(f->NewSamplersWithClamp, STATE);
}
@ -581,8 +581,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
st->alpha_border_color_is_not_w =
!!(screen->caps.texture_border_color_quirk &
PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_ALPHA_NOT_W);
st->emulate_gl_clamp =
!screen->caps.gl_clamp;
st->has_time_elapsed =
screen->caps.query_time_elapsed;
ctx->Const.GLSLHasHalfFloatPacking =

View file

@ -200,7 +200,6 @@ struct st_context
bool apply_texture_swizzle_to_border_color;
bool use_format_with_border_color;
bool alpha_border_color_is_not_w;
bool emulate_gl_clamp;
bool draw_needs_minmax_index;
bool has_hw_atomics;

View file

@ -837,7 +837,7 @@ st_create_common_variant(struct st_context *st,
finalize = true;
}
if (st->emulate_gl_clamp &&
if (!st->screen->caps.gl_clamp &&
(key->gl_clamp[0] || key->gl_clamp[1] || key->gl_clamp[2])) {
nir_lower_tex_options tex_opts = {0};
tex_opts.saturate_s = key->gl_clamp[0];
@ -1118,7 +1118,7 @@ st_create_fp_variant(struct st_context *st,
nir_lower_sample_shading(shader);
}
if (st->emulate_gl_clamp &&
if (!st->screen->caps.gl_clamp &&
(key->gl_clamp[0] || key->gl_clamp[1] || key->gl_clamp[2])) {
nir_lower_tex_options tex_opts = {0};
tex_opts.saturate_s = key->gl_clamp[0];