On 10/26/2013 01:33 PM, Kenneth Graunke wrote: > This is a bit shorter. > > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
With the one change suggested below, Reviewed-by: Ian Romanick <ian.d.roman...@intel.com> > --- > src/mesa/drivers/dri/i965/gen7_sol_state.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c > b/src/mesa/drivers/dri/i965/gen7_sol_state.c > index 7cac8fe..3e02bdf 100644 > --- a/src/mesa/drivers/dri/i965/gen7_sol_state.c > +++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c > @@ -122,12 +122,12 @@ gen7_upload_3dstate_so_decl_list(struct brw_context > *brw, > int buffer = linked_xfb_info->Outputs[i].OutputBuffer; > uint16_t decl = 0; > int varying = linked_xfb_info->Outputs[i].OutputRegister; > - unsigned component_mask = > - (1 << linked_xfb_info->Outputs[i].NumComponents) - 1; > + unsigned components = linked_xfb_info->Outputs[i].NumComponents; > + unsigned component_mask = (1 << components) - 1; constify components because it makes it more obvious to humans that the name is just shorthand. I know it does nothing for the compiler. > > /* gl_PointSize is stored in VARYING_SLOT_PSIZ.w. */ > if (varying == VARYING_SLOT_PSIZ) { > - assert(linked_xfb_info->Outputs[i].NumComponents == 1); > + assert(components == 1); > component_mask <<= 3; > } else { > component_mask <<= linked_xfb_info->Outputs[i].ComponentOffset; > @@ -145,7 +145,7 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw, > */ > assert(linked_xfb_info->Outputs[i].DstOffset == next_offset[buffer]); > > - next_offset[buffer] += linked_xfb_info->Outputs[i].NumComponents; > + next_offset[buffer] += components; > > so_decl[i] = decl; > } > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev