Mesa (master): i965/sampler_state: Clamp min/max LOD to 14 on gen7+

Jason Ekstrand jekstrand at kemper.freedesktop.org
Mon Feb 13 02:28:14 UTC 2017


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Mon Feb  6 21:56:35 2017 -0800

i965/sampler_state: Clamp min/max LOD to 14 on gen7+

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "17.0" <mesa-stable at lists.freedesktop.org>

---

 src/mesa/drivers/dri/i965/brw_sampler_state.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c
index 412efb9..e677a75 100644
--- a/src/mesa/drivers/dri/i965/brw_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c
@@ -503,8 +503,11 @@ brw_update_sampler_state(struct brw_context *brw,
    }
 
    const int lod_bits = brw->gen >= 7 ? 8 : 6;
-   const unsigned min_lod = U_FIXED(CLAMP(sampler->MinLod, 0, 13), lod_bits);
-   const unsigned max_lod = U_FIXED(CLAMP(sampler->MaxLod, 0, 13), lod_bits);
+   const float hw_max_lod = brw->gen >= 7 ? 14 : 13;
+   const unsigned min_lod =
+      U_FIXED(CLAMP(sampler->MinLod, 0, hw_max_lod), lod_bits);
+   const unsigned max_lod =
+      U_FIXED(CLAMP(sampler->MaxLod, 0, hw_max_lod), lod_bits);
    const int lod_bias =
       S_FIXED(CLAMP(tex_unit_lod_bias + sampler->LodBias, -16, 15), lod_bits);
 




More information about the mesa-commit mailing list