Mesa (master): softpipe: Use mag texture filter also for clamped lod == 0

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 5 07:19:31 UTC 2019


Module: Mesa
Branch: master
Commit: 0dff1533f25951adda3c36be6d9efa944741befb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0dff1533f25951adda3c36be6d9efa944741befb

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Thu Apr  4 11:34:26 2019 +0200

softpipe: Use mag texture filter also for clamped lod == 0

Follow the spec when selecting the magnification filter (OpenGL 4.5,
section 8.14):

  If λ(x, y) is less than or equal to the constant c (see section 8.15)
  the texture is said to be magnified;

While we're here also silence a potential warning about implicit float
to double conversion.

v2: Update commit message to contain a reference to the spec as pointed
    out by Eric.

Fixes a number of dEQP GLES2 and GLES3 test out of:
 dEQP-GLES2.functional.texture.filtering.*
 dEQP-GLES2.functional.texture.vertex.2d.filtering.*
 dEQP-GLES3.functional.texture.vertex.*.filtering.*
 dEQP-GLES3.functional.texture.filtering.*
 dEQP-GLES3.functional.texture.shadow.2d.*

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/gallium/drivers/softpipe/sp_tex_sample.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 26d38296073..1b40e3545bd 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1956,7 +1956,7 @@ mip_filter_linear(const struct sp_sampler_view *sp_sview,
       args.p = p[j];
       args.face_id = filt_args->faces[j];
 
-      if (lod[j] < 0.0) {
+      if (lod[j] <= 0.0) {
          args.level = psview->u.tex.first_level;
          mag_filter(sp_sview, sp_samp, &args, &rgba[0][j]);
       }
@@ -2040,7 +2040,7 @@ mip_filter_nearest(const struct sp_sampler_view *sp_sview,
       args.p = p[j];
       args.face_id = filt_args->faces[j];
 
-      if (lod[j] < 0.0) {
+      if (lod[j] <= 0.0) {
          args.level = psview->u.tex.first_level;
          mag_filter(sp_sview, sp_samp, &args, &rgba[0][j]);
       } else {
@@ -2100,7 +2100,7 @@ mip_filter_none(const struct sp_sampler_view *sp_sview,
       args.t = t[j];
       args.p = p[j];
       args.face_id = filt_args->faces[j];
-      if (lod[j] < 0.0) {
+      if (lod[j] <= 0.0f) {
          mag_filter(sp_sview, sp_samp, &args, &rgba[0][j]);
       }
       else {




More information about the mesa-commit mailing list