summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save_api.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-01-15 13:40:38 +0000
committerKeith Whitwell <[email protected]>2007-01-15 13:40:38 +0000
commit2421b25dd777ebfd614ae45907fd4af8c2713102 (patch)
tree652a05de41f0df5beea7924506e318788d0ab3fe /src/mesa/vbo/vbo_save_api.c
parent1b7c24c33c43e2c0db391735b2f2ca0026459cc9 (diff)
Remove special-case handling for index and edgeflag
This isn't required with the changes to core mesa and the new attribute layout.
Diffstat (limited to 'src/mesa/vbo/vbo_save_api.c')
-rw-r--r--src/mesa/vbo/vbo_save_api.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index efe018b09e2..f339436f84c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -415,26 +415,14 @@ static void _save_copy_to_current( GLcontext *ctx )
struct vbo_save_context *save = &vbo_context(ctx)->save;
GLuint i;
- for (i = VBO_ATTRIB_POS+1 ; i <= VBO_ATTRIB_INDEX ; i++) {
+ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
if (save->attrsz[i]) {
save->currentsz[i][0] = save->attrsz[i];
COPY_CLEAN_4V(save->current[i],
- save->attrsz[i],
- save->attrptr[i]);
+ save->attrsz[i],
+ save->attrptr[i]);
}
}
-
- /* Edgeflag requires special treatment:
- *
- * TODO: change edgeflag to GLfloat in Mesa.
- */
- if (save->attrsz[VBO_ATTRIB_EDGEFLAG]) {
- ctx->ListState.ActiveEdgeFlag = 1;
- save->CurrentFloatEdgeFlag =
- save->attrptr[VBO_ATTRIB_EDGEFLAG][0];
- ctx->ListState.CurrentEdgeFlag =
- (save->CurrentFloatEdgeFlag == 1.0);
- }
}
@@ -443,7 +431,7 @@ static void _save_copy_from_current( GLcontext *ctx )
struct vbo_save_context *save = &vbo_context(ctx)->save;
GLint i;
- for (i = VBO_ATTRIB_POS+1 ; i <= VBO_ATTRIB_INDEX ; i++)
+ for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
switch (save->attrsz[i]) {
case 4: save->attrptr[i][3] = save->current[i][3];
case 3: save->attrptr[i][2] = save->current[i][2];
@@ -451,12 +439,6 @@ static void _save_copy_from_current( GLcontext *ctx )
case 1: save->attrptr[i][0] = save->current[i][0];
case 0: break;
}
-
- /* Edgeflag requires special treatment:
- */
- if (save->attrsz[VBO_ATTRIB_EDGEFLAG]) {
- save->CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag;
- save->attrptr[VBO_ATTRIB_EDGEFLAG][0] = save->CurrentFloatEdgeFlag;
}
}
@@ -616,6 +598,8 @@ do { \
if (save->active_sz[A] != N) \
save_fixup_vertex(ctx, A, N); \
\
+ _mesa_printf("Attr %d, sz %d: %f %f %f %f\n", A, N, V0, V1, V2, V3 ); \
+ \
{ \
GLfloat *dest = save->attrptr[A]; \
if (N>0) dest[0] = V0; \
@@ -1106,23 +1090,19 @@ static void _save_current_init( GLcontext *ctx )
struct vbo_save_context *save = &vbo_context(ctx)->save;
GLint i;
- for (i = 0; i < VBO_ATTRIB_FIRST_MATERIAL; i++) {
- save->currentsz[i] = &ctx->ListState.ActiveAttribSize[i];
- save->current[i] = ctx->ListState.CurrentAttrib[i];
+ for (i = VBO_ATTRIB_POS; i <= VBO_ATTRIB_GENERIC15; i++) {
+ const GLuint j = i - VBO_ATTRIB_POS;
+ ASSERT(j < VERT_ATTRIB_MAX);
+ save->currentsz[i] = &ctx->ListState.ActiveAttribSize[j];
+ save->current[i] = ctx->ListState.CurrentAttrib[j];
}
- for (i = VBO_ATTRIB_FIRST_MATERIAL; i < VBO_ATTRIB_INDEX; i++) {
+ for (i = VBO_ATTRIB_FIRST_MATERIAL; i <= VBO_ATTRIB_MAT_FRONT_AMBIENT; i++) {
const GLuint j = i - VBO_ATTRIB_FIRST_MATERIAL;
ASSERT(j < MAT_ATTRIB_MAX);
save->currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
save->current[i] = ctx->ListState.CurrentMaterial[j];
}
-
- save->currentsz[VBO_ATTRIB_INDEX] = &ctx->ListState.ActiveIndex;
- save->current[VBO_ATTRIB_INDEX] = &ctx->ListState.CurrentIndex;
-
- save->currentsz[VBO_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
- save->current[VBO_ATTRIB_EDGEFLAG] = &save->CurrentFloatEdgeFlag;
}
/**