summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-06-19 11:42:13 -0400
committerJonathan Marek <[email protected]>2019-07-14 10:34:17 -0400
commit63efb6ec6c7b2053f0d6be4714d46ff04f893de1 (patch)
treee46d09bf1257d176ca00e6d7ede3e9a0ee1a2c12 /src/gallium/drivers/etnaviv
parent1f58b6ffefaa01f4b36241c2571d9e52b3775bf1 (diff)
etnaviv: fix nearest filtering
ROUND_UV rounding breaks nearest filtering. Enable it only when nearest filtering isn't used. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_texture_state.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
index 705326a160a..ffb3ffdcc84 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
@@ -53,8 +53,13 @@ etna_create_sampler_state_state(struct pipe_context *pipe,
VIVS_TE_SAMPLER_CONFIG0_VWRAP(translate_texture_wrapmode(ss->wrap_t)) |
VIVS_TE_SAMPLER_CONFIG0_MIN(translate_texture_filter(ss->min_img_filter)) |
VIVS_TE_SAMPLER_CONFIG0_MIP(translate_texture_mipfilter(ss->min_mip_filter)) |
- VIVS_TE_SAMPLER_CONFIG0_MAG(translate_texture_filter(ss->mag_img_filter)) |
- COND(ss->normalized_coords, VIVS_TE_SAMPLER_CONFIG0_ROUND_UV);
+ VIVS_TE_SAMPLER_CONFIG0_MAG(translate_texture_filter(ss->mag_img_filter));
+
+ /* ROUND_UV improves precision - but not compatible with NEAREST filter */
+ if (ss->min_img_filter != PIPE_TEX_FILTER_NEAREST &&
+ ss->mag_img_filter != PIPE_TEX_FILTER_NEAREST) {
+ cs->TE_SAMPLER_CONFIG0 |= VIVS_TE_SAMPLER_CONFIG0_ROUND_UV;
+ }
cs->TE_SAMPLER_CONFIG1 =
COND(ss->seamless_cube_map, VIVS_TE_SAMPLER_CONFIG1_SEAMLESS_CUBE_MAP);