i965/fs: Pass the compression mode to brw_reg_from_fs_reg().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 19 May 2016 02:02:45 +0000 (19:02 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:22:10 +0000 (23:22 -0700)
Curro is planning to eliminate p->compressed, so let's avoid using it
here and just pass in the value directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[ Francisco Jerez: Pass boolean flag instead of brw_compression enum. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index 0c0cf0ba3676af9f97cd7b26e4e9f303144c8b41..67c7aa5aa2f8f84ba014685f5431d98b66decb44 100644 (file)
@@ -54,8 +54,7 @@ brw_file_from_reg(fs_reg *reg)
 }
 
 static struct brw_reg
-brw_reg_from_fs_reg(const struct brw_codegen *p,
-                    fs_inst *inst, fs_reg *reg, unsigned gen)
+brw_reg_from_fs_reg(fs_inst *inst, fs_reg *reg, unsigned gen, bool compressed)
 {
    struct brw_reg brw_reg;
 
@@ -66,7 +65,7 @@ brw_reg_from_fs_reg(const struct brw_codegen *p,
    case VGRF:
       if (reg->stride == 0) {
          brw_reg = brw_vec1_reg(brw_file_from_reg(reg), reg->nr, 0);
-      } else if (!p->compressed &&
+      } else if (!compressed &&
                  inst->exec_size * reg->stride * type_sz(reg->type) <= 32) {
          brw_reg = brw_vecn_reg(inst->exec_size, brw_file_from_reg(reg),
                                 reg->nr, 0);
@@ -1593,7 +1592,8 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
       brw_set_default_group(p, inst->force_sechalf ? 8 : 0);
 
       for (unsigned int i = 0; i < inst->sources; i++) {
-        src[i] = brw_reg_from_fs_reg(p, inst, &inst->src[i], devinfo->gen);
+         src[i] = brw_reg_from_fs_reg(inst, &inst->src[i], devinfo->gen,
+                                      p->compressed);
 
         /* The accumulator result appears to get used for the
          * conditional modifier generation.  When negating a UD
@@ -1605,7 +1605,8 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
                inst->src[i].type != BRW_REGISTER_TYPE_UD ||
                !inst->src[i].negate);
       }
-      dst = brw_reg_from_fs_reg(p, inst, &inst->dst, devinfo->gen);
+      dst = brw_reg_from_fs_reg(inst, &inst->dst, devinfo->gen,
+                                p->compressed);
 
       brw_set_default_access_mode(p, BRW_ALIGN_1);
       brw_set_default_predicate_control(p, inst->predicate);