diff options
author | Eric Anholt <[email protected]> | 2020-03-11 16:39:04 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2020-03-17 11:11:51 -0700 |
commit | 5960dadd1f2494da6ea8fa04a46271beb66dea49 (patch) | |
tree | 0f00b74111c92a6ea30534136a0ce33567524dbe /src/gallium | |
parent | 4bc15e78fa51e6c0df491a9fef4f99b2dfad77a9 (diff) |
freedreno/a5xx: Fix min-vs-mag filtering decisions on non-mipmap tex.
This a port of 3338d6e5f8b5 ("freedreno/a3xx: Mostly fix min-vs-mag
filtering decisions on non-mipmap tex.")
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4177>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4177>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/a5xx/fd5_texture.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c index 5da1a3022e9..5ec8e546eca 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_texture.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_texture.c @@ -126,11 +126,20 @@ fd5_sampler_state_create(struct pipe_context *pctx, COND(!cso->seamless_cube_map, A5XX_TEX_SAMP_1_CUBEMAPSEAMLESSFILTOFF) | COND(!cso->normalized_coords, A5XX_TEX_SAMP_1_UNNORM_COORDS); + so->texsamp0 |= A5XX_TEX_SAMP_0_LOD_BIAS(cso->lod_bias); + if (cso->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) { - so->texsamp0 |= A5XX_TEX_SAMP_0_LOD_BIAS(cso->lod_bias); so->texsamp1 |= A5XX_TEX_SAMP_1_MIN_LOD(cso->min_lod) | A5XX_TEX_SAMP_1_MAX_LOD(cso->max_lod); + } else { + /* If we're not doing mipmap filtering, we still need a slightly > 0 + * LOD clamp so the HW can decide between min and mag filtering of + * level 0. + */ + so->texsamp1 |= + A5XX_TEX_SAMP_1_MIN_LOD(MIN2(cso->min_lod, 0.125)) | + A5XX_TEX_SAMP_1_MAX_LOD(MIN2(cso->max_lod, 0.125)); } if (cso->compare_mode) |