i965/fs: Don't offset uniform registers in half().
authorMatt Turner <mattst88@gmail.com>
Fri, 29 Aug 2014 21:41:21 +0000 (14:41 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 4 Dec 2014 00:47:45 +0000 (16:47 -0800)
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@intel.com>
src/mesa/drivers/dri/i965/brw_fs.h

index 2e6296d4f23fabf35231401d33dfa58355c2abb7..b29b6b09bbe0eb6f7253b3529c93b6c70f42b46d 100644 (file)
@@ -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;