From b5b18e46877d16877053c68e013c8217bb6a7b83 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 29 Aug 2014 14:41:21 -0700 Subject: [PATCH] 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 --- 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 2e6296d4f23..b29b6b09bbe 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; -- 2.30.2