summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-26 14:43:07 -0700
committerBrian Paul <[email protected]>2011-12-26 15:21:32 -0700
commit0a7602b938893e1b04a01ca8680376cbeec053ab (patch)
tree41c39c77028d1e940e61f33a22c5d094961babcd /src/mesa/vbo/vbo_context.c
parent31bf243a92454758fb4b8efc6bd8ccac99b67b6e (diff)
vbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays
This fixes a regression seen with the isosurf demo when switching between glBegin/End and glDrawArrays (do it several times). The problem was the driver wasn't getting _NEW_ARRAY when the arrays were subtly changed: (vertex3f, normal3f) vs. (normal3f, vertex3f). This patch fixes that by signaling _NEW_ARRAY whenever we transition between glBegin/End and glDrawArrays mode and display lists. The patch also fixes up the initialization of the map_vp_none[] array to stop putting strange values in the last five elements of the array. v2: remove DRAW_ELEMENTS, don't distinguish between glDrawArrays and glDrawElements v3: add DRAW_DISPLAY_LIST for the display list case, just to be safe. Reviewed-by: Mathias Froehlich <[email protected]> Tested-by: Mathias Froehlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_context.c')
-rw-r--r--src/mesa/vbo/vbo_context.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index b2e6bbc12fb..d83f2fd23a5 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -176,17 +176,14 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
{
GLuint i;
- /* When no vertex program, pull in the material attributes in
- * the generic range.
- */
- for (i = 0; i < VERT_ATTRIB_FF_MAX; i++)
+ /* identity mapping */
+ for (i = 0; i < Elements(vbo->map_vp_none); i++)
vbo->map_vp_none[i] = i;
+ /* map material attribs to generic slots */
for (i = 0; i < NR_MAT_ATTRIBS; i++)
vbo->map_vp_none[VERT_ATTRIB_GENERIC(i)]
= VBO_ATTRIB_MAT_FRONT_AMBIENT + i;
- for (i = NR_MAT_ATTRIBS; i < VERT_ATTRIB_GENERIC_MAX; i++)
- vbo->map_vp_none[VERT_ATTRIB_GENERIC(i)] = i;
-
+
for (i = 0; i < Elements(vbo->map_vp_arb); i++)
vbo->map_vp_arb[i] = i;
}