From: Eric Anholt Date: Wed, 28 Aug 2019 20:24:41 +0000 (-0700) Subject: freedreno/a3xx: Mostly fix min-vs-mag filtering decisions on non-mipmap tex. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3338d6e5f8b5381da2d736623853eafa1e7bfb8e;p=mesa.git freedreno/a3xx: Mostly fix min-vs-mag filtering decisions on non-mipmap tex. 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 --- diff --git a/.gitlab-ci/deqp-freedreno-a307-fails.txt b/.gitlab-ci/deqp-freedreno-a307-fails.txt index bd1a55ff2a3..616c9959b41 100644 --- a/.gitlab-ci/deqp-freedreno-a307-fails.txt +++ b/.gitlab-ci/deqp-freedreno-a307-fails.txt @@ -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 diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_texture.c b/src/gallium/drivers/freedreno/a3xx/fd3_texture.c index 068486d8bd5..13fa9348997 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_texture.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_texture.c @@ -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;