[Mesa-dev] [PATCH 01/21] i965/fs: Fix passing an immediate to half().

Francisco Jerez currojerez at riseup.net
Tue Apr 28 10:08:17 PDT 2015


Immediates are generally uniform, they yield the same value to both
halves of any instruction.
---
 src/mesa/drivers/dri/i965/brw_ir_fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index b4ff3dc..68a2818 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -183,10 +183,10 @@ half(fs_reg reg, unsigned idx)
 {
    assert(idx < 2);
 
-   if (reg.file == UNIFORM)
+   if (reg.file == UNIFORM || reg.file == IMM)
       return reg;
 
-   assert(idx == 0 || (reg.file != HW_REG && reg.file != IMM));
+   assert(idx == 0 || reg.file != HW_REG);
    assert(reg.width == 16);
    reg.width = 8;
    return horiz_offset(reg, 8 * idx);
-- 
2.3.5



More information about the mesa-dev mailing list