i965/vs: Simplify emit_scratch_write() prototype.
authorEric Anholt <eric@anholt.net>
Tue, 16 Oct 2012 00:42:43 +0000 (17:42 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 17 Oct 2012 19:23:59 +0000 (12:23 -0700)
Both callers used (effectively) inst->dst as the argument, so just reference
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index de0df552553f2b68f6c7821fc5890801c3cbc58d..d6d6c8a904bd7149908cf86b27cf57e52d195cff 100644 (file)
@@ -428,7 +428,6 @@ public:
                          int base_offset);
    void emit_scratch_write(vec4_instruction *inst,
                           src_reg temp,
-                          dst_reg orig_dst,
                           int base_offset);
    void emit_pull_constant_load(vec4_instruction *inst,
                                dst_reg dst,
index bad27287e5a76a7af71b43520ac5d711d99abb9e..a2381bc30f2de7b8c4a06695a416c5778db8e45b 100644 (file)
@@ -355,7 +355,7 @@ vec4_visitor::spill_reg(int spill_reg_nr)
           */
          src_reg temp = src_reg(inst->dst);
          temp.swizzle = BRW_SWIZZLE_XYZW;
-         emit_scratch_write(inst, temp, spill_reg, spill_offset);
+         emit_scratch_write(inst, temp, spill_offset);
       }
    }
 
index 59428a192102f3d003333bbada06513baed46ac7..60295adbd8797b9397d333f3098733873453221c 100644 (file)
@@ -2465,14 +2465,13 @@ vec4_visitor::emit_scratch_read(vec4_instruction *inst,
  */
 void
 vec4_visitor::emit_scratch_write(vec4_instruction *inst,
-                                src_reg temp, dst_reg orig_dst,
-                                int base_offset)
+                                src_reg temp, int base_offset)
 {
-   int reg_offset = base_offset + orig_dst.reg_offset;
-   src_reg index = get_scratch_offset(inst, orig_dst.reladdr, reg_offset);
+   int reg_offset = base_offset + inst->dst.reg_offset;
+   src_reg index = get_scratch_offset(inst, inst->dst.reladdr, reg_offset);
 
    dst_reg dst = dst_reg(brw_writemask(brw_vec8_grf(0, 0),
-                                      orig_dst.writemask));
+                                      inst->dst.writemask));
    vec4_instruction *write = SCRATCH_WRITE(dst, temp, index);
    write->predicate = inst->predicate;
    write->ir = inst->ir;
@@ -2534,7 +2533,7 @@ vec4_visitor::move_grf_array_access_to_scratch()
       if (inst->dst.file == GRF && scratch_loc[inst->dst.reg] != -1) {
         src_reg temp = src_reg(this, glsl_type::vec4_type);
 
-        emit_scratch_write(inst, temp, inst->dst, scratch_loc[inst->dst.reg]);
+        emit_scratch_write(inst, temp, scratch_loc[inst->dst.reg]);
 
         inst->dst.file = temp.file;
         inst->dst.reg = temp.reg;