freedreno/a5xx: Fix min-vs-mag filtering decisions on non-mipmap tex.
authorEric Anholt <eric@anholt.net>
Wed, 11 Mar 2020 23:39:04 +0000 (16:39 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 17 Mar 2020 18:11:51 +0000 (11:11 -0700)
This a port of 3338d6e5f8b5 ("freedreno/a3xx: Mostly fix min-vs-mag
filtering decisions on non-mipmap tex.")

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4177>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4177>

.gitlab-ci/deqp-freedreno-a530-fails.txt
src/gallium/drivers/freedreno/a5xx/fd5_texture.c

index a7d767e781786628c6ee110d873c26e18f5a76a8..d3cf94cbebd40eea53911a75fa8210d232ef9cf3 100644 (file)
@@ -4,94 +4,10 @@ dEQP-GLES2.functional.clipping.point.wide_point_clip
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_center
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_corner
 dEQP-GLES2.functional.clipping.triangle_vertex.clip_three.clip_neg_x_neg_z_and_pos_x_pos_z_and_neg_x_neg_y_pos_z
-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.specification.basic_copytexsubimage2d.2d_alpha
 dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_luminance
 dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgb
 dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgba
-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
 dEQP-GLES3.functional.clipping.line.wide_line_clip_viewport_center
 dEQP-GLES3.functional.clipping.line.wide_line_clip_viewport_corner
 dEQP-GLES3.functional.clipping.point.wide_point_clip
@@ -585,58 +501,6 @@ dEQP-GLES3.functional.shaders.texture_functions.textureprojlod.sampler3d_float_f
 dEQP-GLES3.functional.shaders.texture_functions.textureprojlod.sampler3d_float_vertex
 dEQP-GLES3.functional.shaders.texture_functions.textureproj.sampler3d_bias_float_fragment
 dEQP-GLES3.functional.shaders.texture_functions.texture.sampler3d_bias_float_fragment
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.linear_nearest_repeat_repeat
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.2d_array.combinations.nearest_linear_repeat_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_clamp_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.linear_nearest_repeat_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_clamp_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.2d.combinations.nearest_linear_repeat_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_clamp_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.linear_nearest_repeat_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_clamp_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_clamp_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_clamp_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_mirror_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_mirror_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_mirror_repeat
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_repeat_clamp
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_repeat_mirror
-dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_linear_repeat_repeat
 dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_alpha
 dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_luminance
 dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_rgba
@@ -729,18 +593,6 @@ dEQP-GLES3.functional.texture.specification.texstorage3d.format.srgb8_alpha8_3d
 dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_32x64x16_4_levels
 dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_57x63x11_2_levels
 dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_57x63x11_6_levels
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.linear_nearest_clamp
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.linear_nearest_mirror
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.linear_nearest_repeat
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.nearest_linear_clamp
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.nearest_linear_mirror
-dEQP-GLES3.functional.texture.vertex.2d_array.filtering.nearest_linear_repeat
-dEQP-GLES3.functional.texture.vertex.2d.filtering.linear_nearest_clamp
-dEQP-GLES3.functional.texture.vertex.2d.filtering.linear_nearest_mirror
-dEQP-GLES3.functional.texture.vertex.2d.filtering.linear_nearest_repeat
-dEQP-GLES3.functional.texture.vertex.2d.filtering.nearest_linear_clamp
-dEQP-GLES3.functional.texture.vertex.2d.filtering.nearest_linear_mirror
-dEQP-GLES3.functional.texture.vertex.2d.filtering.nearest_linear_repeat
 dEQP-GLES3.functional.texture.vertex.3d.wrap.clamp_clamp_clamp
 dEQP-GLES3.functional.texture.vertex.3d.wrap.clamp_clamp_mirror
 dEQP-GLES3.functional.texture.vertex.3d.wrap.clamp_clamp_repeat
@@ -768,12 +620,6 @@ dEQP-GLES3.functional.texture.vertex.3d.wrap.repeat_mirror_repeat
 dEQP-GLES3.functional.texture.vertex.3d.wrap.repeat_repeat_clamp
 dEQP-GLES3.functional.texture.vertex.3d.wrap.repeat_repeat_mirror
 dEQP-GLES3.functional.texture.vertex.3d.wrap.repeat_repeat_repeat
-dEQP-GLES3.functional.texture.vertex.cube.filtering.linear_nearest_clamp
-dEQP-GLES3.functional.texture.vertex.cube.filtering.linear_nearest_mirror
-dEQP-GLES3.functional.texture.vertex.cube.filtering.linear_nearest_repeat
-dEQP-GLES3.functional.texture.vertex.cube.filtering.nearest_linear_clamp
-dEQP-GLES3.functional.texture.vertex.cube.filtering.nearest_linear_mirror
-dEQP-GLES3.functional.texture.vertex.cube.filtering.nearest_linear_repeat
 dEQP-GLES3.functional.transform_feedback.array_element.interleaved.lines.highp_float
 dEQP-GLES3.functional.transform_feedback.array_element.interleaved.lines.highp_int
 dEQP-GLES3.functional.transform_feedback.array_element.interleaved.lines.highp_ivec2
index 5da1a3022e9993c5d94ca6bc573671b02a286418..5ec8e546eca2c1374d09577bd69ec3d4319f4f0e 100644 (file)
@@ -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)