On Wed, Apr 1, 2015 at 6:19 PM, Jason Ekstrand <ja...@jlekstrand.net> wrote: > This allows us to get rid of the visitor argument in is_copy_payload > --- > src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp > b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp > index 09f0fad..e3cf2db 100644 > --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp > +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp > @@ -64,11 +64,8 @@ is_nop_mov(const fs_inst *inst) > } > > static bool > -is_copy_payload(const fs_visitor *v, const fs_inst *inst) > +is_copy_payload(const fs_inst *inst) > { > - if (v->alloc.sizes[inst->src[0].reg] != inst->regs_written) > - return false; > - > fs_reg reg = inst->src[0]; > > for (int i = 0; i < inst->sources; i++) > @@ -99,7 +96,10 @@ is_coalesce_candidate(const fs_visitor *v, const fs_inst > *inst) > return false; > > if (inst->opcode == SHADER_OPCODE_LOAD_PAYLOAD) { > - if (!is_copy_payload(v, inst)) { > + if (v->alloc.sizes[inst->src[0].reg] != inst->regs_written) > + return false; > + > + if (!is_copy_payload(inst)) { > return false; > } > } > -- > 2.3.4
What's the purpose of this? Checking the sizes seems like a necessary part, so why are you moving it out of the function? _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev