summaryrefslogtreecommitdiff
path: root/src/mesa/array_cache
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-09-17 03:40:11 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-09-17 03:40:11 +0000
commit148a2847a105ce9d9189ad3081091de60f803a33 (patch)
tree103a9c215249d036f6bd44ffb8db812ca903f3ad /src/mesa/array_cache
parent4561f8418331f74cabf29649e9a4df7e92504a90 (diff)
More work on ARB_vertex_buffer_object.
Use GLubyte * instead of void * for gl_client_array->Ptr to simplify upcoming pointer arithmetic changes.
Diffstat (limited to 'src/mesa/array_cache')
-rw-r--r--src/mesa/array_cache/ac_context.c52
-rw-r--r--src/mesa/array_cache/ac_import.c2
2 files changed, 52 insertions, 2 deletions
diff --git a/src/mesa/array_cache/ac_context.c b/src/mesa/array_cache/ac_context.c
index 0cd3b8b4fc..e3c09fbd20 100644
--- a/src/mesa/array_cache/ac_context.c
+++ b/src/mesa/array_cache/ac_context.c
@@ -1,4 +1,3 @@
-
/*
* Mesa 3-D graphics library
* Version: 5.1
@@ -52,6 +51,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Fallback.Color;
cl->Size = 4;
@@ -61,6 +63,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Fallback.SecondaryColor;
cl->Size = 3;
@@ -70,6 +75,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Fallback.FogCoord;
cl->Size = 1;
@@ -79,6 +87,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) &ctx->Current.Attrib[VERT_ATTRIB_FOG];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Fallback.Index;
cl->Size = 1;
@@ -88,6 +99,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) &ctx->Current.Index;
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
for (i = 0 ; i < MAX_TEXTURE_COORD_UNITS ; i++) {
cl = &ac->Fallback.TexCoord[i];
@@ -98,6 +112,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
}
cl = &ac->Fallback.EdgeFlag;
@@ -108,6 +125,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) &ctx->Current.EdgeFlag;
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
cl = &ac->Fallback.Attrib[i];
@@ -118,6 +138,9 @@ static void _ac_fallbacks_init( GLcontext *ctx )
cl->Ptr = (void *) ctx->Current.Attrib[i];
cl->Enabled = 1;
cl->Flags = CA_CLIENT_DATA; /* hack */
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
}
}
@@ -140,6 +163,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Cache.Normal;
cl->Size = 3;
@@ -149,6 +175,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Cache.Color;
cl->Size = 4;
@@ -158,6 +187,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Cache.SecondaryColor;
cl->Size = 3;
@@ -167,6 +199,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Cache.FogCoord;
cl->Size = 1;
@@ -176,6 +211,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
cl = &ac->Cache.Index;
cl->Size = 1;
@@ -185,6 +223,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
cl = &ac->Cache.TexCoord[i];
@@ -195,6 +236,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
}
cl = &ac->Cache.EdgeFlag;
@@ -205,6 +249,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
for (i = 0 ; i < VERT_ATTRIB_MAX; i++) {
cl = &ac->Cache.Attrib[i];
@@ -215,6 +262,9 @@ static void _ac_cache_init( GLcontext *ctx )
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
cl->Flags = 0;
+#if FEATURE_ARB_vertex_buffer_object
+ cl->BufferObj = ctx->Array.NullBufferObj;
+#endif
}
}
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c
index ee15a6d749..b2b7eeb219 100644
--- a/src/mesa/array_cache/ac_import.c
+++ b/src/mesa/array_cache/ac_import.c
@@ -36,7 +36,7 @@
#define STRIDE_ARRAY( array, offset ) \
do { \
- char *tmp = (char *) (array).Ptr; \
+ GLubyte *tmp = (array).Ptr; \
tmp += (offset) * (array).StrideB; \
(array).Ptr = tmp; \
} while (0)