[Mesa-dev] [PATCH 6/6] mesa: Rename gl_context::swtnl_im to vbo_context; use proper type.

Paul Berry stereotype441 at gmail.com
Fri Aug 30 12:32:32 PDT 2013


On 28 August 2013 16:49, Kenneth Graunke <kenneth at whitecape.org> wrote:

> The main GL context's swtnl_im field is the VBO module's vbo_context
> structure.  Using the name "swtnl" in the name is confusing since
> some drivers use hardware texturing and lighting, but still rely on the
> VBO module for drawing.
>
> v2: Forward declare the type and use that instead of void *
>     (suggested by Eric Anholt)
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/mtypes.h     | 3 ++-
>  src/mesa/vbo/vbo_context.c | 4 ++--
>  src/mesa/vbo/vbo_context.h | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 22bb58c..7d56322 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -80,6 +80,7 @@ struct prog_instruction;
>  struct gl_program_parameter_list;
>  struct set;
>  struct set_entry;
> +struct vbo_context;
>  /*@}*/
>
>
> @@ -3669,7 +3670,7 @@ struct gl_context
>     void *swrast_context;
>     void *swsetup_context;
>     void *swtnl_context;
> -   void *swtnl_im;
> +   struct vbo_context *vbo_context;
>     struct st_context *st;
>     void *aelt_context;
>     /*@}*/
> diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
> index b97313d..2aa5bbc 100644
> --- a/src/mesa/vbo/vbo_context.c
> +++ b/src/mesa/vbo/vbo_context.c
> @@ -152,7 +152,7 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
>  {
>     struct vbo_context *vbo = CALLOC_STRUCT(vbo_context);
>
> -   ctx->swtnl_im = (void *)vbo;
> +   ctx->vbo_context = (void *) vbo;
>

This cast isn't necessary either.  With both casts removed, everything but
patch 4 is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>
>     /* Initialize the arrayelt helper
>      */
> @@ -224,7 +224,7 @@ void _vbo_DestroyContext( struct gl_context *ctx )
>        if (ctx->API == API_OPENGL_COMPAT)
>           vbo_save_destroy(ctx);
>        free(vbo);
> -      ctx->swtnl_im = NULL;
> +      ctx->vbo_context = NULL;
>     }
>  }
>
> diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
> index 27fae83..db47a8b 100644
> --- a/src/mesa/vbo/vbo_context.h
> +++ b/src/mesa/vbo/vbo_context.h
> @@ -90,7 +90,7 @@ struct vbo_context {
>
>  static inline struct vbo_context *vbo_context(struct gl_context *ctx)
>  {
> -   return (struct vbo_context *)(ctx->swtnl_im);
> +   return (struct vbo_context *) ctx->vbo_context;
>  }
>
>
> --
> 1.8.3.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130830/1174255d/attachment-0001.html>


More information about the mesa-dev mailing list