-/* $Id: ac_context.c,v 1.1 2000/12/26 15:14:04 keithw Exp $ */
+/* $Id: ac_context.c,v 1.4 2001/04/28 08:39:18 keithw Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- * Author:
+ * Authors:
* Keith Whitwell <keithw@valinux.com>
*/
ACcontext *ac = AC_CONTEXT(ctx);
struct gl_client_array *cl;
GLuint i;
-
+
cl = &ac->Fallback.Normal;
cl->Size = 3;
cl->Type = GL_FLOAT;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Normal;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
cl = &ac->Fallback.Color;
cl->Size = 4;
- cl->Type = GL_UNSIGNED_BYTE;
+ cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Color;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
cl = &ac->Fallback.SecondaryColor;
cl->Size = 3;
- cl->Type = GL_UNSIGNED_BYTE;
+ cl->Type = GL_FLOAT;
cl->Stride = 0;
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.SecondaryColor;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
cl = &ac->Fallback.FogCoord;
cl->Size = 1;
cl->StrideB = 0;
cl->Ptr = (void *) &ctx->Current.FogCoord;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
cl = &ac->Fallback.Index;
cl->Size = 1;
cl->StrideB = 0;
cl->Ptr = (void *) &ctx->Current.Index;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) {
cl = &ac->Fallback.TexCoord[i];
cl->StrideB = 0;
cl->Ptr = (void *) ctx->Current.Texcoord[i];
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
}
cl = &ac->Fallback.EdgeFlag;
cl->StrideB = 0;
cl->Ptr = (void *) &ctx->Current.EdgeFlag;
cl->Enabled = 1;
+ cl->Flags = CA_CLIENT_DATA; /* hack */
}
cl->StrideB = 4 * sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
cl = &ac->Cache.Normal;
cl->Size = 3;
cl->StrideB = 3 * sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
cl = &ac->Cache.Color;
cl->Size = 4;
- cl->Type = GL_UNSIGNED_BYTE;
+ cl->Type = GL_FLOAT;
cl->Stride = 0;
- cl->StrideB = 4 * sizeof(GLubyte);
+ cl->StrideB = 4 * sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
cl = &ac->Cache.SecondaryColor;
cl->Size = 3;
- cl->Type = GL_UNSIGNED_BYTE;
+ cl->Type = GL_FLOAT;
cl->Stride = 0;
- cl->StrideB = 4 * sizeof(GLubyte);
+ cl->StrideB = 4 * sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
cl = &ac->Cache.FogCoord;
cl->Size = 1;
cl->StrideB = sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
cl = &ac->Cache.Index;
cl->Size = 1;
cl->StrideB = sizeof(GLuint);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) {
cl = &ac->Cache.TexCoord[i];
cl->StrideB = 4 * sizeof(GLfloat);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
}
cl = &ac->Cache.EdgeFlag;
cl->StrideB = sizeof(GLubyte);
cl->Ptr = MALLOC( cl->StrideB * size );
cl->Enabled = 1;
+ cl->Flags = 0;
}
ac->elt_size = size;
}
-static void _ac_current_init( GLcontext *ctx )
+static void _ac_raw_init( GLcontext *ctx )
{
ACcontext *ac = AC_CONTEXT(ctx);
GLuint i;
- ac->Current.Color = &ac->Fallback.Color;
- ac->Current.EdgeFlag = &ac->Fallback.EdgeFlag;
- ac->Current.FogCoord = &ac->Fallback.FogCoord;
- ac->Current.Index = &ac->Fallback.Index;
- ac->Current.Normal = &ac->Fallback.Normal;
- ac->Current.SecondaryColor = &ac->Fallback.SecondaryColor;
- ac->Current.Vertex = &ctx->Array.Vertex;
-
- ac->Writeable.Color = GL_FALSE;
- ac->Writeable.EdgeFlag = GL_FALSE;
- ac->Writeable.FogCoord = GL_FALSE;
- ac->Writeable.Index = GL_FALSE;
- ac->Writeable.Normal = GL_FALSE;
- ac->Writeable.SecondaryColor = GL_FALSE;
- ac->Writeable.Vertex = GL_FALSE;
+ ac->Raw.Color = ac->Fallback.Color;
+ ac->Raw.EdgeFlag = ac->Fallback.EdgeFlag;
+ ac->Raw.FogCoord = ac->Fallback.FogCoord;
+ ac->Raw.Index = ac->Fallback.Index;
+ ac->Raw.Normal = ac->Fallback.Normal;
+ ac->Raw.SecondaryColor = ac->Fallback.SecondaryColor;
+ ac->Raw.Vertex = ctx->Array.Vertex;
+
+ ac->IsCached.Color = GL_FALSE;
+ ac->IsCached.EdgeFlag = GL_FALSE;
+ ac->IsCached.FogCoord = GL_FALSE;
+ ac->IsCached.Index = GL_FALSE;
+ ac->IsCached.Normal = GL_FALSE;
+ ac->IsCached.SecondaryColor = GL_FALSE;
+ ac->IsCached.Vertex = GL_FALSE;
for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) {
- ac->Current.TexCoord[i] = &ac->Fallback.TexCoord[i];
- ac->Writeable.TexCoord[i] = GL_FALSE;
+ ac->Raw.TexCoord[i] = ac->Fallback.TexCoord[i];
+ ac->IsCached.TexCoord[i] = GL_FALSE;
}
}
if (ctx->acache_context) {
_ac_cache_init( ctx );
_ac_fallbacks_init( ctx );
- _ac_current_init( ctx );
+ _ac_raw_init( ctx );
_ac_elts_init( ctx );
return GL_TRUE;
}
if (ac->Cache.FogCoord.Ptr) FREE( ac->Cache.FogCoord.Ptr );
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- if (ac->Cache.TexCoord[i].Ptr)
+ if (ac->Cache.TexCoord[i].Ptr)
FREE( ac->Cache.TexCoord[i].Ptr );
}