freedreno/a6xx: Fix non-mipmap filtering selection.
authorEric Anholt <eric@anholt.net>
Wed, 28 Aug 2019 17:13:29 +0000 (10:13 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 28 Aug 2019 20:14:41 +0000 (13:14 -0700)
We were clamping the LOD to force non-mipmap filtering, but that means
that the HW doesn't get to select between the min and mag filters.
Setting MIPFILTER_LINEAR_FAR appears to force non-mipmap filtering.

Fixes all failures in dEQP-GLES2.functional.texture.filtering.2d.*

Reviewed-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_texture.c

index 2cb69e01a2ee384cfadaeb30c69b330b29719818..7508b6a44fb8b93ef396614a1e79b11e4427523b 100644 (file)
@@ -130,15 +130,15 @@ fd6_sampler_state_create(struct pipe_context *pctx,
                A6XX_TEX_SAMP_0_WRAP_R(tex_clamp(cso->wrap_r, clamp_to_edge, &so->needs_border));
 
        so->texsamp1 =
+               COND(cso->min_mip_filter == PIPE_TEX_MIPFILTER_NONE,
+                               A6XX_TEX_SAMP_1_MIPFILTER_LINEAR_FAR) |
                COND(!cso->seamless_cube_map, A6XX_TEX_SAMP_1_CUBEMAPSEAMLESSFILTOFF) |
                COND(!cso->normalized_coords, A6XX_TEX_SAMP_1_UNNORM_COORDS);
 
-       if (cso->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) {
-               so->texsamp0 |= A6XX_TEX_SAMP_0_LOD_BIAS(cso->lod_bias);
-               so->texsamp1 |=
-                       A6XX_TEX_SAMP_1_MIN_LOD(cso->min_lod) |
-                       A6XX_TEX_SAMP_1_MAX_LOD(cso->max_lod);
-       }
+       so->texsamp0 |= A6XX_TEX_SAMP_0_LOD_BIAS(cso->lod_bias);
+       so->texsamp1 |=
+               A6XX_TEX_SAMP_1_MIN_LOD(cso->min_lod) |
+               A6XX_TEX_SAMP_1_MAX_LOD(cso->max_lod);
 
        if (cso->compare_mode)
                so->texsamp1 |= A6XX_TEX_SAMP_1_COMPARE_FUNC(cso->compare_func); /* maps 1:1 */