mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-04 02:18:16 +02:00
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:
parent
f5b5929a1a
commit
e4e5e4490b
7 changed files with 6 additions and 9 deletions
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue