Mesa (master): i965: Replace a MIN(MAX()) with CLAMP().

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 29 19:05:42 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 29 10:36:22 2009 -0700

i965: Replace a MIN(MAX()) with CLAMP().

---

 src/mesa/drivers/dri/i965/brw_wm_sampler_state.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index dff4665..416ffc9 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -228,8 +228,8 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key,
     */
    sampler->ss0.base_level = U_FIXED(0, 1);
 
-   sampler->ss1.max_lod = U_FIXED(MIN2(MAX2(key->maxlod, 0), 13), 6);
-   sampler->ss1.min_lod = U_FIXED(MIN2(MAX2(key->minlod, 0), 13), 6);
+   sampler->ss1.max_lod = U_FIXED(CLAMP(key->maxlod, 0, 13), 6);
+   sampler->ss1.min_lod = U_FIXED(CLAMP(key->minlod, 0, 13), 6);
    
    sampler->ss2.default_color_pointer = sdc_bo->offset >> 5; /* reloc */
 }




More information about the mesa-commit mailing list