[Mesa-dev] [PATCH 2/2] i965: Pass the compression mode to brw_reg_from_fs_reg().

Kenneth Graunke kenneth at whitecape.org
Tue May 17 23:53:59 UTC 2016


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 at whitecape.org>
Cc: currojerez at riseup.net
---
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 824d0d0..93a2cf0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -54,8 +54,8 @@ 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,
+                    enum brw_compression compression)
 {
    struct brw_reg brw_reg;
 
@@ -66,7 +66,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 (compression != BRW_COMPRESSION_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);
@@ -1772,7 +1772,8 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
       brw_set_default_compression_control(p, compression);
 
       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,
+                                      compression);
 
 	 /* The accumulator result appears to get used for the
 	  * conditional modifier generation.  When negating a UD
@@ -1784,7 +1785,7 @@ 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, compression);
 
       brw_set_default_predicate_control(p, inst->predicate);
       brw_set_default_predicate_inverse(p, inst->predicate_inverse);
-- 
2.8.2



More information about the mesa-dev mailing list