mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
etnaviv: fix disabling of INT filter for real
Missing a copy of the pipe_sampler_state into the etna_sampler_state object
lead to the texture_use_int_filter() to always see a max_anisotropy of 0, so
the INT filter wasn't disabled when necessary. Also state emission should
never change the state objects, as this might also lead to stale information
being kept around the in the state object.
Fixes: 89a41dae77 (etnaviv: do not use int filter when
anisotropic filtering is used)
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7638>
This commit is contained in:
parent
ad6365f656
commit
b479a1f03c
2 changed files with 10 additions and 4 deletions
|
|
@ -83,6 +83,8 @@ etna_create_sampler_state_desc(struct pipe_context *pipe,
|
|||
if (!cs)
|
||||
return NULL;
|
||||
|
||||
cs->base = *ss;
|
||||
|
||||
cs->SAMP_CTRL0 =
|
||||
VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_UWRAP(translate_texture_wrapmode(ss->wrap_s)) |
|
||||
VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_VWRAP(translate_texture_wrapmode(ss->wrap_t)) |
|
||||
|
|
@ -290,16 +292,17 @@ etna_emit_texture_desc(struct etna_context *ctx)
|
|||
if ((1 << x) & active_samplers) {
|
||||
struct etna_sampler_state_desc *ss = etna_sampler_state_desc(ctx->sampler[x]);
|
||||
struct etna_sampler_view_desc *sv = etna_sampler_view_desc(ctx->sampler_view[x]);
|
||||
uint32_t SAMP_CTRL0 = ss->SAMP_CTRL0 | sv->SAMP_CTRL0;
|
||||
|
||||
if (texture_use_int_filter(&sv->base, &ss->base, true))
|
||||
sv->SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
|
||||
SAMP_CTRL0 |= VIVS_NTE_DESCRIPTOR_SAMP_CTRL0_INT_FILTER;
|
||||
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_TX_CTRL(x),
|
||||
COND(sv->ts.enable, VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_ENABLE) |
|
||||
VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_MODE(sv->ts.mode) |
|
||||
VIVS_NTE_DESCRIPTOR_TX_CTRL_TS_INDEX(x)|
|
||||
COND(sv->ts.comp, VIVS_NTE_DESCRIPTOR_TX_CTRL_COMPRESSION));
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL0(x), ss->SAMP_CTRL0 | sv->SAMP_CTRL0);
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL0(x), SAMP_CTRL0);
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_CTRL1(x), ss->SAMP_CTRL1 | sv->SAMP_CTRL1);
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX(x), ss->SAMP_LOD_MINMAX);
|
||||
etna_set_state(stream, VIVS_NTE_DESCRIPTOR_SAMP_LOD_BIAS(x), ss->SAMP_LOD_BIAS);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ etna_create_sampler_state_state(struct pipe_context *pipe,
|
|||
if (!cs)
|
||||
return NULL;
|
||||
|
||||
cs->base = *ss;
|
||||
|
||||
cs->TE_SAMPLER_CONFIG0 =
|
||||
VIVS_TE_SAMPLER_CONFIG0_UWRAP(translate_texture_wrapmode(ss->wrap_s)) |
|
||||
VIVS_TE_SAMPLER_CONFIG0_VWRAP(translate_texture_wrapmode(ss->wrap_t)) |
|
||||
|
|
@ -348,11 +350,12 @@ etna_emit_texture_state(struct etna_context *ctx)
|
|||
if ((1 << x) & active_samplers) {
|
||||
ss = etna_sampler_state(ctx->sampler[x]);
|
||||
sv = etna_sampler_view(ctx->sampler_view[x]);
|
||||
uint32_t TE_SAMPLER_LOG_SIZE = sv->TE_SAMPLER_LOG_SIZE;
|
||||
|
||||
if (texture_use_int_filter(&sv->base, &ss->base, false))
|
||||
sv->TE_SAMPLER_LOG_SIZE |= VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER;
|
||||
TE_SAMPLER_LOG_SIZE |= VIVS_TE_SAMPLER_LOG_SIZE_INT_FILTER;
|
||||
|
||||
/*02080*/ EMIT_STATE(TE_SAMPLER_LOG_SIZE(x), sv->TE_SAMPLER_LOG_SIZE);
|
||||
/*02080*/ EMIT_STATE(TE_SAMPLER_LOG_SIZE(x), TE_SAMPLER_LOG_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue