Mesa (master): broadcom/vc5: Fix non-mipfiltered sampling.

Eric Anholt anholt at kemper.freedesktop.org
Mon Feb 5 13:56:45 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Feb  5 11:06:59 2018 +0000

broadcom/vc5: Fix non-mipfiltered sampling.

We need to clamp the LOD to 0 if mip filtering is disabled.  This is part
of fixing KHR-GLES3.shaders.struct.uniform.sampler_array_fragment.

---

 src/gallium/drivers/vc5/vc5_state.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c
index 9d4d0893f8..65dd9a2c42 100644
--- a/src/gallium/drivers/vc5/vc5_state.c
+++ b/src/gallium/drivers/vc5/vc5_state.c
@@ -538,12 +538,17 @@ vc5_create_sampler_state(struct pipe_context *pctx,
                 sampler.mag_filter_nearest =
                         cso->mag_img_filter == PIPE_TEX_FILTER_NEAREST;
                 sampler.mip_filter_nearest =
-                        cso->min_mip_filter == PIPE_TEX_MIPFILTER_NEAREST;
+                        cso->min_mip_filter != PIPE_TEX_MIPFILTER_LINEAR;
 
                 sampler.min_level_of_detail = MIN2(MAX2(0, cso->min_lod),
                                                    15);
                 sampler.max_level_of_detail = MIN2(cso->max_lod, 15);
 
+                if (cso->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
+                        sampler.min_level_of_detail = 0;
+                        sampler.max_level_of_detail = 0;
+                }
+
                 if (cso->max_anisotropy) {
                         sampler.anisotropy_enable = true;
 




More information about the mesa-commit mailing list