From: Eric Anholt Date: Tue, 16 Oct 2012 00:42:43 +0000 (-0700) Subject: i965/vs: Simplify emit_scratch_write() prototype. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9499f7984e7393f5acf214f126481695a774e8e7;p=mesa.git i965/vs: Simplify emit_scratch_write() prototype. Both callers used (effectively) inst->dst as the argument, so just reference it. Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index de0df552553..d6d6c8a904b 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -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, diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp index bad27287e5a..a2381bc30f2 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -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); } } diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 59428a19210..60295adbd87 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -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;