Make r300 driver build with GL_APPLE_vertex_array_object changes.
authorIan Romanick <idr@us.ibm.com>
Mon, 12 Jun 2006 22:39:49 +0000 (22:39 +0000)
committerIan Romanick <idr@us.ibm.com>
Mon, 12 Jun 2006 22:39:49 +0000 (22:39 +0000)
Sorry for the breakage.  These changes are only build tested.

src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c

index 6b8365e6d9e6a58720599255a7a012d73ecd5ca1..259781389fac1d2fbdbded66d5192f1fe7c3beca 100644 (file)
@@ -621,8 +621,12 @@ void r300UseArrays(GLcontext * ctx)
        
 #ifdef HW_VBOS
        
-#define USE_VBO(a) if (ctx->Array.a.BufferObj->Name && ctx->Array.a.Enabled) \
-               radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.a.BufferObj)->id)
+#define USE_VBO(a) \
+    do { \
+       if (ctx->Array.ArrayObj->a.BufferObj->Name \
+           && ctx->Array.ArrayObj->a.Enabled) \
+           radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.ArrayObj->a.BufferObj)->id); \
+    } while(0)
        
        if (ctx->Array.ElementArrayBufferObj->Name && ctx->Array.ElementArrayBufferObj->OnCard)
                radeon_mm_use(rmesa, ((struct r300_buffer_object *)ctx->Array.ElementArrayBufferObj)->id);
index 1044973b00151f744023ca8d6fb5feaa6dbda3a9..c65731d1d7aeba9511208ce44626a0a16fd9d793 100644 (file)
@@ -84,16 +84,18 @@ void radeon_vb_to_rvb(r300ContextPtr rmesa, struct radeon_vertex_buffer *rvb, st
 
 extern void _tnl_array_init( GLcontext *ctx );
 
-#define CONV(a, b) do { \
-                       if (ctx->Array.b.Enabled) { \
-                               rmesa->state.VB.AttribPtr[(a)].size = ctx->Array.b.Size; \
-                               rmesa->state.VB.AttribPtr[(a)].data = ctx->Array.b.BufferObj->Name ? \
-                               (void *)ADD_POINTERS(ctx->Array.b.Ptr, ctx->Array.b.BufferObj->Data) : (void *)ctx->Array.b.Ptr; \
-                               rmesa->state.VB.AttribPtr[(a)].stride = ctx->Array.b.StrideB; \
-                               rmesa->state.VB.AttribPtr[(a)].type = ctx->Array.b.Type; \
-                               enabled |= 1 << (a); \
-                       } \
-                  } while (0)
+#define CONV(a, b) \
+    do { \
+       if (ctx->Array.ArrayObj->b.Enabled) { \
+           rmesa->state.VB.AttribPtr[(a)].size = ctx->Array.ArrayObj->b.Size; \
+           rmesa->state.VB.AttribPtr[(a)].data = ctx->Array.ArrayObj->b.BufferObj->Name \
+             ? (void *)ADD_POINTERS(ctx->Array.ArrayObj->b.Ptr, ctx->Array.ArrayObj->b.BufferObj->Data) \
+             : (void *)ctx->Array.ArrayObj->b.Ptr; \
+           rmesa->state.VB.AttribPtr[(a)].stride = ctx->Array.ArrayObj->b.StrideB; \
+           rmesa->state.VB.AttribPtr[(a)].type = ctx->Array.ArrayObj->b.Type; \
+           enabled |= 1 << (a); \
+       } \
+    } while (0)
 
 static int setup_arrays(r300ContextPtr rmesa, GLint start)
 {