summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save_draw.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-16 15:34:22 -0600
committerBrian Paul <[email protected]>2008-05-16 15:34:22 -0600
commitffbd455a36f1d7600bd5b60e91768133d901d2f4 (patch)
tree6212d6b21d98e5fc95903b9e4bb1c36061f5244a /src/mesa/vbo/vbo_save_draw.c
parent5f6a726d9f2274df1a968e5f3cd3862894b47a38 (diff)
fix an attr/src mix-up when setting-up/binding vertex arrays
This fixes problems with incorrect material coefficients when glMaterial is called per-vertex.
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r--src/mesa/vbo/vbo_save_draw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 3c6f0fccd98..bf5c6d4eefe 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -131,10 +131,12 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
break;
}
- for (attr = 0; attr < VBO_ATTRIB_MAX; attr++) {
- if (node->attrsz[attr]) {
+ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ GLuint src = map[attr];
+
+ if (node->attrsz[src]) {
arrays[attr].Ptr = (const GLubyte *)data;
- arrays[attr].Size = node->attrsz[attr];
+ arrays[attr].Size = node->attrsz[src];
arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat);
arrays[attr].Stride = node->vertex_size * sizeof(GLfloat);
arrays[attr].Type = GL_FLOAT;
@@ -144,7 +146,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx,
assert(arrays[attr].BufferObj->Name);
- data += node->attrsz[attr] * sizeof(GLfloat);
+ data += node->attrsz[src] * sizeof(GLfloat);
}
}
}