[Mesa-dev] [PATCH 2/2] vbo: implement primitive merging for glBegin/End sequences

Brian Paul brianp at vmware.com
Fri May 3 16:03:01 PDT 2013


On 05/03/2013 03:52 PM, Eric Anholt wrote:
> Brian Paul<brianp at vmware.com>  writes:
>> diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
>> index b8dd90c..9ce3c6e 100644
>> --- a/src/mesa/vbo/vbo_save_api.c
>> +++ b/src/mesa/vbo/vbo_save_api.c
>> @@ -305,9 +305,9 @@ _save_reset_counters(struct gl_context *ctx)
>>    * previous prim.
>>    */
>>   static void
>> -vbo_merge_prims(struct gl_context *ctx,
>> -                struct _mesa_prim *prim_list,
>> -                GLuint *prim_count)
>> +merge_prims(struct gl_context *ctx,
>> +            struct _mesa_prim *prim_list,
>> +            GLuint *prim_count)
>>   {
>>      GLuint i;
>>      struct _mesa_prim *prev_prim = prim_list;
>> @@ -315,10 +315,9 @@ vbo_merge_prims(struct gl_context *ctx,
>>      for (i = 1; i<  *prim_count; i++) {
>>         struct _mesa_prim *this_prim = prim_list + i;
>>
>> -      if (this_prim->mode == prev_prim->mode&&
>> -          this_prim->mode == GL_QUADS&&
>> -          this_prim->count % 4 == 0&&
>> -          prev_prim->count % 4 == 0&&
>> +      vbo_try_prim_conversion(this_prim);
>> +
>> +      if (vbo_can_merge_prims(prev_prim, this_prim)&&
>>             this_prim->start == prev_prim->start + prev_prim->count&&
>>             this_prim->basevertex == prev_prim->basevertex&&
>>             this_prim->num_instances == prev_prim->num_instances&&
>
> These other checks look like they should be in vbo_can_merge_prims.

Will do.

> Other than that,
>
> Reviewed-by: Eric Anholt<eric at anholt.net>

Thanks.

-Brian


More information about the mesa-dev mailing list