Mesa (master): gallivm: fix conversion for pure integer formats

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Dec 18 00:58:01 UTC 2012


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Mon Dec 17 22:06:40 2012 +0100

gallivm: fix conversion for pure integer formats

Since the idea is to just expand or shrink the bit width but not otherwise do
conversion we also need to adjust the sign bit according to src, otherwise
the conversion code will incorrectly clamp the values. (Since this only works
for casting to ordinary floats the norm and fixed bits should always be fine.)

This fixes the remaining piglit attribs GL3 failures.

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

---

 .../auxiliary/gallivm/lp_bld_format_aos_array.c    |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c
index 1eb9446..9642b9e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c
@@ -150,6 +150,7 @@ lp_build_fetch_rgba_aos_array(struct gallivm_state *gallivm,
    if (pure_integer) {
       assert(dst_type.floating);
       tmp_type.floating = 0;
+      tmp_type.sign = src_type.sign;
    }
 
    /* Convert to correct format */




More information about the mesa-commit mailing list