[Mesa-dev] [PATCH] mesa: Rename gl_context::swtnl_im to vbo_context.

2013-03-21 Thread Kenneth Graunke
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.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/mesa/main/mtypes.h | 2 +-
 src/mesa/vbo/vbo_context.c | 4 ++--
 src/mesa/vbo/vbo_context.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 8c38aa7..7900897 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3613,7 +3613,7 @@ struct gl_context
void *swrast_context;
void *swsetup_context;
void *swtnl_context;
-   void *swtnl_im;
+   void *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 7eda31e..a9e4a1e 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;
 
/* 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 1ff6ec0..a8968b2 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -91,7 +91,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.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Rename gl_context::swtnl_im to vbo_context.

2013-03-21 Thread Brian Paul

On 03/21/2013 12:19 PM, Kenneth Graunke 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.

Signed-off-by: Kenneth Graunkekenn...@whitecape.org
---
  src/mesa/main/mtypes.h | 2 +-
  src/mesa/vbo/vbo_context.c | 4 ++--
  src/mesa/vbo/vbo_context.h | 2 +-
  3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 8c38aa7..7900897 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3613,7 +3613,7 @@ struct gl_context
 void *swrast_context;
 void *swsetup_context;
 void *swtnl_context;
-   void *swtnl_im;
+   void *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 7eda31e..a9e4a1e 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;

 /* 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 1ff6ec0..a8968b2 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -91,7 +91,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;
  }




Reviewed-by: Brian Paul bri...@vmware.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Rename gl_context::swtnl_im to vbo_context.

2013-03-21 Thread Eric Anholt
Kenneth Graunke kenn...@whitecape.org writes:

 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.

 Signed-off-by: Kenneth Graunke kenn...@whitecape.org
 ---
  src/mesa/main/mtypes.h | 2 +-
  src/mesa/vbo/vbo_context.c | 4 ++--
  src/mesa/vbo/vbo_context.h | 2 +-
  3 files changed, 4 insertions(+), 4 deletions(-)

 diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
 index 8c38aa7..7900897 100644
 --- a/src/mesa/main/mtypes.h
 +++ b/src/mesa/main/mtypes.h
 @@ -3613,7 +3613,7 @@ struct gl_context
 void *swrast_context;
 void *swsetup_context;
 void *swtnl_context;
 -   void *swtnl_im;
 +   void *vbo_context;
 struct st_context *st;
 void *aelt_context;
 /*@}*/

Could we forward declare struct vbo_context and use the actual type
here?  That would clarify things even further, and avoid gratuitous
casting.


pgpRpGeLsI2mN.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev