i965/fs: handle uniforms in byte_offset()
authorConnor Abbott <connor.w.abbott@intel.com>
Tue, 28 Jul 2015 23:53:02 +0000 (16:53 -0700)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:06 +0000 (11:25 +0200)
v2: Do it only for uniforms (Iago)

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_ir_fs.h

index 1649da3e2bfc9762b5ae995672791cf40e63d46b..86acdb236a422795c6f443e1d5ccc0598d1cb44f 100644 (file)
@@ -90,10 +90,14 @@ byte_offset(fs_reg reg, unsigned delta)
    case MRF:
       reg.nr += delta / 32;
       break;
+   case UNIFORM:
+      reg.reg_offset += delta / 4;
+      reg.subreg_offset += delta % 4;
+      return reg;
    case ARF:
    case FIXED_GRF:
    case IMM:
-   case UNIFORM:
+   default:
       assert(delta == 0);
    }
    reg.subreg_offset += delta % 32;