Mesa (master): broadcom/vc5: Clamp min lod to the last level.

Eric Anholt anholt at kemper.freedesktop.org
Mon Nov 20 22:00:39 UTC 2017


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 20 10:07:24 2017 -0800

broadcom/vc5: Clamp min lod to the last level.

Otherwise, the simulator would complain in tex-miplevel-selection that the
min/max clamp was out of order.  The actual HW seems to have clamped to
the max anyway.

---

 src/gallium/drivers/vc5/vc5_emit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index 72b5d85880..d5356673e7 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -141,8 +141,9 @@ emit_one_texture(struct vc5_context *vc5, struct vc5_texture_stateobj *stage_tex
                  * TEXTURE_SHADER_STATE that ignores psview->min/max_lod to
                  * support txf properly.
                  */
-                .min_level_of_detail = (psview->u.tex.first_level +
-                                        MAX2(psampler->min_lod, 0)),
+                .min_level_of_detail = MIN2(psview->u.tex.first_level +
+                                            MAX2(psampler->min_lod, 0),
+                                            psview->u.tex.last_level),
                 .max_level_of_detail = MIN2(psview->u.tex.first_level +
                                             psampler->max_lod,
                                             psview->u.tex.last_level),




More information about the mesa-commit mailing list