Mesa (master): i965/fs: Don't offset uniform registers in half().

Matt Turner mattst88 at kemper.freedesktop.org
Thu Dec 4 00:47:49 UTC 2014


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Aug 29 14:41:21 2014 -0700

i965/fs: Don't offset uniform registers in half().

Half gives you the second half of a SIMD16 register, but if the register
is a uniform it would incorrectly give you the next register.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/drivers/dri/i965/brw_fs.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 2e6296d..b29b6b0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -202,6 +202,10 @@ static inline fs_reg
 half(fs_reg reg, unsigned idx)
 {
    assert(idx < 2);
+
+   if (reg.file == UNIFORM)
+      return reg;
+
    assert(idx == 0 || (reg.file != HW_REG && reg.file != IMM));
    assert(reg.width == 16);
    reg.width = 8;




More information about the mesa-commit mailing list