mesa/st: remove lower_rect_tex from st_context

lower_rect_tex is the negation of screen->caps.texrect.
Replace all call sites with !screen->caps.texrect 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-26 00:38:41 -04:00 committed by Marge Bot
parent f5b5929a1a
commit e4e5e4490b
7 changed files with 6 additions and 9 deletions

View file

@ -77,7 +77,7 @@ st_convert_sampler(const struct st_context *st,
sampler->mag_img_filter = PIPE_TEX_FILTER_NEAREST;
}
if (texobj->Target == GL_TEXTURE_RECTANGLE_ARB && !st->lower_rect_tex)
if (texobj->Target == GL_TEXTURE_RECTANGLE_ARB && st->screen->caps.texrect)
sampler->unnormalized_coords = 1;
/*

View file

@ -594,7 +594,7 @@ init_bitmap_state(struct st_context *st)
st->bitmap.sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
st->bitmap.sampler.unnormalized_coords = !(st->internal_target == PIPE_TEXTURE_2D ||
(st->internal_target == PIPE_TEXTURE_RECT &&
st->lower_rect_tex));
!st->screen->caps.texrect));
/* init baseline rasterizer state once */
memset(&st->bitmap.rasterizer, 0, sizeof(st->bitmap.rasterizer));

View file

@ -730,7 +730,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
GLfloat x0, y0, x1, y1;
ASSERTED GLsizei maxSize;
bool normalized = sv[0]->texture->target == PIPE_TEXTURE_2D ||
(sv[0]->texture->target == PIPE_TEXTURE_RECT && st->lower_rect_tex);
(sv[0]->texture->target == PIPE_TEXTURE_RECT && !st->screen->caps.texrect);
unsigned invalidate_flags;
assert(sv[0]->texture->target == st->internal_target);

View file

@ -593,8 +593,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
break;
default: break;
}
st->lower_rect_tex =
!screen->caps.texrect;
st->allow_st_finalize_nir_twice =
screen->caps.call_finalize_nir_in_linker;

View file

@ -162,7 +162,6 @@ struct st_context
bool can_bind_const_buffer_as_vertex;
bool lower_point_size;
bool add_point_size;
bool lower_rect_tex;
/* There are consequences for drivers wanting to call st_finalize_nir
* twice, once before shader caching and once after lowering for shader

View file

@ -730,9 +730,9 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
const bool lower_tg4_offsets =
!is_draw_shader && !st->screen->caps.texture_gather_offsets;
if (!is_draw_shader && (st->lower_rect_tex || lower_tg4_offsets)) {
if (!is_draw_shader && (!st->screen->caps.texrect || lower_tg4_offsets)) {
struct nir_lower_tex_options opts = {0};
opts.lower_rect = !!st->lower_rect_tex;
opts.lower_rect = !st->screen->caps.texrect;
opts.lower_tg4_offsets = lower_tg4_offsets;
NIR_PASS(_, nir, nir_lower_tex, &opts);

View file

@ -47,7 +47,7 @@ st_nir_finish_builtin_nir(struct st_context *st, nir_shader *nir)
};
NIR_PASS(_, nir, nir_lower_compute_system_values, &cs_options);
if (st->lower_rect_tex) {
if (!st->screen->caps.texrect) {
const struct nir_lower_tex_options opts = { .lower_rect = true, };
NIR_PASS(_, nir, nir_lower_tex, &opts);
}