Mesa (master): gallivm: (trivial) fix int/uint border color clamping

Roland Scheidegger sroland at kemper.freedesktop.org
Thu Aug 22 17:06:06 UTC 2013


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Thu Aug 22 03:59:41 2013 +0200

gallivm: (trivial) fix int/uint border color clamping

Just a copy & paste error.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=68409.
Note that the test passing before probably simply means it doesn't verify
clamping of the border color itself as required by the OpenGL spec.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 38a0eae..deb6ef4 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1423,7 +1423,7 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld,
                 * Border color was stored as int, hence need min/max clamp
                 * only if chan has less than 32 bits..
                 */
-               unsigned chan_size = format_desc->channel[chan].size < 32;
+               unsigned chan_size = format_desc->channel[chan].size;
                if (chan_size < 32) {
                   min_clamp = lp_build_const_int_vec(gallivm, vec4_type,
                                                      0 - (1 << (chan_size - 1)));
@@ -1451,7 +1451,7 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld,
                 * Border color was stored as uint, hence never need min
                 * clamp, and only need max clamp if chan has less than 32 bits.
                 */
-               unsigned chan_size = format_desc->channel[chan].size < 32;
+               unsigned chan_size = format_desc->channel[chan].size;
                if (chan_size < 32) {
                   max_clamp = lp_build_const_int_vec(gallivm, vec4_type,
                                                      (1 << chan_size) - 1);




More information about the mesa-commit mailing list