[Mesa-dev] [PATCH 10/24] t_dd_dmatmp.h: Indentation and formatting fixes after HAVE_LINES change

Ian Romanick idr at freedesktop.org
Tue Sep 15 07:05:47 PDT 2015


On 09/14/2015 07:04 PM, Brian Paul wrote:
> On 09/14/2015 07:01 PM, Ian Romanick wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>   src/mesa/tnl_dd/t_dd_dmatmp.h | 92
>> +++++++++++++++++++++----------------------
>>   1 file changed, 46 insertions(+), 46 deletions(-)
>>
>> diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h
>> b/src/mesa/tnl_dd/t_dd_dmatmp.h
>> index 4a73a91..aca15d3 100644
>> --- a/src/mesa/tnl_dd/t_dd_dmatmp.h
>> +++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
>> @@ -137,33 +137,33 @@ static void TAG(render_points_verts)( struct
>> gl_context *ctx,
>>      }
>>   }
>>
>> -static void TAG(render_lines_verts)( struct gl_context *ctx,
>> -                     GLuint start,
>> -                     GLuint count,
>> -                     GLuint flags )
>> +static void TAG(render_lines_verts)(struct gl_context *ctx,
>> +                                    GLuint start,
>> +                                    GLuint count,
>> +                                    GLuint flags)
>>   {
>> -      LOCAL_VARS;
>> -      int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
>> -      int currentsz;
>> -      GLuint j, nr;
>> +   LOCAL_VARS;
>> +   int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
>> +   int currentsz;
>> +   GLuint j, nr;
>>
>> -      INIT( GL_LINES );
>> +   INIT(GL_LINES);
>>
>> -      /* Emit whole number of lines in total and in each buffer:
>> -       */
>> -      count -= count & 1;
>> -      currentsz = GET_CURRENT_VB_MAX_VERTS();
>> -      currentsz -= currentsz & 1;
>> -      dmasz -= dmasz & 1;
>> +   /* Emit whole number of lines in total and in each buffer:
>> +    */
>> +   count -= count & 1;
>> +   currentsz = GET_CURRENT_VB_MAX_VERTS();
>> +   currentsz -= currentsz & 1;
>> +   dmasz -= dmasz & 1;
> 
> Another way to express those statements would be:
> 
>     count &= ~1;
>     currentsz = GET_CURRENT_VB_MAX_VERTS();
>     currentsz &= ~1;
>     dmasz &= ~1;
> 
> I think that's a little simpler, but not a big deal.  I see you changed
> one of those in the last patch.

Yeah.  I did that in a couple places so that I could make dmasz
constant.  I thought about having a final patch that made this change
globally, but I just ran out of steam.  I may still do that while I'm on
the flight to XDC...

>>
>> -      if (currentsz < 8)
>> -     currentsz = dmasz;
>> +   if (currentsz < 8)
>> +      currentsz = dmasz;
>>
>> -      for (j = 0; j < count; j += nr) {
>> -     nr = MIN2( currentsz, count - j );
>> -         TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
>> -     currentsz = dmasz;
>> -      }
>> +   for (j = 0; j < count; j += nr) {
>> +      nr = MIN2(currentsz, count - j);
>> +      TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
>> +      currentsz = dmasz;
>> +   }
>>   }
>>
>>
>> @@ -662,35 +662,35 @@ static void TAG(render_points_elts)( struct
>> gl_context *ctx,
>>
>>
>>
>> -static void TAG(render_lines_elts)( struct gl_context *ctx,
>> -                    GLuint start,
>> -                    GLuint count,
>> -                    GLuint flags )
>> +static void TAG(render_lines_elts)(struct gl_context *ctx,
>> +                                   GLuint start,
>> +                                   GLuint count,
>> +                                   GLuint flags)
>>   {
>> -      LOCAL_VARS;
>> -      int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
>> -      int currentsz;
>> -      GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
>> -      GLuint j, nr;
>> +   LOCAL_VARS;
>> +   int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
>> +   int currentsz;
>> +   GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
>> +   GLuint j, nr;
>>
>> -      ELT_INIT( GL_LINES );
>> +   ELT_INIT(GL_LINES);
>>
>> -      /* Emit whole number of lines in total and in each buffer:
>> -       */
>> -      count -= count & 1;
>> -      currentsz -= currentsz & 1;
>> -      dmasz -= dmasz & 1;
>> +   /* Emit whole number of lines in total and in each buffer:
>> +    */
>> +   count -= count & 1;
>> +   currentsz -= currentsz & 1;
>> +   dmasz -= dmasz & 1;
>>
>> -      currentsz = GET_CURRENT_VB_MAX_ELTS();
>> -      if (currentsz < 8)
>> -     currentsz = dmasz;
>> +   currentsz = GET_CURRENT_VB_MAX_ELTS();
>> +   if (currentsz < 8)
>> +      currentsz = dmasz;
>>
>> -      for (j = 0; j < count; j += nr ) {
>> -     nr = MIN2( currentsz, count - j );
>> -         TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
>> -     FLUSH();
>> -     currentsz = dmasz;
>> -      }
>> +   for (j = 0; j < count; j += nr ) {
>> +      nr = MIN2(currentsz, count - j);
>> +      TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
>> +      FLUSH();
>> +      currentsz = dmasz;
>> +   }
>>   }
>>
>>



More information about the mesa-dev mailing list