Mesa (master): etnaviv: fix linear_nearest / nearest_linear filters on GC7000Lite
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 18 17:11:34 UTC 2019
Module: Mesa
Branch: master
Commit: ad48411d721e0b433a0f1876dc83d7979bd993b2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad48411d721e0b433a0f1876dc83d7979bd993b2
Author: Jonathan Marek <jonathan at marek.ca>
Date: Thu Jun 20 20:01:28 2019 -0400
etnaviv: fix linear_nearest / nearest_linear filters on GC7000Lite
MIN filter is only used when LOD MAX is at least 4 (I guess the 2 LSB don't
actually exist).
Signed-off-by: Jonathan Marek <jonathan at marek.ca>
Reviewed-by: Lucas Stach <l.stach at pengutronix.de>
---
src/gallium/drivers/etnaviv/etnaviv_texture_desc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_desc.c b/src/gallium/drivers/etnaviv/etnaviv_texture_desc.c
index aef856b1798..f4f059a3c5d 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture_desc.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture_desc.c
@@ -62,13 +62,15 @@ etna_create_sampler_state_desc(struct pipe_context *pipe,
cs->SAMP_CTRL1 = VIVS_NTE_DESCRIPTOR_SAMP_CTRL1_UNK1;
uint32_t min_lod_fp8 = MIN2(etna_float_to_fixp88(ss->min_lod), 0xfff);
uint32_t max_lod_fp8 = MIN2(etna_float_to_fixp88(ss->max_lod), 0xfff);
+ uint32_t max_lod_min = ss->min_img_filter != ss->mag_img_filter ? 4 : 0;
+
if (ss->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) {
cs->SAMP_LOD_MINMAX =
- VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MAX(max_lod_fp8) |
+ VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MAX(MAX2(max_lod_fp8, max_lod_min)) |
VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MIN(min_lod_fp8);
} else {
cs->SAMP_LOD_MINMAX =
- VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MAX(min_lod_fp8) |
+ VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MAX(MAX2(max_lod_fp8, max_lod_min)) |
VIVS_NTE_DESCRIPTOR_SAMP_LOD_MINMAX_MIN(min_lod_fp8);
}
cs->SAMP_LOD_BIAS =
More information about the mesa-commit
mailing list