mesa: fix unused-but-set-variable warnings in dlist.c
[mesa.git] / src / mesa / main / dlist.c
index d847d4d5d3cefb625c8b0bed85836bde256ea31b..f9282398c2121672a56fc5142b566a018fdebb55 100644 (file)
 #include "hash.h"
 #include "image.h"
 #include "light.h"
-#include "dlist.h"
 #include "macros.h"
+#include "pack.h"
+#include "pbo.h"
 #include "queryobj.h"
+#include "samplerobj.h"
+#include "shaderapi.h"
+#include "syncobj.h"
 #include "teximage.h"
 #include "mtypes.h"
 #include "varray.h"
@@ -78,9 +82,9 @@
 struct gl_list_instruction
 {
    GLuint Size;
-   void (*Execute)( GLcontext *ctx, void *data );
-   void (*Destroy)( GLcontext *ctx, void *data );
-   void (*Print)( GLcontext *ctx, void *data );
+   void (*Execute)( struct gl_context *ctx, void *data );
+   void (*Destroy)( struct gl_context *ctx, void *data );
+   void (*Print)( struct gl_context *ctx, void *data );
 };
 
 
@@ -188,6 +192,12 @@ typedef enum
    OPCODE_BLEND_EQUATION,
    OPCODE_BLEND_EQUATION_SEPARATE,
    OPCODE_BLEND_FUNC_SEPARATE,
+
+   OPCODE_BLEND_EQUATION_I,
+   OPCODE_BLEND_EQUATION_SEPARATE_I,
+   OPCODE_BLEND_FUNC_I,
+   OPCODE_BLEND_FUNC_SEPARATE_I,
+
    OPCODE_CALL_LIST,
    OPCODE_CALL_LIST_OFFSET,
    OPCODE_CLEAR,
@@ -381,6 +391,9 @@ typedef enum
    OPCODE_UNIFORM_3UIV,
    OPCODE_UNIFORM_4UIV,
 
+   /* GL_ARB_color_buffer_float */
+   OPCODE_CLAMP_COLOR,
+
    /* GL_EXT_framebuffer_blit */
    OPCODE_BLIT_FRAMEBUFFER,
 
@@ -410,6 +423,41 @@ typedef enum
    /* GL_EXT_transform_feedback */
    OPCODE_BEGIN_TRANSFORM_FEEDBACK,
    OPCODE_END_TRANSFORM_FEEDBACK,
+   OPCODE_BIND_TRANSFORM_FEEDBACK,
+   OPCODE_PAUSE_TRANSFORM_FEEDBACK,
+   OPCODE_RESUME_TRANSFORM_FEEDBACK,
+   OPCODE_DRAW_TRANSFORM_FEEDBACK,
+
+   /* GL_EXT_texture_integer */
+   OPCODE_CLEARCOLOR_I,
+   OPCODE_CLEARCOLOR_UI,
+   OPCODE_TEXPARAMETER_I,
+   OPCODE_TEXPARAMETER_UI,
+
+   /* GL_EXT_separate_shader_objects */
+   OPCODE_ACTIVE_PROGRAM_EXT,
+   OPCODE_USE_SHADER_PROGRAM_EXT,
+
+   /* GL_ARB_instanced_arrays */
+   OPCODE_VERTEX_ATTRIB_DIVISOR,
+
+   /* GL_NV_texture_barrier */
+   OPCODE_TEXTURE_BARRIER_NV,
+
+   /* GL_ARB_sampler_object */
+   OPCODE_BIND_SAMPLER,
+   OPCODE_SAMPLER_PARAMETERIV,
+   OPCODE_SAMPLER_PARAMETERFV,
+   OPCODE_SAMPLER_PARAMETERIIV,
+   OPCODE_SAMPLER_PARAMETERUIV,
+
+   /* GL_ARB_geometry_shader4 */
+   OPCODE_PROGRAM_PARAMETERI,
+   OPCODE_FRAMEBUFFER_TEXTURE,
+   OPCODE_FRAMEBUFFER_TEXTURE_FACE,
+
+   /* GL_ARB_sync */
+   OPCODE_WAIT_SYNC,
 
    /* The following three are meta instructions */
    OPCODE_ERROR,                /* raise compiled-in error */
@@ -451,6 +499,17 @@ union gl_dlist_node
 typedef union gl_dlist_node Node;
 
 
+/**
+ * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
+ * environment.  In 64-bit env, sizeof(Node)==8 anyway.
+ */
+union uint64_pair
+{
+   GLuint64 uint64;
+   GLuint uint32[2];
+};
+
+
 /**
  * How many nodes to allocate at a time.
  *
@@ -497,7 +556,7 @@ make_list(GLuint name, GLuint count)
  * Lookup function to just encapsulate casting.
  */
 static INLINE struct gl_display_list *
-lookup_list(GLcontext *ctx, GLuint list)
+lookup_list(struct gl_context *ctx, GLuint list)
 {
    return (struct gl_display_list *)
       _mesa_HashLookup(ctx->Shared->DisplayList, list);
@@ -514,7 +573,7 @@ is_ext_opcode(OpCode opcode)
 
 /** Destroy an extended opcode instruction */
 static GLint
-ext_opcode_destroy(GLcontext *ctx, Node *node)
+ext_opcode_destroy(struct gl_context *ctx, Node *node)
 {
    const GLint i = node[0].opcode - OPCODE_EXT_0;
    GLint step;
@@ -526,7 +585,7 @@ ext_opcode_destroy(GLcontext *ctx, Node *node)
 
 /** Execute an extended opcode instruction */
 static GLint
-ext_opcode_execute(GLcontext *ctx, Node *node)
+ext_opcode_execute(struct gl_context *ctx, Node *node)
 {
    const GLint i = node[0].opcode - OPCODE_EXT_0;
    GLint step;
@@ -538,7 +597,7 @@ ext_opcode_execute(GLcontext *ctx, Node *node)
 
 /** Print an extended opcode instruction */
 static GLint
-ext_opcode_print(GLcontext *ctx, Node *node)
+ext_opcode_print(struct gl_context *ctx, Node *node)
 {
    const GLint i = node[0].opcode - OPCODE_EXT_0;
    GLint step;
@@ -553,7 +612,7 @@ ext_opcode_print(GLcontext *ctx, Node *node)
  * \param dlist - display list pointer
  */
 void
-_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist)
+_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
 {
    Node *n, *block;
    GLboolean done;
@@ -731,7 +790,7 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist)
  * \param list - display list number
  */
 static void
-destroy_list(GLcontext *ctx, GLuint list)
+destroy_list(struct gl_context *ctx, GLuint list)
 {
    struct gl_display_list *dlist;
 
@@ -815,7 +874,7 @@ translate_id(GLsizei n, GLenum type, const GLvoid * list)
  * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
  */
 static GLvoid *
-unpack_image(GLcontext *ctx, GLuint dimensions,
+unpack_image(struct gl_context *ctx, GLuint dimensions,
              GLsizei width, GLsizei height, GLsizei depth,
              GLenum format, GLenum type, const GLvoid * pixels,
              const struct gl_pixelstore_attrib *unpack)
@@ -829,8 +888,8 @@ unpack_image(GLcontext *ctx, GLuint dimensions,
       }
       return image;
    }
-   else if (_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
-                                      format, type, pixels)) {
+   else if (_mesa_validate_pbo_access(dimensions, unpack, width, height,
+                                      depth, format, type, INT_MAX, pixels)) {
       const GLubyte *map, *src;
       GLvoid *image;
 
@@ -867,7 +926,7 @@ unpack_image(GLcontext *ctx, GLuint dimensions,
  * \return pointer to allocated memory (the opcode space)
  */
 static Node *
-dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes)
+dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes)
 {
    const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
    Node *n;
@@ -918,7 +977,7 @@ dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes)
  *         opcode).
  */
 void *
-_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes)
+_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint bytes)
 {
    Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes);
    if (n)
@@ -939,11 +998,11 @@ _mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes)
  * \return  the new opcode number or -1 if error
  */
 GLint
-_mesa_dlist_alloc_opcode(GLcontext *ctx,
+_mesa_dlist_alloc_opcode(struct gl_context *ctx,
                          GLuint size,
-                         void (*execute) (GLcontext *, void *),
-                         void (*destroy) (GLcontext *, void *),
-                         void (*print) (GLcontext *, void *))
+                         void (*execute) (struct gl_context *, void *),
+                         void (*destroy) (struct gl_context *, void *),
+                         void (*print) (struct gl_context *, void *))
 {
    if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) {
       const GLuint i = ctx->ListExt->NumOpcodes++;
@@ -968,7 +1027,7 @@ _mesa_dlist_alloc_opcode(GLcontext *ctx,
  * \return  pointer to start of instruction space
  */
 static INLINE Node *
-alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams)
+alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
 {
    return dlist_alloc(ctx, opcode, nparams * sizeof(Node));
 }
@@ -1133,7 +1192,83 @@ save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
    }
 }
 
-static void invalidate_saved_current_state( GLcontext *ctx )
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
+                        GLenum sfactorA, GLenum dfactorA)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 5);
+   if (n) {
+      n[1].ui = buf;
+      n[2].e = sfactorRGB;
+      n[3].e = dfactorRGB;
+      n[4].e = sfactorA;
+      n[5].e = dfactorA;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BlendFuncSeparateiARB(ctx->Exec, (buf, sfactorRGB, dfactorRGB,
+                                             sfactorA, dfactorA));
+   }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 3);
+   if (n) {
+      n[1].ui = buf;
+      n[2].e = sfactor;
+      n[3].e = dfactor;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BlendFunciARB(ctx->Exec, (buf, sfactor, dfactor));
+   }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendEquationi(GLuint buf, GLenum mode)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_I, 2);
+   if (n) {
+      n[1].ui = buf;
+      n[2].e = mode;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BlendEquationiARB(ctx->Exec, (buf, mode));
+   }
+}
+
+/* GL_ARB_draw_buffers_blend */
+static void GLAPIENTRY
+save_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE_I, 3);
+   if (n) {
+      n[1].ui = buf;
+      n[2].e = modeRGB;
+      n[3].e = modeA;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BlendEquationSeparateiARB(ctx->Exec, (buf, modeRGB, modeA));
+   }
+}
+
+
+static void invalidate_saved_current_state( struct gl_context *ctx )
 {
    GLint i;
 
@@ -1552,7 +1687,6 @@ save_ColorTableParameterfv(GLenum target, GLenum pname,
       n[3].f = params[0];
       if (pname == GL_COLOR_TABLE_SGI ||
           pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
-          pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI ||
           pname == GL_TEXTURE_COLOR_TABLE_SGI) {
          n[4].f = params[1];
          n[5].f = params[2];
@@ -1581,7 +1715,6 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
       n[3].i = params[0];
       if (pname == GL_COLOR_TABLE_SGI ||
           pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI ||
-          pname == GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI ||
           pname == GL_TEXTURE_COLOR_TABLE_SGI) {
          n[4].i = params[1];
          n[5].i = params[2];
@@ -4776,9 +4909,9 @@ save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
 
 static void GLAPIENTRY
 save_ProgramParameters4dvNV(GLenum target, GLuint index,
-                            GLuint num, const GLdouble *params)
+                            GLsizei num, const GLdouble *params)
 {
-   GLuint i;
+   GLint i;
    for (i = 0; i < num; i++) {
       save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i);
    }
@@ -4787,9 +4920,9 @@ save_ProgramParameters4dvNV(GLenum target, GLuint index,
 
 static void GLAPIENTRY
 save_ProgramParameters4fvNV(GLenum target, GLuint index,
-                            GLuint num, const GLfloat *params)
+                            GLsizei num, const GLfloat *params)
 {
-   GLuint i;
+   GLint i;
    for (i = 0; i < num; i++) {
       save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i);
    }
@@ -5247,7 +5380,7 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
 }
 #endif
 
-static void
+static void GLAPIENTRY
 save_Attr1fNV(GLenum attr, GLfloat x)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5268,7 +5401,7 @@ save_Attr1fNV(GLenum attr, GLfloat x)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5290,7 +5423,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5313,7 +5446,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5338,7 +5471,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 }
 
 
-static void
+static void GLAPIENTRY
 save_Attr1fARB(GLenum attr, GLfloat x)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5359,7 +5492,7 @@ save_Attr1fARB(GLenum attr, GLfloat x)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5381,7 +5514,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -5404,7 +5537,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
    }
 }
 
-static void
+static void GLAPIENTRY
 save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -6159,6 +6292,69 @@ save_EndTransformFeedback(void)
    }
 }
 
+static void GLAPIENTRY
+save_TransformFeedbackVaryings(GLuint program, GLsizei count,
+                               const GLchar **varyings, GLenum bufferMode)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   _mesa_problem(ctx,
+                 "glTransformFeedbackVarying() display list support not done");
+}
+
+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));
+   }
+}
+
 
 /* aka UseProgram() */
 static void GLAPIENTRY
@@ -6789,6 +6985,391 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
    }
 }
 
+static void GLAPIENTRY
+save_ClampColorARB(GLenum target, GLenum clamp)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_CLAMP_COLOR, 2);
+   if (n) {
+      n[1].e = target;
+      n[2].e = clamp;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ClampColorARB(ctx->Exec, (target, clamp));
+   }
+}
+
+static void GLAPIENTRY
+save_UseShaderProgramEXT(GLenum type, GLuint program)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_USE_SHADER_PROGRAM_EXT, 2);
+   if (n) {
+      n[1].ui = type;
+      n[2].ui = program;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_UseShaderProgramEXT(ctx->Exec, (type, program));
+   }
+}
+
+static void GLAPIENTRY
+save_ActiveProgramEXT(GLuint program)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_ACTIVE_PROGRAM_EXT, 1);
+   if (n) {
+      n[1].ui = program;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ActiveProgramEXT(ctx->Exec, (program));
+   }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_ClearColorIi(GLint red, GLint green, GLint blue, GLint alpha)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_I, 4);
+   if (n) {
+      n[1].i = red;
+      n[2].i = green;
+      n[3].i = blue;
+      n[4].i = alpha;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ClearColorIiEXT(ctx->Exec, (red, green, blue, alpha));
+   }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_ClearColorIui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_UI, 4);
+   if (n) {
+      n[1].ui = red;
+      n[2].ui = green;
+      n[3].ui = blue;
+      n[4].ui = alpha;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ClearColorIuiEXT(ctx->Exec, (red, green, blue, alpha));
+   }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_I, 6);
+   if (n) {
+      n[1].e = target;
+      n[2].e = pname;
+      n[3].i = params[0];
+      n[4].i = params[1];
+      n[5].i = params[2];
+      n[6].i = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_TexParameterIivEXT(ctx->Exec, (target, pname, params));
+   }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+save_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_UI, 6);
+   if (n) {
+      n[1].e = target;
+      n[2].e = pname;
+      n[3].ui = params[0];
+      n[4].ui = params[1];
+      n[5].ui = params[2];
+      n[6].ui = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_TexParameterIuivEXT(ctx->Exec, (target, pname, params));
+   }
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+exec_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+   CALL_GetTexParameterIivEXT(ctx->Exec, (target, pname, params));
+}
+
+/** GL_EXT_texture_integer */
+static void GLAPIENTRY
+exec_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   FLUSH_VERTICES(ctx, 0);
+   CALL_GetTexParameterIuivEXT(ctx->Exec, (target, pname, params));
+}
+
+
+/* GL_ARB_instanced_arrays */
+static void GLAPIENTRY
+save_VertexAttribDivisor(GLuint index, GLuint divisor)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2);
+   if (n) {
+      n[1].ui = index;
+      n[2].ui = divisor;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_VertexAttribDivisorARB(ctx->Exec, (index, divisor));
+   }
+}
+
+
+/* GL_NV_texture_barrier */
+static void GLAPIENTRY
+save_TextureBarrierNV(void)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0);
+   if (ctx->ExecuteFlag) {
+      CALL_TextureBarrierNV(ctx->Exec, ());
+   }
+}
+
+
+/* GL_ARB_sampler_objects */
+static void GLAPIENTRY
+save_BindSampler(GLuint unit, GLuint sampler)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
+   if (n) {
+      n[1].ui = unit;
+      n[2].ui = sampler;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_BindSampler(ctx->Exec, (unit, sampler));
+   }
+}
+
+static void GLAPIENTRY
+save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIV, 6);
+   if (n) {
+      n[1].ui = sampler;
+      n[2].e = pname;
+      n[3].i = params[0];
+      if (pname == GL_TEXTURE_BORDER_COLOR) {
+         n[4].i = params[1];
+         n[5].i = params[2];
+         n[6].i = params[3];
+      }
+      else {
+         n[4].i = n[5].i = n[6].i = 0;
+      }
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_SamplerParameteriv(ctx->Exec, (sampler, pname, params));
+   }
+}
+
+static void GLAPIENTRY
+save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+   save_SamplerParameteriv(sampler, pname, &param);
+}
+
+static void GLAPIENTRY
+save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERFV, 6);
+   if (n) {
+      n[1].ui = sampler;
+      n[2].e = pname;
+      n[3].f = params[0];
+      if (pname == GL_TEXTURE_BORDER_COLOR) {
+         n[4].f = params[1];
+         n[5].f = params[2];
+         n[6].f = params[3];
+      }
+      else {
+         n[4].f = n[5].f = n[6].f = 0.0F;
+      }
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_SamplerParameterfv(ctx->Exec, (sampler, pname, params));
+   }
+}
+
+static void GLAPIENTRY
+save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+   save_SamplerParameterfv(sampler, pname, &param);
+}
+
+static void GLAPIENTRY
+save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIIV, 6);
+   if (n) {
+      n[1].ui = sampler;
+      n[2].e = pname;
+      n[3].i = params[0];
+      if (pname == GL_TEXTURE_BORDER_COLOR) {
+         n[4].i = params[1];
+         n[5].i = params[2];
+         n[6].i = params[3];
+      }
+      else {
+         n[4].i = n[5].i = n[6].i = 0;
+      }
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_SamplerParameterIiv(ctx->Exec, (sampler, pname, params));
+   }
+}
+
+static void GLAPIENTRY
+save_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERUIV, 6);
+   if (n) {
+      n[1].ui = sampler;
+      n[2].e = pname;
+      n[3].ui = params[0];
+      if (pname == GL_TEXTURE_BORDER_COLOR) {
+         n[4].ui = params[1];
+         n[5].ui = params[2];
+         n[6].ui = params[3];
+      }
+      else {
+         n[4].ui = n[5].ui = n[6].ui = 0;
+      }
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_SamplerParameterIuiv(ctx->Exec, (sampler, pname, params));
+   }
+}
+
+/* GL_ARB_geometry_shader4 */
+static void GLAPIENTRY
+save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_PROGRAM_PARAMETERI, 3);
+   if (n) {
+      n[1].ui = program;
+      n[2].e = pname;
+      n[3].i = value;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_ProgramParameteriARB(ctx->Exec, (program, pname, value));
+   }
+}
+
+static void GLAPIENTRY
+save_FramebufferTexture(GLenum target, GLenum attachment,
+                        GLuint texture, GLint level)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_FRAMEBUFFER_TEXTURE, 4);
+   if (n) {
+      n[1].e = target;
+      n[2].e = attachment;
+      n[3].ui = texture;
+      n[4].i = level;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_FramebufferTextureARB(ctx->Exec, (target, attachment, texture, level));
+   }
+}
+
+static void GLAPIENTRY
+save_FramebufferTextureFace(GLenum target, GLenum attachment,
+                            GLuint texture, GLint level, GLenum face)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_FRAMEBUFFER_TEXTURE_FACE, 5);
+   if (n) {
+      n[1].e = target;
+      n[2].e = attachment;
+      n[3].ui = texture;
+      n[4].i = level;
+      n[5].e = face;
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_FramebufferTextureFaceARB(ctx->Exec, (target, attachment, texture,
+                                                 level, face));
+   }
+}
+
+
+
+static void GLAPIENTRY
+save_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+   Node *n;
+   GET_CURRENT_CONTEXT(ctx);
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_WAIT_SYNC, 4);
+   if (n) {
+      union uint64_pair p;
+      p.uint64 = timeout;
+      n[1].data = sync;
+      n[2].e = flags;
+      n[3].ui = p.uint32[0];
+      n[4].ui = p.uint32[1];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_WaitSync(ctx->Exec, (sync, flags, timeout));
+   }
+}
 
 
 /**
@@ -6798,7 +7379,7 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
  * command that provoked the error.  I don't see this as a problem.
  */
 static void
-save_error(GLcontext *ctx, GLenum error, const char *s)
+save_error(struct gl_context *ctx, GLenum error, const char *s)
 {
    Node *n;
    n = alloc_instruction(ctx, OPCODE_ERROR, 2);
@@ -6813,7 +7394,7 @@ save_error(GLcontext *ctx, GLenum error, const char *s)
  * Compile an error into current display list.
  */
 void
-_mesa_compile_error(GLcontext *ctx, GLenum error, const char *s)
+_mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
 {
    if (ctx->CompileFlag)
       save_error(ctx, error, s);
@@ -6826,7 +7407,7 @@ _mesa_compile_error(GLcontext *ctx, GLenum error, const char *s)
  * Test if ID names a display list.
  */
 static GLboolean
-islist(GLcontext *ctx, GLuint list)
+islist(struct gl_context *ctx, GLuint list)
 {
    if (list > 0 && lookup_list(ctx, list)) {
       return GL_TRUE;
@@ -6850,7 +7431,7 @@ islist(GLcontext *ctx, GLuint list)
  * \param list - display list number
  */
 static void
-execute_list(GLcontext *ctx, GLuint list)
+execute_list(struct gl_context *ctx, GLuint list)
 {
    struct gl_display_list *dlist;
    Node *n;
@@ -6919,6 +7500,26 @@ execute_list(GLcontext *ctx, GLuint list)
             CALL_BlendFuncSeparateEXT(ctx->Exec,
                                       (n[1].e, n[2].e, n[3].e, n[4].e));
             break;
+
+         case OPCODE_BLEND_FUNC_I:
+            /* GL_ARB_draw_buffers_blend */
+            CALL_BlendFunciARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e));
+            break;
+         case OPCODE_BLEND_FUNC_SEPARATE_I:
+            /* GL_ARB_draw_buffers_blend */
+            CALL_BlendFuncSeparateiARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e,
+                                                   n[4].e, n[5].e));
+            break;
+         case OPCODE_BLEND_EQUATION_I:
+            /* GL_ARB_draw_buffers_blend */
+            CALL_BlendEquationiARB(ctx->Exec, (n[1].ui, n[2].e));
+            break;
+         case OPCODE_BLEND_EQUATION_SEPARATE_I:
+            /* GL_ARB_draw_buffers_blend */
+            CALL_BlendEquationSeparateiARB(ctx->Exec,
+                                           (n[1].ui, n[2].e, n[3].e));
+            break;
+
          case OPCODE_CALL_LIST:
             /* Generated by glCallList(), don't add ListBase */
             if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
@@ -6941,32 +7542,32 @@ execute_list(GLcontext *ctx, GLuint list)
             break;
          case OPCODE_CLEAR_BUFFER_IV:
             {
-               GLint value[4];
+               /*GLint value[4];
                value[0] = n[3].i;
                value[1] = n[4].i;
                value[2] = n[5].i;
                value[3] = n[6].i;
-               /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+               CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
             }
             break;
          case OPCODE_CLEAR_BUFFER_UIV:
             {
-               GLuint value[4];
+               /*GLuint value[4];
                value[0] = n[3].ui;
                value[1] = n[4].ui;
                value[2] = n[5].ui;
                value[3] = n[6].ui;
-               /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+               CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
             }
             break;
          case OPCODE_CLEAR_BUFFER_FV:
             {
-               GLfloat value[4];
+               /*GLfloat value[4];
                value[0] = n[3].f;
                value[1] = n[4].f;
                value[2] = n[5].f;
                value[3] = n[6].f;
-               /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
+               CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
             }
             break;
          case OPCODE_CLEAR_BUFFER_FI:
@@ -7398,12 +7999,6 @@ execute_list(GLcontext *ctx, GLuint list)
          case OPCODE_PROVOKING_VERTEX:
             CALL_ProvokingVertexEXT(ctx->Exec, (n[1].e));
             break;
-         case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
-            CALL_BeginTransformFeedbackEXT(ctx->Exec, (n[1].e));
-            break;
-         case OPCODE_END_TRANSFORM_FEEDBACK:
-            CALL_EndTransformFeedbackEXT(ctx->Exec, ());
-            break;
          case OPCODE_STENCIL_FUNC:
             CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui));
             break;
@@ -7676,6 +8271,12 @@ execute_list(GLcontext *ctx, GLuint list)
         case OPCODE_USE_PROGRAM:
            CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui));
            break;
+        case OPCODE_USE_SHADER_PROGRAM_EXT:
+           CALL_UseShaderProgramEXT(ctx->Exec, (n[1].ui, n[2].ui));
+           break;
+        case OPCODE_ACTIVE_PROGRAM_EXT:
+           CALL_ActiveProgramEXT(ctx->Exec, (n[1].ui));
+           break;
         case OPCODE_UNIFORM_1F:
            CALL_Uniform1fARB(ctx->Exec, (n[1].i, n[2].f));
            break;
@@ -7789,6 +8390,10 @@ execute_list(GLcontext *ctx, GLuint list)
                                     (n[1].i, n[2].i, n[3].b, n[4].data));
            break;
 
+         case OPCODE_CLAMP_COLOR:
+            CALL_ClampColorARB(ctx->Exec, (n[1].e, n[2].e));
+            break;
+
          case OPCODE_TEX_BUMP_PARAMETER_ATI:
             {
                GLfloat values[4];
@@ -7906,6 +8511,132 @@ execute_list(GLcontext *ctx, GLuint list)
             CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
             break;
 
+         /* GL_EXT_texture_integer */
+         case OPCODE_CLEARCOLOR_I:
+            CALL_ClearColorIiEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
+            break;
+         case OPCODE_CLEARCOLOR_UI:
+            CALL_ClearColorIuiEXT(ctx->Exec,
+                                  (n[1].ui, n[2].ui, n[3].ui, n[4].ui));
+            break;
+         case OPCODE_TEXPARAMETER_I:
+            {
+               GLint params[4];
+               params[0] = n[3].i;
+               params[1] = n[4].i;
+               params[2] = n[5].i;
+               params[3] = n[6].i;
+               CALL_TexParameterIivEXT(ctx->Exec, (n[1].e, n[2].e, params));
+            }
+            break;
+         case OPCODE_TEXPARAMETER_UI:
+            {
+               GLuint params[4];
+               params[0] = n[3].ui;
+               params[1] = n[4].ui;
+               params[2] = n[5].ui;
+               params[3] = n[6].ui;
+               CALL_TexParameterIuivEXT(ctx->Exec, (n[1].e, n[2].e, params));
+            }
+            break;
+
+         case OPCODE_VERTEX_ATTRIB_DIVISOR:
+            /* GL_ARB_instanced_arrays */
+            CALL_VertexAttribDivisorARB(ctx->Exec, (n[1].ui, n[2].ui));
+            break;
+
+         case OPCODE_TEXTURE_BARRIER_NV:
+            CALL_TextureBarrierNV(ctx->Exec, ());
+            break;
+
+         /* GL_EXT/ARB_transform_feedback */
+         case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
+            CALL_BeginTransformFeedbackEXT(ctx->Exec, (n[1].e));
+            break;
+         case OPCODE_END_TRANSFORM_FEEDBACK:
+            CALL_EndTransformFeedbackEXT(ctx->Exec, ());
+            break;
+         case OPCODE_BIND_TRANSFORM_FEEDBACK:
+            CALL_BindTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
+            break;
+         case OPCODE_PAUSE_TRANSFORM_FEEDBACK:
+            CALL_PauseTransformFeedback(ctx->Exec, ());
+            break;
+         case OPCODE_RESUME_TRANSFORM_FEEDBACK:
+            CALL_ResumeTransformFeedback(ctx->Exec, ());
+            break;
+         case OPCODE_DRAW_TRANSFORM_FEEDBACK:
+            CALL_DrawTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
+            break;
+
+
+         case OPCODE_BIND_SAMPLER:
+            CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
+            break;
+         case OPCODE_SAMPLER_PARAMETERIV:
+            {
+               GLint params[4];
+               params[0] = n[3].i;
+               params[1] = n[4].i;
+               params[2] = n[5].i;
+               params[3] = n[6].i;
+               CALL_SamplerParameteriv(ctx->Exec, (n[1].ui, n[2].e, params));
+            }
+            break;
+         case OPCODE_SAMPLER_PARAMETERFV:
+            {
+               GLfloat params[4];
+               params[0] = n[3].f;
+               params[1] = n[4].f;
+               params[2] = n[5].f;
+               params[3] = n[6].f;
+               CALL_SamplerParameterfv(ctx->Exec, (n[1].ui, n[2].e, params));
+            }
+            break;
+         case OPCODE_SAMPLER_PARAMETERIIV:
+            {
+               GLint params[4];
+               params[0] = n[3].i;
+               params[1] = n[4].i;
+               params[2] = n[5].i;
+               params[3] = n[6].i;
+               CALL_SamplerParameterIiv(ctx->Exec, (n[1].ui, n[2].e, params));
+            }
+            break;
+         case OPCODE_SAMPLER_PARAMETERUIV:
+            {
+               GLuint params[4];
+               params[0] = n[3].ui;
+               params[1] = n[4].ui;
+               params[2] = n[5].ui;
+               params[3] = n[6].ui;
+               CALL_SamplerParameterIuiv(ctx->Exec, (n[1].ui, n[2].e, params));
+            }
+            break;
+
+         /* GL_ARB_geometry_shader4 */
+         case OPCODE_PROGRAM_PARAMETERI:
+            CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
+            break;
+         case OPCODE_FRAMEBUFFER_TEXTURE:
+            CALL_FramebufferTextureARB(ctx->Exec, (n[1].e, n[2].e,
+                                                   n[3].ui, n[4].i));
+            break;
+         case OPCODE_FRAMEBUFFER_TEXTURE_FACE:
+            CALL_FramebufferTextureFaceARB(ctx->Exec, (n[1].e, n[2].e,
+                                                       n[3].ui, n[4].i, n[5].e));
+            break;
+
+         /* GL_ARB_sync */
+         case OPCODE_WAIT_SYNC:
+            {
+               union uint64_pair p;
+               p.uint32[0] = n[3].ui;
+               p.uint32[1] = n[4].ui;
+               CALL_WaitSync(ctx->Exec, (n[1].data, n[2].bf, p.uint64));
+            }
+            break;
+
          case OPCODE_CONTINUE:
             n = (Node *) n[1].next;
             break;
@@ -8119,8 +8850,6 @@ _mesa_CallList(GLuint list)
    GLboolean save_compile_flag;
    GET_CURRENT_CONTEXT(ctx);
    FLUSH_CURRENT(ctx, 0);
-   /* VERY IMPORTANT:  Save the CompileFlag status, turn it off, */
-   /* execute the display list, and restore the CompileFlag. */
 
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glCallList %d\n", list);
@@ -8130,8 +8859,12 @@ _mesa_CallList(GLuint list)
       return;
    }
 
-/*     mesa_print_display_list( list ); */
+   if (0)
+      mesa_print_display_list( list );
 
+   /* VERY IMPORTANT:  Save the CompileFlag status, turn it off,
+    * execute the display list, and restore the CompileFlag.
+    */
    save_compile_flag = ctx->CompileFlag;
    if (save_compile_flag) {
       ctx->CompileFlag = GL_FALSE;
@@ -8942,7 +9675,7 @@ _mesa_create_save_table(void)
 {
    struct _glapi_table *table;
 
-   table = _mesa_alloc_dispatch_table(sizeof *table);
+   table = _mesa_alloc_dispatch_table(_gloffset_COUNT);
    if (table == NULL)
       return NULL;
 
@@ -9370,6 +10103,10 @@ _mesa_create_save_table(void)
    SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE);
    SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE);
 
+   /* GL_ARB_vertex_array_object */
+   SET_BindVertexArray(table, _mesa_BindVertexArray);
+   SET_GenVertexArrays(table, _mesa_GenVertexArrays);
+
    /* ???. GL_EXT_depth_bounds_test */
    SET_DepthBoundsEXT(table, save_DepthBoundsEXT);
 
@@ -9413,9 +10150,9 @@ _mesa_create_save_table(void)
    SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
    SET_GenProgramsNV(table, _mesa_GenPrograms);
    SET_IsProgramNV(table, _mesa_IsProgramARB);
-   SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
-   SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
-   SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
+   SET_GetVertexAttribdvARB(table, _mesa_GetVertexAttribdvARB);
+   SET_GetVertexAttribfvARB(table, _mesa_GetVertexAttribfvARB);
+   SET_GetVertexAttribivARB(table, _mesa_GetVertexAttribivARB);
    SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
    SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
    SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
@@ -9452,15 +10189,11 @@ _mesa_create_save_table(void)
 #endif
 
 #if FEATURE_queryobj
+   _mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */
    SET_BeginQueryARB(table, save_BeginQueryARB);
    SET_EndQueryARB(table, save_EndQueryARB);
-   SET_GenQueriesARB(table, _mesa_GenQueriesARB);
-   SET_DeleteQueriesARB(table, _mesa_DeleteQueriesARB);
-   SET_IsQueryARB(table, _mesa_IsQueryARB);
-   SET_GetQueryivARB(table, _mesa_GetQueryivARB);
-   SET_GetQueryObjectivARB(table, _mesa_GetQueryObjectivARB);
-   SET_GetQueryObjectuivARB(table, _mesa_GetQueryObjectuivARB);
 #endif
+
    SET_DrawBuffersARB(table, save_DrawBuffersARB);
 
 #if FEATURE_EXT_framebuffer_blit
@@ -9468,6 +10201,7 @@ _mesa_create_save_table(void)
 #endif
 
    /* GL_ARB_shader_objects */
+   _mesa_init_shader_dispatch(table); /* Plug in glCreate/Delete/Get, etc */
    SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
    SET_Uniform1fARB(table, save_Uniform1fARB);
    SET_Uniform2fARB(table, save_Uniform2fARB);
@@ -9519,12 +10253,6 @@ _mesa_create_save_table(void)
    /* ARB 59. GL_ARB_copy_buffer */
    SET_CopyBufferSubData(table, _mesa_CopyBufferSubData); /* no dlist save */
 
-   /* 352. GL_EXT_transform_feedback */
-#if FEATURE_EXT_transform_feedback
-   SET_BeginTransformFeedbackEXT(table, save_BeginTransformFeedback);
-   SET_EndTransformFeedbackEXT(table, save_EndTransformFeedback);
-#endif
-
    /* 364. GL_EXT_provoking_vertex */
    SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT);
 
@@ -9532,14 +10260,31 @@ _mesa_create_save_table(void)
 #if FEATURE_APPLE_object_purgeable
    SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE);
    SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE);
+   SET_GetObjectParameterivAPPLE(table, _mesa_GetObjectParameterivAPPLE);
 #endif
 
+   /* GL_EXT_texture_integer */
+   SET_ClearColorIiEXT(table, save_ClearColorIi);
+   SET_ClearColorIuiEXT(table, save_ClearColorIui);
+   SET_TexParameterIivEXT(table, save_TexParameterIiv);
+   SET_TexParameterIuivEXT(table, save_TexParameterIuiv);
+   SET_GetTexParameterIivEXT(table, exec_GetTexParameterIiv);
+   SET_GetTexParameterIuivEXT(table, exec_GetTexParameterIuiv);
+
+   /* 377. GL_EXT_separate_shader_objects */
+   SET_UseShaderProgramEXT(table, save_UseShaderProgramEXT);
+   SET_ActiveProgramEXT(table, save_ActiveProgramEXT);
+
+   /* GL_ARB_color_buffer_float */
+   SET_ClampColorARB(table, save_ClampColorARB);
+   SET_ClampColor(table, save_ClampColorARB);
+
    /* GL 3.0 */
-#if 0
    SET_ClearBufferiv(table, save_ClearBufferiv);
    SET_ClearBufferuiv(table, save_ClearBufferuiv);
    SET_ClearBufferfv(table, save_ClearBufferfv);
    SET_ClearBufferfi(table, save_ClearBufferfi);
+#if 0
    SET_Uniform1ui(table, save_Uniform1ui);
    SET_Uniform2ui(table, save_Uniform2ui);
    SET_Uniform3ui(table, save_Uniform3ui);
@@ -9549,10 +10294,6 @@ _mesa_create_save_table(void)
    SET_Uniform3uiv(table, save_Uniform3uiv);
    SET_Uniform4uiv(table, save_Uniform4uiv);
 #else
-   (void) save_ClearBufferiv;
-   (void) save_ClearBufferuiv;
-   (void) save_ClearBufferfv;
-   (void) save_ClearBufferfi;
    (void) save_Uniform1ui;
    (void) save_Uniform2ui;
    (void) save_Uniform3ui;
@@ -9563,6 +10304,47 @@ _mesa_create_save_table(void)
    (void) save_Uniform4uiv;
 #endif
 
+#if FEATURE_EXT_transform_feedback
+   SET_BeginTransformFeedbackEXT(table, save_BeginTransformFeedback);
+   SET_EndTransformFeedbackEXT(table, save_EndTransformFeedback);
+   SET_TransformFeedbackVaryingsEXT(table, save_TransformFeedbackVaryings);
+   SET_BindTransformFeedback(table, save_BindTransformFeedback);
+   SET_PauseTransformFeedback(table, save_PauseTransformFeedback);
+   SET_ResumeTransformFeedback(table, save_ResumeTransformFeedback);
+   SET_DrawTransformFeedback(table, save_DrawTransformFeedback);
+#endif
+
+   /* GL_ARB_instanced_arrays */
+   SET_VertexAttribDivisorARB(table, save_VertexAttribDivisor);
+
+   /* GL_NV_texture_barrier */
+   SET_TextureBarrierNV(table, save_TextureBarrierNV);
+
+   /* GL_ARB_sampler_objects */
+   _mesa_init_sampler_object_dispatch(table); /* plug in Gen/Get/etc functions */
+   SET_BindSampler(table, save_BindSampler);
+   SET_SamplerParameteri(table, save_SamplerParameteri);
+   SET_SamplerParameterf(table, save_SamplerParameterf);
+   SET_SamplerParameteriv(table, save_SamplerParameteriv);
+   SET_SamplerParameterfv(table, save_SamplerParameterfv);
+   SET_SamplerParameterIiv(table, save_SamplerParameterIiv);
+   SET_SamplerParameterIuiv(table, save_SamplerParameterIuiv);
+
+   /* GL_ARB_draw_buffer_blend */
+   SET_BlendFunciARB(table, save_BlendFunci);
+   SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
+   SET_BlendEquationiARB(table, save_BlendEquationi);
+   SET_BlendEquationSeparateiARB(table, save_BlendEquationSeparatei);
+
+   /* GL_ARB_geometry_shader4 */
+   SET_ProgramParameteriARB(table, save_ProgramParameteri);
+   SET_FramebufferTextureARB(table, save_FramebufferTexture);
+   SET_FramebufferTextureFaceARB(table, save_FramebufferTextureFace);
+
+   /* GL_ARB_sync */
+   _mesa_init_sync_dispatch(table);
+   SET_WaitSync(table, save_WaitSync);
+
    return table;
 }
 
@@ -9580,7 +10362,7 @@ enum_string(GLenum k)
  * TODO: many commands aren't handled yet.
  */
 static void GLAPIENTRY
-print_list(GLcontext *ctx, GLuint list)
+print_list(struct gl_context *ctx, GLuint list)
 {
    struct gl_display_list *dlist;
    Node *n;
@@ -9972,7 +10754,7 @@ void _mesa_init_dlist_dispatch(struct _glapi_table *disp)
  * Initialize display list state for given context.
  */
 void
-_mesa_init_display_list(GLcontext *ctx)
+_mesa_init_display_list(struct gl_context *ctx)
 {
    static GLboolean tableInitialized = GL_FALSE;
 
@@ -10002,7 +10784,7 @@ _mesa_init_display_list(GLcontext *ctx)
 
 
 void
-_mesa_free_display_list_data(GLcontext *ctx)
+_mesa_free_display_list_data(struct gl_context *ctx)
 {
    free(ctx->ListExt);
    ctx->ListExt = NULL;