freedreno/a3xx: Mostly fix min-vs-mag filtering decisions on non-mipmap tex.
authorEric Anholt <eric@anholt.net>
Wed, 28 Aug 2019 20:24:41 +0000 (13:24 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 26 Sep 2019 18:27:31 +0000 (11:27 -0700)
This is based on the fix I used for the same problem on V3D.  In this
case, it fixes all but the the
dEQP-GLES2.functional.texture.filtering.2d.*_npot cases of
dEQP-GLES2.functional.texture.filtering.2d.*'s failures.

Acked-by: Rob Clark <robdclark@chromium.org>
.gitlab-ci/deqp-freedreno-a307-fails.txt
src/gallium/drivers/freedreno/a3xx/fd3_texture.c

index bd1a55ff2a33f565ecdb7bdee51fd4dc564d6bb0..616c9959b412336d6f49718db7643012782de5de 100644 (file)
@@ -15,87 +15,19 @@ dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_rbo_rgba4_stencil
 dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_tex2d_rgba_stencil_index8
 dEQP-GLES2.functional.fbo.render.recreate_stencilbuffer.rebind_tex2d_rgb_stencil_index8
 dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_l8_npot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_l8_pot
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgb888_npot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgb888_pot
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgba4444_npot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgba4444_pot
 dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgba8888_npot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_clamp_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_mirror_etc1
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_mirror_l8_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_mirror_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_mirror_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_mirror_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_repeat_etc1
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_repeat_l8_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_repeat_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_repeat_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.2d.linear_nearest_repeat_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_l8_npot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_l8_pot
 dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgb888_npot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgb888_pot
 dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgba4444_npot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgba4444_pot
 dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgba8888_npot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_clamp_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_mirror_etc1
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_mirror_l8_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_mirror_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_mirror_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_mirror_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_repeat_etc1
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_repeat_l8_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_repeat_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_repeat_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.2d.nearest_linear_repeat_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_l8_npot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_l8_pot
 dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgb888_npot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgb888_pot
 dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgba4444_npot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgba4444_pot
 dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgba8888_npot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_clamp_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_mirror_l8_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_mirror_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_mirror_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_mirror_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_repeat_l8_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_repeat_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_repeat_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.cube.linear_nearest_repeat_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_etc1
 dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_l8_npot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_l8_pot
 dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgb888_npot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgb888_pot
 dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgba4444_npot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgba4444_pot
 dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgba8888_npot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_clamp_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_mirror_l8_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_mirror_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_mirror_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_mirror_rgba8888_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_repeat_l8_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_repeat_rgb888_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_repeat_rgba4444_pot
-dEQP-GLES2.functional.texture.filtering.cube.nearest_linear_repeat_rgba8888_pot
-dEQP-GLES2.functional.texture.vertex.2d.filtering.linear_nearest_clamp
-dEQP-GLES2.functional.texture.vertex.2d.filtering.linear_nearest_mirror
-dEQP-GLES2.functional.texture.vertex.2d.filtering.linear_nearest_repeat
-dEQP-GLES2.functional.texture.vertex.2d.filtering.nearest_linear_clamp
-dEQP-GLES2.functional.texture.vertex.2d.filtering.nearest_linear_mirror
-dEQP-GLES2.functional.texture.vertex.2d.filtering.nearest_linear_repeat
-dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_nearest_clamp
-dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_nearest_mirror
-dEQP-GLES2.functional.texture.vertex.cube.filtering.linear_nearest_repeat
-dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_linear_clamp
-dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_linear_mirror
-dEQP-GLES2.functional.texture.vertex.cube.filtering.nearest_linear_repeat
index 068486d8bd5d8daf74393d5a5df9be22aca80ceb..13fa93489974e379275c5d45baeabb1bc909d73b 100644 (file)
@@ -127,13 +127,20 @@ fd3_sampler_state_create(struct pipe_context *pctx,
        if (cso->compare_mode)
                so->texsamp0 |= A3XX_TEX_SAMP_0_COMPARE_FUNC(cso->compare_func); /* maps 1:1 */
 
+       so->texsamp1 = A3XX_TEX_SAMP_1_LOD_BIAS(cso->lod_bias);
+
        if (cso->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) {
-               so->texsamp1 =
-                               A3XX_TEX_SAMP_1_LOD_BIAS(cso->lod_bias) |
-                               A3XX_TEX_SAMP_1_MIN_LOD(cso->min_lod) |
-                               A3XX_TEX_SAMP_1_MAX_LOD(cso->max_lod);
+               so->texsamp1 |=
+                       A3XX_TEX_SAMP_1_MIN_LOD(cso->min_lod) |
+                       A3XX_TEX_SAMP_1_MAX_LOD(cso->max_lod);
        } else {
-               so->texsamp1 = 0x00000000;
+               /* 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 |=
+                       A3XX_TEX_SAMP_1_MIN_LOD(MIN2(cso->min_lod, 0.125)) |
+                       A3XX_TEX_SAMP_1_MAX_LOD(MIN2(cso->max_lod, 0.125));
        }
 
        return so;