st/mesa: allow R8 to not be exposed as renderable by driver
[mesa.git] / src / mesa / main / dlist.c
index f1aee16d5876ed723fc2d09673ea17199c8fe081..a780100e456535519875ce591a06badd1002aceb 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "c99_math.h"
 #include "glheader.h"
-#include "imports.h"
+
 #include "api_arrayelt.h"
 #include "api_exec.h"
 #include "api_loopback.h"
@@ -73,6 +73,7 @@
 #include "vbo/vbo_util.h"
 #include "util/format_r11g11b10f.h"
 
+#include "util/u_memory.h"
 
 #define USE_BITMAP_ATLAS 1
 
@@ -1536,7 +1537,7 @@ unpack_image(struct gl_context *ctx, GLuint dimensions,
       return NULL;
    }
 
-   if (!_mesa_is_bufferobj(unpack->BufferObj)) {
+   if (!unpack->BufferObj) {
       /* no PBO */
       GLvoid *image;
 
@@ -5900,188 +5901,6 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
    }
 }
 
-static void GLAPIENTRY
-save_Attr1fNV(GLenum attr, GLfloat x)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 1;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib1fNV(ctx->Exec, (attr, x));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 2;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib2fNV(ctx->Exec, (attr, x, y));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-      n[4].f = z;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 3;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib3fNV(ctx->Exec, (attr, x, y, z));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-      n[4].f = z;
-      n[5].f = w;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 4;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib4fNV(ctx->Exec, (attr, x, y, z, w));
-   }
-}
-
-
-static void GLAPIENTRY
-save_Attr1fARB(GLenum attr, GLfloat x)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 1;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib1fARB(ctx->Exec, (attr, x));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 2;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib2fARB(ctx->Exec, (attr, x, y));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-      n[4].f = z;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 3;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib3fARB(ctx->Exec, (attr, x, y, z));
-   }
-}
-
-static void GLAPIENTRY
-save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5);
-   if (n) {
-      n[1].e = attr;
-      n[2].f = x;
-      n[3].f = y;
-      n[4].f = z;
-      n[5].f = w;
-   }
-
-   assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
-   ctx->ListState.ActiveAttribSize[attr] = 4;
-   ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
-
-   if (ctx->ExecuteFlag) {
-      CALL_VertexAttrib4fARB(ctx->Exec, (attr, x, y, z, w));
-   }
-}
-
-
 static void GLAPIENTRY
 save_EvalCoord1f(GLfloat x)
 {
@@ -6157,24 +5976,6 @@ save_EvalPoint2(GLint x, GLint y)
    }
 }
 
-static void GLAPIENTRY
-save_Indexf(GLfloat x)
-{
-   save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, x);
-}
-
-static void GLAPIENTRY
-save_Indexfv(const GLfloat * v)
-{
-   save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, v[0]);
-}
-
-static void GLAPIENTRY
-save_EdgeFlag(GLboolean x)
-{
-   save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? 1.0f : 0.0f);
-}
-
 
 /**
  * Compare 'count' elements of vectors 'a' and 'b'.
@@ -6317,1267 +6118,151 @@ save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
    }
 }
 
-
 static void GLAPIENTRY
-save_Vertex2f(GLfloat x, GLfloat y)
+save_PrimitiveRestartNV(void)
 {
-   save_Attr2fNV(VERT_ATTRIB_POS, x, y);
+   /* Note: this is used when outside a glBegin/End pair in a display list */
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   (void) alloc_instruction(ctx, OPCODE_PRIMITIVE_RESTART_NV, 0);
+   if (ctx->ExecuteFlag) {
+      CALL_PrimitiveRestartNV(ctx->Exec, ());
+   }
 }
 
-static void GLAPIENTRY
-save_Vertex2fv(const GLfloat * v)
-{
-   save_Attr2fNV(VERT_ATTRIB_POS, v[0], v[1]);
-}
 
 static void GLAPIENTRY
-save_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
+save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+                        GLbitfield mask, GLenum filter)
 {
-   save_Attr3fNV(VERT_ATTRIB_POS, x, y, z);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
+   if (n) {
+      n[1].i = srcX0;
+      n[2].i = srcY0;
+      n[3].i = srcX1;
+      n[4].i = srcY1;
+      n[5].i = dstX0;
+      n[6].i = dstY0;
+      n[7].i = dstX1;
+      n[8].i = dstY1;
+      n[9].i = mask;
+      n[10].e = filter;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BlitFramebuffer(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
+                                          dstX0, dstY0, dstX1, dstY1,
+                                          mask, filter));
+   }
 }
 
-static void GLAPIENTRY
-save_Vertex3fv(const GLfloat * v)
-{
-   save_Attr3fNV(VERT_ATTRIB_POS, v[0], v[1], v[2]);
-}
 
+/** GL_EXT_provoking_vertex */
 static void GLAPIENTRY
-save_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+save_ProvokingVertexEXT(GLenum mode)
 {
-   save_Attr4fNV(VERT_ATTRIB_POS, x, y, z, w);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
+   if (n) {
+      n[1].e = mode;
+   }
+   if (ctx->ExecuteFlag) {
+      /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
+      _mesa_ProvokingVertex(mode);
+   }
 }
 
-static void GLAPIENTRY
-save_Vertex4fv(const GLfloat * v)
-{
-   save_Attr4fNV(VERT_ATTRIB_POS, v[0], v[1], v[2], v[3]);
-}
 
+/** GL_EXT_transform_feedback */
 static void GLAPIENTRY
-save_TexCoord1f(GLfloat x)
+save_BeginTransformFeedback(GLenum mode)
 {
-   save_Attr1fNV(VERT_ATTRIB_TEX0, x);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
+   if (n) {
+      n[1].e = mode;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BeginTransformFeedback(ctx->Exec, (mode));
+   }
 }
 
-static void GLAPIENTRY
-save_TexCoord1fv(const GLfloat * v)
-{
-   save_Attr1fNV(VERT_ATTRIB_TEX0, v[0]);
-}
 
+/** GL_EXT_transform_feedback */
 static void GLAPIENTRY
-save_TexCoord2f(GLfloat x, GLfloat y)
+save_EndTransformFeedback(void)
 {
-   save_Attr2fNV(VERT_ATTRIB_TEX0, x, y);
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
+   if (ctx->ExecuteFlag) {
+      CALL_EndTransformFeedback(ctx->Exec, ());
+   }
 }
 
 static void GLAPIENTRY
-save_TexCoord2fv(const GLfloat * v)
+save_BindTransformFeedback(GLenum target, GLuint name)
 {
-   save_Attr2fNV(VERT_ATTRIB_TEX0, v[0], v[1]);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BIND_TRANSFORM_FEEDBACK, 2);
+   if (n) {
+      n[1].e = target;
+      n[2].ui = name;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BindTransformFeedback(ctx->Exec, (target, name));
+   }
 }
 
 static void GLAPIENTRY
-save_TexCoord3f(GLfloat x, GLfloat y, GLfloat z)
+save_PauseTransformFeedback(void)
 {
-   save_Attr3fNV(VERT_ATTRIB_TEX0, x, y, z);
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   (void) alloc_instruction(ctx, OPCODE_PAUSE_TRANSFORM_FEEDBACK, 0);
+   if (ctx->ExecuteFlag) {
+      CALL_PauseTransformFeedback(ctx->Exec, ());
+   }
 }
 
 static void GLAPIENTRY
-save_TexCoord3fv(const GLfloat * v)
+save_ResumeTransformFeedback(void)
 {
-   save_Attr3fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2]);
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   (void) alloc_instruction(ctx, OPCODE_RESUME_TRANSFORM_FEEDBACK, 0);
+   if (ctx->ExecuteFlag) {
+      CALL_ResumeTransformFeedback(ctx->Exec, ());
+   }
 }
 
 static void GLAPIENTRY
-save_TexCoord4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+save_DrawTransformFeedback(GLenum mode, GLuint name)
 {
-   save_Attr4fNV(VERT_ATTRIB_TEX0, x, y, z, w);
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK, 2);
+   if (n) {
+      n[1].e = mode;
+      n[2].ui = name;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_DrawTransformFeedback(ctx->Exec, (mode, name));
+   }
 }
 
 static void GLAPIENTRY
-save_TexCoord4fv(const GLfloat * v)
-{
-   save_Attr4fNV(VERT_ATTRIB_TEX0, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_Normal3f(GLfloat x, GLfloat y, GLfloat z)
-{
-   save_Attr3fNV(VERT_ATTRIB_NORMAL, x, y, z);
-}
-
-static void GLAPIENTRY
-save_Normal3fv(const GLfloat * v)
-{
-   save_Attr3fNV(VERT_ATTRIB_NORMAL, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_FogCoordfEXT(GLfloat x)
-{
-   save_Attr1fNV(VERT_ATTRIB_FOG, x);
-}
-
-static void GLAPIENTRY
-save_FogCoordfvEXT(const GLfloat * v)
-{
-   save_Attr1fNV(VERT_ATTRIB_FOG, v[0]);
-}
-
-static void GLAPIENTRY
-save_Color3f(GLfloat x, GLfloat y, GLfloat z)
-{
-   save_Attr3fNV(VERT_ATTRIB_COLOR0, x, y, z);
-}
-
-static void GLAPIENTRY
-save_Color3fv(const GLfloat * v)
-{
-   save_Attr3fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_Color4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-   save_Attr4fNV(VERT_ATTRIB_COLOR0, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_Color4fv(const GLfloat * v)
-{
-   save_Attr4fNV(VERT_ATTRIB_COLOR0, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_SecondaryColor3fEXT(GLfloat x, GLfloat y, GLfloat z)
-{
-   save_Attr3fNV(VERT_ATTRIB_COLOR1, x, y, z);
-}
-
-static void GLAPIENTRY
-save_SecondaryColor3fvEXT(const GLfloat * v)
-{
-   save_Attr3fNV(VERT_ATTRIB_COLOR1, v[0], v[1], v[2]);
-}
-
-
-/**
- * Record a GL_INVALID_VALUE error when an invalid vertex attribute
- * index is found.
- */
-static void
-index_error(void)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
-}
-
-#define ATTR1F( A, X )          save_Attr1fNV(A, X)
-#define ATTR2F( A, X, Y )       save_Attr2fNV(A, X, Y)
-#define ATTR3F( A, X, Y, Z )    save_Attr3fNV(A, X, Y, Z)
-#define ATTR4F( A, X, Y, Z, W ) save_Attr4fNV(A, X, Y, Z, W)
-
-#define ATTR1FV( A, V )          save_Attr1fNV(A, V[0])
-#define ATTR2FV( A, V )          save_Attr2fNV(A, V[0], V[1])
-#define ATTR3FV( A, V )          save_Attr3fNV(A, V[0], V[0], V[2])
-#define ATTR4FV( A, V )          save_Attr4fNV(A, V[0], V[1], V[2], V[3])
-
-#define ATTRUI10_1( A, UI ) ATTR1F( A, (UI) & 0x3ff)
-#define ATTRUI10_2( A, UI ) ATTR2F( A, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff)
-#define ATTRUI10_3( A, UI ) ATTR3F( A, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff, ((UI) >> 20) & 0x3ff)
-#define ATTRUI10_4( A, UI ) ATTR4F( A, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff, ((UI) >> 20) & 0x3ff, ((UI) >> 30) & 0x3 )
-
-#define ATTRUI10N_1( A, UI ) ATTR1F( A, conv_ui10_to_norm_float((UI) & 0x3ff))
-#define ATTRUI10N_2( A, UI ) ATTR2F( A, \
-                                  conv_ui10_to_norm_float((UI) & 0x3ff), \
-                                  conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff))
-#define ATTRUI10N_3( A, UI ) ATTR3F( A, \
-                                  conv_ui10_to_norm_float((UI) & 0x3ff), \
-                                  conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff), \
-                                  conv_ui10_to_norm_float(((UI) >> 20) & 0x3ff))
-#define ATTRUI10N_4( A, UI ) ATTR4F( A, \
-                                  conv_ui10_to_norm_float((UI) & 0x3ff), \
-                                  conv_ui10_to_norm_float(((UI) >> 10) & 0x3ff), \
-                                  conv_ui10_to_norm_float(((UI) >> 20) & 0x3ff), \
-                                  conv_ui2_to_norm_float(((UI) >> 30) & 0x3) )
-
-#define ATTRI10_1( A, I10 ) ATTR1F( A, conv_i10_to_i((I10) & 0x3ff))
-#define ATTRI10_2( A, I10 ) ATTR2F( A, \
-                               conv_i10_to_i((I10) & 0x3ff),           \
-                               conv_i10_to_i(((I10) >> 10) & 0x3ff))
-#define ATTRI10_3( A, I10 ) ATTR3F( A, \
-                               conv_i10_to_i((I10) & 0x3ff),       \
-                               conv_i10_to_i(((I10) >> 10) & 0x3ff), \
-                               conv_i10_to_i(((I10) >> 20) & 0x3ff))
-#define ATTRI10_4( A, I10 ) ATTR4F( A, \
-                               conv_i10_to_i((I10) & 0x3ff),           \
-                               conv_i10_to_i(((I10) >> 10) & 0x3ff), \
-                               conv_i10_to_i(((I10) >> 20) & 0x3ff), \
-                               conv_i2_to_i(((I10) >> 30) & 0x3))
-
-#define ATTRI10N_1(ctx, A, I10) ATTR1F(A, conv_i10_to_norm_float(ctx, (I10) & 0x3ff))
-#define ATTRI10N_2(ctx, A, I10) ATTR2F(A, \
-                               conv_i10_to_norm_float(ctx, (I10) & 0x3ff),             \
-                               conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff))
-#define ATTRI10N_3(ctx, A, I10) ATTR3F(A, \
-                               conv_i10_to_norm_float(ctx, (I10) & 0x3ff),         \
-                               conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \
-                               conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff))
-#define ATTRI10N_4(ctx, A, I10) ATTR4F(A, \
-                               conv_i10_to_norm_float(ctx, (I10) & 0x3ff),             \
-                               conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \
-                               conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff), \
-                               conv_i2_to_norm_float(ctx, ((I10) >> 30) & 0x3))
-
-#define ATTR_UI(ctx, val, type, normalized, attr, arg) do {    \
-   if ((type) == GL_UNSIGNED_INT_2_10_10_10_REV) {             \
-      if (normalized) {                                                \
-        ATTRUI10N_##val((attr), (arg));                        \
-      } else {                                                 \
-        ATTRUI10_##val((attr), (arg));                         \
-      }                                                                \
-   } else if ((type) == GL_INT_2_10_10_10_REV) {               \
-      if (normalized) {                                                \
-        ATTRI10N_##val(ctx, (attr), (arg));                    \
-      } else {                                                 \
-        ATTRI10_##val((attr), (arg));                          \
-      }                                                                \
-   } else if ((type) == GL_UNSIGNED_INT_10F_11F_11F_REV) {     \
-      float res[4];                                            \
-      res[3] = 1;                                               \
-      r11g11b10f_to_float3((arg), res);                                \
-      ATTR##val##FV((attr), res);                              \
-   }                                                            \
-} while(0)
-
-#define ATTR_UI_INDEX(ctx, val, type, normalized, index, arg) do {     \
-      if ((index) == 0 && _mesa_attr_zero_aliases_vertex(ctx)) {       \
-        ATTR_UI(ctx, val, (type), normalized, 0, (arg));               \
-      } else if ((index) < MAX_VERTEX_GENERIC_ATTRIBS) {               \
-        ATTR_UI(ctx, val, (type), normalized, VERT_ATTRIB_GENERIC0 + (index), (arg)); \
-      } else                                                           \
-        index_error();                                                 \
-   } while(0)
-
-static void GLAPIENTRY
-save_VertexP2ui(GLenum type, GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2ui");
-   ATTR_UI(ctx, 2, type, 0, VERT_ATTRIB_POS, value);
-}
-
-static void GLAPIENTRY
-save_VertexP2uiv(GLenum type, const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2uiv");
-   ATTR_UI(ctx, 2, type, 0, VERT_ATTRIB_POS, value[0]);
-}
-
-static void GLAPIENTRY
-save_VertexP3ui(GLenum type, GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3ui");
-   ATTR_UI(ctx, 3, type, 0, VERT_ATTRIB_POS, value);
-}
-
-static void GLAPIENTRY
-save_VertexP3uiv(GLenum type, const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3uiv");
-   ATTR_UI(ctx, 3, type, 0, VERT_ATTRIB_POS, value[0]);
-}
-
-static void GLAPIENTRY
-save_VertexP4ui(GLenum type, GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4ui");
-   ATTR_UI(ctx, 4, type, 0, VERT_ATTRIB_POS, value);
-}
-
-static void GLAPIENTRY
-save_VertexP4uiv(GLenum type, const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4uiv");
-   ATTR_UI(ctx, 4, type, 0, VERT_ATTRIB_POS, value[0]);
-}
-
-static void GLAPIENTRY
-save_TexCoordP1ui(GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1ui");
-   ATTR_UI(ctx, 1, type, 0, VERT_ATTRIB_TEX0, coords);
-}
-
-static void GLAPIENTRY
-save_TexCoordP1uiv(GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1uiv");
-   ATTR_UI(ctx, 1, type, 0, VERT_ATTRIB_TEX0, coords[0]);
-}
-
-static void GLAPIENTRY
-save_TexCoordP2ui(GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2ui");
-   ATTR_UI(ctx, 2, type, 0, VERT_ATTRIB_TEX0, coords);
-}
-
-static void GLAPIENTRY
-save_TexCoordP2uiv(GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2uiv");
-   ATTR_UI(ctx, 2, type, 0, VERT_ATTRIB_TEX0, coords[0]);
-}
-
-static void GLAPIENTRY
-save_TexCoordP3ui(GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3ui");
-   ATTR_UI(ctx, 3, type, 0, VERT_ATTRIB_TEX0, coords);
-}
-
-static void GLAPIENTRY
-save_TexCoordP3uiv(GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3uiv");
-   ATTR_UI(ctx, 3, type, 0, VERT_ATTRIB_TEX0, coords[0]);
-}
-
-static void GLAPIENTRY
-save_TexCoordP4ui(GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4ui");
-   ATTR_UI(ctx, 4, type, 0, VERT_ATTRIB_TEX0, coords);
-}
-
-static void GLAPIENTRY
-save_TexCoordP4uiv(GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4uiv");
-   ATTR_UI(ctx, 4, type, 0, VERT_ATTRIB_TEX0, coords[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP1ui(GLenum target, GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1ui");
-   ATTR_UI(ctx, 1, type, 0, attr, coords);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP1uiv(GLenum target, GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1uiv");
-   ATTR_UI(ctx, 1, type, 0, attr, coords[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP2ui(GLenum target, GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2ui");
-   ATTR_UI(ctx, 2, type, 0, attr, coords);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP2uiv(GLenum target, GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2uiv");
-   ATTR_UI(ctx, 2, type, 0, attr, coords[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP3ui(GLenum target, GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3ui");
-   ATTR_UI(ctx, 3, type, 0, attr, coords);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP3uiv(GLenum target, GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3uiv");
-   ATTR_UI(ctx, 3, type, 0, attr, coords[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP4ui(GLenum target, GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4ui");
-   ATTR_UI(ctx, 4, type, 0, attr, coords);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoordP4uiv(GLenum target, GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4uiv");
-   ATTR_UI(ctx, 4, type, 0, attr, coords[0]);
-}
-
-static void GLAPIENTRY
-save_NormalP3ui(GLenum type, GLuint coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3ui");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_NORMAL, coords);
-}
-
-static void GLAPIENTRY
-save_NormalP3uiv(GLenum type, const GLuint *coords)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3uiv");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_NORMAL, coords[0]);
-}
-
-static void GLAPIENTRY
-save_ColorP3ui(GLenum type, GLuint color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3ui");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_COLOR0, color);
-}
-
-static void GLAPIENTRY
-save_ColorP3uiv(GLenum type, const GLuint *color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3uiv");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_COLOR0, color[0]);
-}
-
-static void GLAPIENTRY
-save_ColorP4ui(GLenum type, GLuint color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4ui");
-   ATTR_UI(ctx, 4, type, 1, VERT_ATTRIB_COLOR0, color);
-}
-
-static void GLAPIENTRY
-save_ColorP4uiv(GLenum type, const GLuint *color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4uiv");
-   ATTR_UI(ctx, 4, type, 1, VERT_ATTRIB_COLOR0, color[0]);
-}
-
-static void GLAPIENTRY
-save_SecondaryColorP3ui(GLenum type, GLuint color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3ui");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_COLOR1, color);
-}
-
-static void GLAPIENTRY
-save_SecondaryColorP3uiv(GLenum type, const GLuint *color)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3uiv");
-   ATTR_UI(ctx, 3, type, 1, VERT_ATTRIB_COLOR1, color[0]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized,
-                      GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1ui");
-   ATTR_UI_INDEX(ctx, 1, type, normalized, index, value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized,
-                      GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2ui");
-   ATTR_UI_INDEX(ctx, 2, type, normalized, index, value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP3ui(GLuint index, GLenum type, GLboolean normalized,
-                      GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3ui");
-   ATTR_UI_INDEX(ctx, 3, type, normalized, index, value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP4ui(GLuint index, GLenum type, GLboolean normalized,
-                      GLuint value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4ui");
-   ATTR_UI_INDEX(ctx, 4, type, normalized, index, value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized,
-                       const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP1uiv");
-   ATTR_UI_INDEX(ctx, 1, type, normalized, index, *value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP2uiv(GLuint index, GLenum type, GLboolean normalized,
-                       const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP2uiv");
-   ATTR_UI_INDEX(ctx, 2, type, normalized, index, *value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP3uiv(GLuint index, GLenum type, GLboolean normalized,
-                       const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE_EXT(ctx, type, "glVertexAttribP3uiv");
-   ATTR_UI_INDEX(ctx, 3, type, normalized, index, *value);
-}
-
-static void GLAPIENTRY
-save_VertexAttribP4uiv(GLuint index, GLenum type, GLboolean normalized,
-                       const GLuint *value)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4uiv");
-   ATTR_UI_INDEX(ctx, 4, type, normalized, index, *value);
-}
-
-
-/* Just call the respective ATTR for texcoord
- */
-static void GLAPIENTRY
-save_MultiTexCoord1f(GLenum target, GLfloat x)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr1fNV(attr, x);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord1fv(GLenum target, const GLfloat * v)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr1fNV(attr, v[0]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord2f(GLenum target, GLfloat x, GLfloat y)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr2fNV(attr, x, y);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord2fv(GLenum target, const GLfloat * v)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr2fNV(attr, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord3f(GLenum target, GLfloat x, GLfloat y, GLfloat z)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr3fNV(attr, x, y, z);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord3fv(GLenum target, const GLfloat * v)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr3fNV(attr, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord4f(GLenum target, GLfloat x, GLfloat y,
-                     GLfloat z, GLfloat w)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr4fNV(attr, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_MultiTexCoord4fv(GLenum target, const GLfloat * v)
-{
-   GLuint attr = (target & 0x7) + VERT_ATTRIB_TEX0;
-   save_Attr4fNV(attr, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fNV(GLuint index, GLfloat x)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr1fNV(index, x);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr1fNV(index, v[0]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr2fNV(index, x, y);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr2fNV(index, v[0], v[1]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr3fNV(index, x, y, z);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr3fNV(index, v[0], v[1], v[2]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
-                      GLfloat z, GLfloat w)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr4fNV(index, x, y, z, w);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fARB(GLuint index, GLfloat x)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr1fARB(index, x);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr1fARB(index, v[0]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr2fARB(index, x, y);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr2fARB(index, v[0], v[1]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr3fARB(index, x, y, z);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr3fARB(index, v[0], v[1], v[2]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
-                       GLfloat w)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr4fARB(index, x, y, z, w);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttribL1d(GLuint index, GLdouble x)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_1D, 3);
-      if (n) {
-         n[1].ui = index;
-         ASSIGN_DOUBLE_TO_NODES(n, 2, x);
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLdouble));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribL1d(ctx->Exec, (index, x));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribL1dv(GLuint index, const GLdouble *v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_VertexAttribL1d(index, v[0]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttribL2d(GLuint index, GLdouble x, GLdouble y)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_2D, 5);
-      if (n) {
-         n[1].ui = index;
-         ASSIGN_DOUBLE_TO_NODES(n, 2, x);
-         ASSIGN_DOUBLE_TO_NODES(n, 4, y);
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 2;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2],
-             2 * sizeof(GLdouble));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribL2d(ctx->Exec, (index, x, y));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribL2dv(GLuint index, const GLdouble *v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_VertexAttribL2d(index, v[0], v[1]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttribL3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_3D, 7);
-      if (n) {
-         n[1].ui = index;
-         ASSIGN_DOUBLE_TO_NODES(n, 2, x);
-         ASSIGN_DOUBLE_TO_NODES(n, 4, y);
-         ASSIGN_DOUBLE_TO_NODES(n, 6, z);
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 3;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2],
-             3 * sizeof(GLdouble));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribL3d(ctx->Exec, (index, x, y, z));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribL3dv(GLuint index, const GLdouble *v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_VertexAttribL3d(index, v[0], v[1], v[2]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttribL4d(GLuint index, GLdouble x, GLdouble y, GLdouble z,
-                       GLdouble w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_4D, 9);
-      if (n) {
-         n[1].ui = index;
-         ASSIGN_DOUBLE_TO_NODES(n, 2, x);
-         ASSIGN_DOUBLE_TO_NODES(n, 4, y);
-         ASSIGN_DOUBLE_TO_NODES(n, 6, z);
-         ASSIGN_DOUBLE_TO_NODES(n, 8, w);
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 4;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2],
-             4 * sizeof(GLdouble));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribL4d(ctx->Exec, (index, x, y, z, w));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribL4dv(GLuint index, const GLdouble *v)
-{
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
-      save_VertexAttribL4d(index, v[0], v[1], v[2], v[3]);
-   else
-      index_error();
-}
-
-static void GLAPIENTRY
-save_VertexAttribI1i(GLuint index, GLint x)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_1I, 2);
-      if (n) {
-         n[1].ui = index;
-         n[2].i = x;
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLint));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribI1iEXT(ctx->Exec, (index, x));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribI2i(GLuint index, GLint x, GLint y)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_2I, 3);
-      if (n) {
-         n[1].ui = index;
-         n[2].i = x;
-         n[3].i = y;
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLint));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribI2iEXT(ctx->Exec, (index, x, y));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribI3i(GLuint index, GLint x, GLint y, GLint z)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_3I, 4);
-      if (n) {
-         n[1].ui = index;
-         n[2].i = x;
-         n[3].i = y;
-         n[4].i = z;
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLint));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribI3iEXT(ctx->Exec, (index, x, y, z));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_3I, 5);
-      if (n) {
-         n[1].ui = index;
-         n[2].i = x;
-         n[3].i = y;
-         n[4].i = z;
-         n[5].i = w;
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLint));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribI4iEXT(ctx->Exec, (index, x, y, z, w));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribI2iv(GLuint index, const GLint *v)
-{
-   save_VertexAttribI2i(index, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI3iv(GLuint index, const GLint *v)
-{
-   save_VertexAttribI3i(index, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI4iv(GLuint index, const GLint *v)
-{
-   save_VertexAttribI4i(index, v[0], v[1], v[2], v[3]);
-}
-
-
-
-static void GLAPIENTRY
-save_VertexAttribI1ui(GLuint index, GLuint x)
-{
-   save_VertexAttribI1i(index, x);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI2ui(GLuint index, GLuint x, GLuint y)
-{
-   save_VertexAttribI2i(index, x, y);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI3ui(GLuint index, GLuint x, GLuint y, GLuint z)
-{
-   save_VertexAttribI3i(index, x, y, z);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
-{
-   save_VertexAttribI4i(index, x, y, z, w);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI2uiv(GLuint index, const GLuint *v)
-{
-   save_VertexAttribI2i(index, v[0], v[1]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI3uiv(GLuint index, const GLuint *v)
-{
-   save_VertexAttribI3i(index, v[0], v[1], v[2]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribI4uiv(GLuint index, const GLuint *v)
-{
-   save_VertexAttribI4i(index, v[0], v[1], v[2], v[3]);
-}
-
-static void GLAPIENTRY
-save_VertexAttribL1ui64ARB(GLuint index, GLuint64EXT x)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
-      Node *n;
-      SAVE_FLUSH_VERTICES(ctx);
-      n = alloc_instruction(ctx, OPCODE_ATTR_1UI64, 3);
-      if (n) {
-         n[1].ui = index;
-         ASSIGN_UINT64_TO_NODES(n, 2, x);
-      }
-
-      ctx->ListState.ActiveAttribSize[index] = 1;
-      memcpy(ctx->ListState.CurrentAttrib[index], &n[2], sizeof(GLdouble));
-
-      if (ctx->ExecuteFlag) {
-         CALL_VertexAttribL1ui64ARB(ctx->Exec, (index, x));
-      }
-   } else {
-      index_error();
-   }
-}
-
-static void GLAPIENTRY
-save_VertexAttribL1ui64vARB(GLuint index, const GLuint64EXT *v)
-{
-   save_VertexAttribL1ui64ARB(index, v[0]);
-}
-
-
-static void GLAPIENTRY
-save_PrimitiveRestartNV(void)
-{
-   /* Note: this is used when outside a glBegin/End pair in a display list */
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   (void) alloc_instruction(ctx, OPCODE_PRIMITIVE_RESTART_NV, 0);
-   if (ctx->ExecuteFlag) {
-      CALL_PrimitiveRestartNV(ctx->Exec, ());
-   }
-}
-
-
-static void GLAPIENTRY
-save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
-                        GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
-                        GLbitfield mask, GLenum filter)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
-   if (n) {
-      n[1].i = srcX0;
-      n[2].i = srcY0;
-      n[3].i = srcX1;
-      n[4].i = srcY1;
-      n[5].i = dstX0;
-      n[6].i = dstY0;
-      n[7].i = dstX1;
-      n[8].i = dstY1;
-      n[9].i = mask;
-      n[10].e = filter;
-   }
-   if (ctx->ExecuteFlag) {
-      CALL_BlitFramebuffer(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
-                                          dstX0, dstY0, dstX1, dstY1,
-                                          mask, filter));
-   }
-}
-
-
-/** GL_EXT_provoking_vertex */
-static void GLAPIENTRY
-save_ProvokingVertexEXT(GLenum mode)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
-   if (n) {
-      n[1].e = mode;
-   }
-   if (ctx->ExecuteFlag) {
-      /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
-      _mesa_ProvokingVertex(mode);
-   }
-}
-
-
-/** GL_EXT_transform_feedback */
-static void GLAPIENTRY
-save_BeginTransformFeedback(GLenum mode)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
-   if (n) {
-      n[1].e = mode;
-   }
-   if (ctx->ExecuteFlag) {
-      CALL_BeginTransformFeedback(ctx->Exec, (mode));
-   }
-}
-
-
-/** GL_EXT_transform_feedback */
-static void GLAPIENTRY
-save_EndTransformFeedback(void)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
-   if (ctx->ExecuteFlag) {
-      CALL_EndTransformFeedback(ctx->Exec, ());
-   }
-}
-
-static void GLAPIENTRY
-save_BindTransformFeedback(GLenum target, GLuint name)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_BIND_TRANSFORM_FEEDBACK, 2);
-   if (n) {
-      n[1].e = target;
-      n[2].ui = name;
-   }
-   if (ctx->ExecuteFlag) {
-      CALL_BindTransformFeedback(ctx->Exec, (target, name));
-   }
-}
-
-static void GLAPIENTRY
-save_PauseTransformFeedback(void)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   (void) alloc_instruction(ctx, OPCODE_PAUSE_TRANSFORM_FEEDBACK, 0);
-   if (ctx->ExecuteFlag) {
-      CALL_PauseTransformFeedback(ctx->Exec, ());
-   }
-}
-
-static void GLAPIENTRY
-save_ResumeTransformFeedback(void)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   (void) alloc_instruction(ctx, OPCODE_RESUME_TRANSFORM_FEEDBACK, 0);
-   if (ctx->ExecuteFlag) {
-      CALL_ResumeTransformFeedback(ctx->Exec, ());
-   }
-}
-
-static void GLAPIENTRY
-save_DrawTransformFeedback(GLenum mode, GLuint name)
-{
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK, 2);
-   if (n) {
-      n[1].e = mode;
-      n[2].ui = name;
-   }
-   if (ctx->ExecuteFlag) {
-      CALL_DrawTransformFeedback(ctx->Exec, (mode, name));
-   }
-}
-
-static void GLAPIENTRY
-save_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
+save_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
 {
    GET_CURRENT_CONTEXT(ctx);
    Node *n;
@@ -7658,6 +6343,171 @@ save_DispatchComputeIndirect(GLintptr indirect)
                "glDispatchComputeIndirect() during display list compile");
 }
 
+static void ALWAYS_INLINE
+save_Attr32bit(struct gl_context *ctx, unsigned attr, unsigned size,
+               GLenum type, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
+{
+   Node *n;
+   SAVE_FLUSH_VERTICES(ctx);
+   unsigned base_op;
+   unsigned index = attr;
+
+   /* We don't care about GL_INT vs GL_UNSIGNED_INT. The idea is to get W=1
+    * right for 3 or lower number of components, so only distinguish between
+    * FLOAT and INT.
+    */
+   if (type == GL_FLOAT) {
+      if (attr >= VERT_ATTRIB_GENERIC0) {
+         base_op = OPCODE_ATTR_1F_ARB;
+         attr -= VERT_ATTRIB_GENERIC0;
+      } else {
+         base_op = OPCODE_ATTR_1F_NV;
+      }
+   } else {
+      base_op = OPCODE_ATTR_1I;
+      attr -= VERT_ATTRIB_GENERIC0;
+   }
+
+   n = alloc_instruction(ctx, base_op + size - 1, 1 + size);
+   if (n) {
+      n[1].ui = attr;
+      n[2].ui = x;
+      if (size >= 2) n[3].ui = y;
+      if (size >= 3) n[4].ui = z;
+      if (size >= 4) n[5].ui = w;
+   }
+
+   ctx->ListState.ActiveAttribSize[index] = size;
+   ASSIGN_4V(ctx->ListState.CurrentAttrib[index], x, y, z, w);
+
+   if (ctx->ExecuteFlag) {
+      if (type == GL_FLOAT) {
+         if (base_op == OPCODE_ATTR_1F_NV) {
+            if (size == 4)
+               CALL_VertexAttrib4fNV(ctx->Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
+            else if (size == 3)
+               CALL_VertexAttrib3fNV(ctx->Exec, (attr, uif(x), uif(y), uif(z)));
+            else if (size == 2)
+               CALL_VertexAttrib2fNV(ctx->Exec, (attr, uif(x), uif(y)));
+            else
+               CALL_VertexAttrib1fNV(ctx->Exec, (attr, uif(x)));
+         } else {
+            if (size == 4)
+               CALL_VertexAttrib4fARB(ctx->Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
+            else if (size == 3)
+               CALL_VertexAttrib3fARB(ctx->Exec, (attr, uif(x), uif(y), uif(z)));
+            else if (size == 2)
+               CALL_VertexAttrib2fARB(ctx->Exec, (attr, uif(x), uif(y)));
+            else
+               CALL_VertexAttrib1fARB(ctx->Exec, (attr, uif(x)));
+         }
+      } else {
+         if (size == 4)
+            CALL_VertexAttribI4iEXT(ctx->Exec, (attr, x, y, z, w));
+         else if (size == 3)
+            CALL_VertexAttribI3iEXT(ctx->Exec, (attr, x, y, z));
+         else if (size == 2)
+            CALL_VertexAttribI2iEXT(ctx->Exec, (attr, x, y));
+         else
+            CALL_VertexAttribI1iEXT(ctx->Exec, (attr, x));
+      }
+   }
+}
+
+static void ALWAYS_INLINE
+save_Attr64bit(struct gl_context *ctx, unsigned attr, unsigned size,
+               GLenum type, uint64_t x, uint64_t y, uint64_t z, uint64_t w)
+{
+   Node *n;
+   SAVE_FLUSH_VERTICES(ctx);
+   unsigned base_op;
+   unsigned index = attr;
+
+   if (type == GL_DOUBLE) {
+      base_op = OPCODE_ATTR_1D;
+   } else {
+      base_op = OPCODE_ATTR_1UI64;
+      assert(size == 1);
+   }
+
+   attr -= VERT_ATTRIB_GENERIC0;
+   n = alloc_instruction(ctx, base_op + size - 1, 1 + size * 2);
+   if (n) {
+      n[1].ui = attr;
+      ASSIGN_UINT64_TO_NODES(n, 2, x);
+      if (size >= 2) ASSIGN_UINT64_TO_NODES(n, 4, y);
+      if (size >= 3) ASSIGN_UINT64_TO_NODES(n, 6, z);
+      if (size >= 4) ASSIGN_UINT64_TO_NODES(n, 8, w);
+   }
+
+   ctx->ListState.ActiveAttribSize[index] = size;
+   memcpy(ctx->ListState.CurrentAttrib[index], &n[2], size * sizeof(uint64_t));
+
+   if (ctx->ExecuteFlag) {
+      uint64_t v[] = {x, y, z, w};
+      if (type == GL_DOUBLE) {
+         if (size == 4)
+            CALL_VertexAttribL4dv(ctx->Exec, (attr, (GLdouble*)v));
+         else if (size == 3)
+            CALL_VertexAttribL3dv(ctx->Exec, (attr, (GLdouble*)v));
+         else if (size == 2)
+            CALL_VertexAttribL2dv(ctx->Exec, (attr, (GLdouble*)v));
+         else
+            CALL_VertexAttribL1d(ctx->Exec, (attr, UINT64_AS_DOUBLE(x)));
+      } else {
+         CALL_VertexAttribL1ui64ARB(ctx->Exec, (attr, x));
+      }
+   }
+}
+
+/**
+ * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
+ * It depends on a few things, including whether we're inside or outside
+ * of glBegin/glEnd.
+ */
+static inline bool
+is_vertex_position(const struct gl_context *ctx, GLuint index)
+{
+   return (index == 0 &&
+           _mesa_attr_zero_aliases_vertex(ctx) &&
+           _mesa_inside_dlist_begin_end(ctx));
+}
+
+/**
+ * This macro is used to implement all the glVertex, glColor, glTexCoord,
+ * glVertexAttrib, etc functions.
+ * \param A  VBO_ATTRIB_x attribute index
+ * \param N  attribute size (1..4)
+ * \param T  type (GL_FLOAT, GL_DOUBLE, GL_INT, GL_UNSIGNED_INT)
+ * \param C  cast type (uint32_t or uint64_t)
+ * \param V0, V1, v2, V3  attribute value
+ */
+#define ATTR_UNION(A, N, T, C, V0, V1, V2, V3)                          \
+do {                                                                    \
+   if (sizeof(C) == 4) {                                                \
+      save_Attr32bit(ctx, A, N, T, V0, V1, V2, V3);                     \
+   } else {                                                             \
+      save_Attr64bit(ctx, A, N, T, V0, V1, V2, V3);                     \
+   }                                                                    \
+} while (0)
+
+#undef ERROR
+#define ERROR(err) _mesa_error(ctx, err, __func__)
+#define TAG(x) save_##x
+
+#define VBO_ATTRIB_POS           VERT_ATTRIB_POS
+#define VBO_ATTRIB_NORMAL        VERT_ATTRIB_NORMAL
+#define VBO_ATTRIB_COLOR0        VERT_ATTRIB_COLOR0
+#define VBO_ATTRIB_COLOR1        VERT_ATTRIB_COLOR1
+#define VBO_ATTRIB_FOG           VERT_ATTRIB_FOG
+#define VBO_ATTRIB_COLOR_INDEX   VERT_ATTRIB_COLOR_INDEX
+#define VBO_ATTRIB_EDGEFLAG      VERT_ATTRIB_EDGEFLAG
+#define VBO_ATTRIB_TEX0          VERT_ATTRIB_TEX0
+#define VBO_ATTRIB_GENERIC0      VERT_ATTRIB_GENERIC0
+#define VBO_ATTRIB_MAX           VERT_ATTRIB_MAX
+
+#include "vbo/vbo_attrib_tmp.h"
+
 static void GLAPIENTRY
 save_UseProgram(GLuint program)
 {
@@ -14698,7 +13548,7 @@ execute_list(struct gl_context *ctx, GLuint list)
          default:
             {
                char msg[1000];
-               _mesa_snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
+               snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
                              (int) opcode);
                _mesa_problem(ctx, "%s", msg);
             }