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

Eric Anholt eric at anholt.net
Fri May 3 14:52:02 PDT 2013


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.

Other than that,

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130503/9ee0a36a/attachment.pgp>


More information about the mesa-dev mailing list