i965/fs: Fix passing an immediate to half().
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 22 Apr 2015 12:01:24 +0000 (15:01 +0300)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 6 May 2015 17:29:29 +0000 (10:29 -0700)
Immediates are generally uniform, they yield the same value to both
halves of any instruction.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_ir_fs.h

index 0727ac5109e5c9bbcb9fffe02aff11ca51695d12..acbf617cfa61f784dcc0e5df7f7da4aa610ec8dc 100644 (file)
@@ -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);