i965/nir/vec4: Implement atomic counter intrinsics (read, inc and dec)
[mesa.git] / src / mesa / vbo / vbo_context.c
index 4c3c9c09065f969b3ab9a5ecb8ab70506a9810b4..e3eb286e482ef4be323ddc33a93aad8a0894c22c 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.3
  *
  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
  *
@@ -23,7 +22,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Keith Whitwell <keith@tungstengraphics.com>
+ *    Keith Whitwell <keithw@vmware.com>
  */
 
 #include "main/imports.h"
@@ -38,9 +37,9 @@
 
 static GLuint check_size( const GLfloat *attr )
 {
-   if (attr[3] != 1.0) return 4;
-   if (attr[2] != 0.0) return 3;
-   if (attr[1] != 0.0) return 2;
+   if (attr[3] != 1.0F) return 4;
+   if (attr[2] != 0.0F) return 3;
+   if (attr[1] != 0.0F) return 2;
    return 1;           
 }
 
@@ -109,7 +108,7 @@ static void init_mat_currval(struct gl_context *ctx)
       &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT];
    GLuint i;
 
-   ASSERT(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX);
+   assert(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX);
 
    memset(arrays, 0, sizeof(*arrays) * NR_MAT_ATTRIBS);
 
@@ -153,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 = vbo;
 
    /* Initialize the arrayelt helper
     */
@@ -173,14 +172,14 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
       GLuint i;
 
       /* identity mapping */
-      for (i = 0; i < Elements(vbo->map_vp_none); i++) 
+      for (i = 0; i < ARRAY_SIZE(vbo->map_vp_none); i++) 
         vbo->map_vp_none[i] = i;
       /* map material attribs to generic slots */
       for (i = 0; i < NR_MAT_ATTRIBS; i++) 
         vbo->map_vp_none[VERT_ATTRIB_GENERIC(i)]
             = VBO_ATTRIB_MAT_FRONT_AMBIENT + i;
 
-      for (i = 0; i < Elements(vbo->map_vp_arb); i++)
+      for (i = 0; i < ARRAY_SIZE(vbo->map_vp_arb); i++)
         vbo->map_vp_arb[i] = i;
    }
 
@@ -225,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;
    }
 }