fix for bug#10182
[mesa.git] / src / mesa / main / dlist.c
index 7682ce96a0e3d1629bd729aae2f45f5e7c3b713c..49bc2933bf56635758cdda3b42bb5d60ed79794a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  6.5.1
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
@@ -43,6 +43,7 @@
 #if FEATURE_ARB_vertex_buffer_object
 #include "bufferobj.h"
 #endif
+#include "arrayobj.h"
 #include "clip.h"
 #include "colormac.h"
 #include "colortab.h"
@@ -342,8 +343,6 @@ typedef enum
    OPCODE_ATTR_3F_ARB,
    OPCODE_ATTR_4F_ARB,
    OPCODE_MATERIAL,
-   OPCODE_INDEX,
-   OPCODE_EDGEFLAG,
    OPCODE_BEGIN,
    OPCODE_END,
    OPCODE_RECTF,
@@ -427,27 +426,28 @@ make_list(GLuint list, GLuint count)
 }
 
 
+/**
+ * Lookup function to just encapsulate casting.
+ */
+static INLINE struct mesa_display_list *
+lookup_list(GLcontext *ctx, GLuint list)
+{
+   return (struct mesa_display_list *)
+      _mesa_HashLookup(ctx->Shared->DisplayList, list);
+}
+
+
 
 /**
- * Destroy all nodes in a display list.
- * \param list - display list number
+ * Delete the named display list, but don't remove from hash table.
+ * \param dlist - display list pointer
  */
 void
-_mesa_destroy_list(GLcontext *ctx, GLuint list)
+_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
 {
-   struct mesa_display_list *dlist;
    Node *n, *block;
    GLboolean done;
 
-   if (list == 0)
-      return;
-
-   dlist =
-      (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
-                                                    list);
-   if (!dlist)
-      return;
-
    n = block = dlist->node;
 
    done = block ? GL_FALSE : GL_TRUE;
@@ -587,10 +587,29 @@ _mesa_destroy_list(GLcontext *ctx, GLuint list)
    }
 
    _mesa_free(dlist);
-   _mesa_HashRemove(ctx->Shared->DisplayList, list);
 }
 
 
+/**
+ * Destroy a display list and remove from hash table.
+ * \param list - display list number
+ */
+static void
+destroy_list(GLcontext *ctx, GLuint list)
+{
+   struct mesa_display_list *dlist;
+
+   if (list == 0)
+      return;
+
+   dlist = lookup_list(ctx, list);
+   if (!dlist)
+      return;
+
+   _mesa_delete_list(ctx, dlist);
+   _mesa_HashRemove(ctx->Shared->DisplayList, list);
+}
+
 
 /*
  * Translate the nth element of list from type to GLuint.
@@ -4446,6 +4465,38 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+static void GLAPIENTRY
+save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+                                 const GLfloat *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+   if (count > 0) {
+      GLint i;
+      const GLfloat * p = params;
+
+      for (i = 0 ; i < count ; i++) {
+        n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+        if (n) {
+           n[1].e = target;
+           n[2].ui = index;
+           n[3].f = p[0];
+           n[4].f = p[1];
+           n[5].f = p[2];
+           n[6].f = p[3];
+           p += 4;
+        }
+      }
+   }
+
+   if (ctx->ExecuteFlag) {
+      CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params));
+   }
+}
+
+
 static void GLAPIENTRY
 save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
                                 GLdouble x, GLdouble y,
@@ -4648,6 +4699,38 @@ save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+static void GLAPIENTRY
+save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+                               const GLfloat * params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+   if (count > 0) {
+      GLint i;
+      const GLfloat * p = params;
+
+      for (i = 0 ; i < count ; i++) {
+        n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+        if (n) {
+           n[1].e = target;
+           n[2].ui = index;
+           n[3].f = p[0];
+           n[4].f = p[1];
+           n[5].f = p[2];
+           n[6].f = p[3];
+           p += 4;
+        }
+      }
+   }
+
+   if (ctx->ExecuteFlag) {
+      CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
+   }
+}
+
+
 static void GLAPIENTRY
 save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
                               GLdouble x, GLdouble y, GLdouble z, GLdouble w)
@@ -4671,7 +4754,7 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
 
 
-#ifdef FEATURE_ARB_occlusion_query
+#if FEATURE_ARB_occlusion_query
 
 static void GLAPIENTRY
 save_BeginQueryARB(GLenum target, GLuint id)
@@ -4777,7 +4860,7 @@ save_Attr1fNV(GLenum attr, GLfloat x)
       n[2].f = x;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 1;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
 
@@ -4799,7 +4882,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
       n[3].f = y;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 2;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
 
@@ -4822,7 +4905,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
       n[4].f = z;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 3;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
 
@@ -4846,7 +4929,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
       n[5].f = w;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 4;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
 
@@ -4868,7 +4951,7 @@ save_Attr1fARB(GLenum attr, GLfloat x)
       n[2].f = x;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 1;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
 
@@ -4890,7 +4973,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
       n[3].f = y;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 2;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
 
@@ -4913,7 +4996,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
       n[4].f = z;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 3;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
 
@@ -4937,7 +5020,7 @@ save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
       n[5].f = w;
    }
 
-   ASSERT(attr < VERT_ATTRIB_MAX);
+   ASSERT(attr < MAX_VERTEX_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 4;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
 
@@ -5025,51 +5108,19 @@ save_EvalPoint2(GLint x, GLint y)
 static void GLAPIENTRY
 save_Indexf(GLfloat x)
 {
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX, 1);
-   if (n) {
-      n[1].f = x;
-   }
-
-   ctx->ListState.ActiveIndex = 1;
-   ctx->ListState.CurrentIndex = x;
-
-   if (ctx->ExecuteFlag) {
-      CALL_Indexi(ctx->Exec, ((GLint) x));
-   }
+   save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, x);
 }
 
 static void GLAPIENTRY
 save_Indexfv(const GLfloat * v)
 {
-   save_Indexf(v[0]);
+   save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX, v[0]);
 }
 
 static void GLAPIENTRY
 save_EdgeFlag(GLboolean x)
 {
-   GET_CURRENT_CONTEXT(ctx);
-   Node *n;
-   SAVE_FLUSH_VERTICES(ctx);
-   n = ALLOC_INSTRUCTION(ctx, OPCODE_EDGEFLAG, 1);
-   if (n) {
-      n[1].b = x;
-   }
-
-   ctx->ListState.ActiveEdgeFlag = 1;
-   ctx->ListState.CurrentEdgeFlag = x;
-
-   if (ctx->ExecuteFlag) {
-      CALL_EdgeFlag(ctx->Exec, (x));
-   }
-}
-
-static void GLAPIENTRY
-save_EdgeFlagv(const GLboolean * v)
-{
-   save_EdgeFlag(v[0]);
+   save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? 1.0 : 0.0);
 }
 
 static void GLAPIENTRY
@@ -5413,13 +5464,18 @@ save_MultiTexCoord4fv(GLenum target, const GLfloat * v)
 }
 
 
+/**
+ * Record a GL_INVALID_VALUE error when a invalid vertex attribute
+ * index is found.
+ */
 static void
-enum_error(void)
+index_error(void)
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_error(ctx, GL_INVALID_ENUM, "VertexAttribfNV");
+   _mesa_error(ctx, GL_INVALID_VALUE, "VertexAttribf(index)");
 }
 
+
 /* First level for NV_vertex_program:
  *
  * Check for errors at compile time?.
@@ -5427,74 +5483,74 @@ enum_error(void)
 static void GLAPIENTRY
 save_VertexAttrib1fNV(GLuint index, GLfloat x)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr1fNV(index, x);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr1fNV(index, v[0]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr2fNV(index, x, y);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr2fNV(index, v[0], v[1]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr3fNV(index, x, y, z);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr3fNV(index, v[0], v[1], v[2]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
                       GLfloat z, GLfloat w)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr4fNV(index, x, y, z, w);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_PROGRAM_ATTRIBS)
       save_Attr4fNV(index, v[0], v[1], v[2], v[3]);
    else
-      enum_error();
+      index_error();
 }
 
 
@@ -5503,74 +5559,74 @@ save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
 static void GLAPIENTRY
 save_VertexAttrib1fARB(GLuint index, GLfloat x)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr1fARB(index, x);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr1fARB(index, v[0]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr2fARB(index, x, y);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr2fARB(index, v[0], v[1]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr3fARB(index, x, y, z);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr3fARB(index, v[0], v[1], v[2]);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
                        GLfloat w)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr4fARB(index, x, y, z, w);
    else
-      enum_error();
+      index_error();
 }
 
 static void GLAPIENTRY
 save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < VERT_ATTRIB_MAX)
+   if (index < MAX_VERTEX_ATTRIBS)
       save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
    else
-      enum_error();
+      index_error();
 }
 
 
@@ -5605,13 +5661,14 @@ save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
 #endif
 
 
-/* KW: Compile commands
+/**
+ * Save an error-generating command into display list.
  *
- * Will appear in the list before the vertex buffer containing the
+ * KW: Will appear in the list before the vertex buffer containing the
  * command that provoked the error.  I don't see this as a problem.
  */
-void
-_mesa_save_error(GLcontext *ctx, GLenum error, const char *s)
+static void
+save_error(GLcontext *ctx, GLenum error, const char *s)
 {
    Node *n;
    n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2);
@@ -5619,29 +5676,29 @@ _mesa_save_error(GLcontext *ctx, GLenum error, const char *s)
       n[1].e = error;
       n[2].data = (void *) s;
    }
-   /* execute already done */
 }
 
 
-/*
+/**
  * Compile an error into current display list.
  */
 void
 _mesa_compile_error(GLcontext *ctx, GLenum error, const char *s)
 {
    if (ctx->CompileFlag)
-      _mesa_save_error(ctx, error, s);
-
+      save_error(ctx, error, s);
    if (ctx->ExecuteFlag)
       _mesa_error(ctx, error, s);
 }
 
 
-
+/**
+ * Test if ID names a display list.
+ */
 static GLboolean
 islist(GLcontext *ctx, GLuint list)
 {
-   if (list > 0 && _mesa_HashLookup(ctx->Shared->DisplayList, list)) {
+   if (list > 0 && lookup_list(ctx, list)) {
       return GL_TRUE;
    }
    else {
@@ -5662,7 +5719,7 @@ islist(GLcontext *ctx, GLuint list)
  * the absolute list number, not relative to ListBase.
  * \param list - display list number
  */
-static void GLAPIENTRY
+static void
 execute_list(GLcontext *ctx, GLuint list)
 {
    struct mesa_display_list *dlist;
@@ -5677,10 +5734,7 @@ execute_list(GLcontext *ctx, GLuint list)
       return;
    }
 
-
-   dlist =
-      (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
-                                                    list);
+   dlist = lookup_list(ctx, list);
    if (!dlist)
       return;
 
@@ -6520,12 +6574,6 @@ execute_list(GLcontext *ctx, GLuint list)
                CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, f));
             }
             break;
-         case OPCODE_INDEX:
-            CALL_Indexi(ctx->Exec, (n[1].i));
-            break;
-         case OPCODE_EDGEFLAG:
-            CALL_EdgeFlag(ctx->Exec, (n[1].b));
-            break;
          case OPCODE_BEGIN:
             CALL_Begin(ctx->Exec, (n[1].e));
             break;
@@ -6615,7 +6663,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range)
       return;
    }
    for (i = list; i < list + range; i++) {
-      _mesa_destroy_list(ctx, i);
+      destroy_list(ctx, i);
    }
 }
 
@@ -6711,9 +6759,6 @@ _mesa_NewList(GLuint list, GLenum mode)
    for (i = 0; i < MAT_ATTRIB_MAX; i++)
       ctx->ListState.ActiveMaterialSize[i] = 0;
 
-   ctx->ListState.ActiveIndex = 0;
-   ctx->ListState.ActiveEdgeFlag = 0;
-
    ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
    ctx->Driver.NewList(ctx, list, mode);
 
@@ -6744,7 +6789,7 @@ _mesa_EndList(void)
    (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
 
    /* Destroy old list, if any */
-   _mesa_destroy_list(ctx, ctx->ListState.CurrentListNum);
+   destroy_list(ctx, ctx->ListState.CurrentListNum);
    /* Install the list */
    _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum,
                     ctx->ListState.CurrentList);
@@ -7787,7 +7832,6 @@ _mesa_init_dlist_table(struct _glapi_table *table)
 
    /* GL 1.1 */
    SET_AreTexturesResident(table, exec_AreTexturesResident);
-   SET_AreTexturesResidentEXT(table, exec_AreTexturesResident);
    SET_BindTexture(table, save_BindTexture);
    SET_ColorPointer(table, exec_ColorPointer);
    SET_CopyTexImage1D(table, save_CopyTexImage1D);
@@ -7799,12 +7843,10 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_EdgeFlagPointer(table, exec_EdgeFlagPointer);
    SET_EnableClientState(table, exec_EnableClientState);
    SET_GenTextures(table, exec_GenTextures);
-   SET_GenTexturesEXT(table, exec_GenTextures);
    SET_GetPointerv(table, exec_GetPointerv);
    SET_IndexPointer(table, exec_IndexPointer);
    SET_InterleavedArrays(table, exec_InterleavedArrays);
    SET_IsTexture(table, exec_IsTexture);
-   SET_IsTextureEXT(table, exec_IsTexture);
    SET_NormalPointer(table, exec_NormalPointer);
    SET_PopClientAttrib(table, exec_PopClientAttrib);
    SET_PrioritizeTextures(table, save_PrioritizeTextures);
@@ -7843,31 +7885,18 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_CopyConvolutionFilter1D(table, exec_CopyConvolutionFilter1D);
    SET_CopyConvolutionFilter2D(table, exec_CopyConvolutionFilter2D);
    SET_GetColorTable(table, exec_GetColorTable);
-   SET_GetColorTableEXT(table, exec_GetColorTable);
    SET_GetColorTableParameterfv(table, exec_GetColorTableParameterfv);
-   SET_GetColorTableParameterfvEXT(table, exec_GetColorTableParameterfv);
    SET_GetColorTableParameteriv(table, exec_GetColorTableParameteriv);
-   SET_GetColorTableParameterivEXT(table, exec_GetColorTableParameteriv);
    SET_GetConvolutionFilter(table, exec_GetConvolutionFilter);
-   SET_GetConvolutionFilterEXT(table, exec_GetConvolutionFilter);
    SET_GetConvolutionParameterfv(table, exec_GetConvolutionParameterfv);
-   SET_GetConvolutionParameterfvEXT(table, exec_GetConvolutionParameterfv);
    SET_GetConvolutionParameteriv(table, exec_GetConvolutionParameteriv);
-   SET_GetConvolutionParameterivEXT(table, exec_GetConvolutionParameteriv);
    SET_GetHistogram(table, exec_GetHistogram);
-   SET_GetHistogramEXT(table, exec_GetHistogram);
    SET_GetHistogramParameterfv(table, exec_GetHistogramParameterfv);
-   SET_GetHistogramParameterfvEXT(table, exec_GetHistogramParameterfv);
    SET_GetHistogramParameteriv(table, exec_GetHistogramParameteriv);
-   SET_GetHistogramParameterivEXT(table, exec_GetHistogramParameteriv);
    SET_GetMinmax(table, exec_GetMinmax);
-   SET_GetMinmaxEXT(table, exec_GetMinmax);
    SET_GetMinmaxParameterfv(table, exec_GetMinmaxParameterfv);
-   SET_GetMinmaxParameterfvEXT(table, exec_GetMinmaxParameterfv);
    SET_GetMinmaxParameteriv(table, exec_GetMinmaxParameteriv);
-   SET_GetMinmaxParameterivEXT(table, exec_GetMinmaxParameteriv);
    SET_GetSeparableFilter(table, exec_GetSeparableFilter);
-   SET_GetSeparableFilterEXT(table, exec_GetSeparableFilter);
    SET_Histogram(table, save_Histogram);
    SET_Minmax(table, save_Minmax);
    SET_ResetHistogram(table, save_ResetHistogram);
@@ -7889,6 +7918,15 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_TexSubImage3DEXT(table, save_TexSubImage3D);
 #endif
 
+   /* 14. GL_SGI_color_table */
+#if 0
+   SET_ColorTableSGI(table, save_ColorTable);
+   SET_ColorSubTableSGI(table, save_ColorSubTable);
+   SET_GetColorTableSGI(table, exec_GetColorTable);
+   SET_GetColorTableParameterfvSGI(table, exec_GetColorTableParameterfv);
+   SET_GetColorTableParameterivSGI(table, exec_GetColorTableParameteriv);
+#endif
+
    /* 30. GL_EXT_vertex_array */
    SET_ColorPointerEXT(table, exec_ColorPointerEXT);
    SET_EdgeFlagPointerEXT(table, exec_EdgeFlagPointerEXT);
@@ -7906,15 +7944,6 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_PointParameterfEXT(table, save_PointParameterfEXT);
    SET_PointParameterfvEXT(table, save_PointParameterfvEXT);
 
-   /* 78. GL_EXT_paletted_texture */
-#if 0
-   SET_ColorTableEXT(table, save_ColorTable);
-   SET_ColorSubTableEXT(table, save_ColorSubTable);
-#endif
-   SET_GetColorTableEXT(table, exec_GetColorTable);
-   SET_GetColorTableParameterfvEXT(table, exec_GetColorTableParameterfv);
-   SET_GetColorTableParameterivEXT(table, exec_GetColorTableParameteriv);
-
    /* 97. GL_EXT_compiled_vertex_array */
    SET_LockArraysEXT(table, exec_LockArraysEXT);
    SET_UnlockArraysEXT(table, exec_UnlockArraysEXT);
@@ -7986,7 +8015,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
    SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
    SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
-   SET_IsProgramNV(table, _mesa_IsProgram);
+   SET_IsProgramNV(table, _mesa_IsProgramARB);
    SET_LoadProgramNV(table, save_LoadProgramNV);
    SET_ProgramParameter4dNV(table, save_ProgramParameter4dNV);
    SET_ProgramParameter4dvNV(table, save_ProgramParameter4dvNV);
@@ -8031,6 +8060,12 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    /* 268. GL_EXT_stencil_two_side */
    SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT);
 
+   /* 273. GL_APPLE_vertex_array_object */
+   SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE);
+   SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE);
+   SET_GenVertexArraysAPPLE(table, _mesa_GenVertexArraysAPPLE);
+   SET_IsVertexArrayAPPLE(table, _mesa_IsVertexArrayAPPLE);
+
    /* ???. GL_EXT_depth_bounds_test */
    SET_DepthBoundsEXT(table, save_DepthBoundsEXT);
 
@@ -8073,7 +8108,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_BindProgramNV(table, save_BindProgramNV);
    SET_DeleteProgramsNV(table, _mesa_DeletePrograms);
    SET_GenProgramsNV(table, _mesa_GenPrograms);
-   SET_IsProgramNV(table, _mesa_IsProgram);
+   SET_IsProgramNV(table, _mesa_IsProgramARB);
    SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV);
    SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV);
    SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV);
@@ -8130,6 +8165,12 @@ _mesa_init_dlist_table(struct _glapi_table *table)
 
    /* 299. GL_EXT_blend_equation_separate */
    SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
+
+   /* GL_EXT_gpu_program_parmaeters */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+   SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
+   SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
+#endif
 }
 
 
@@ -8152,14 +8193,12 @@ print_list(GLcontext *ctx, GLuint list)
    Node *n;
    GLboolean done;
 
-   if (!CALL_IsList(GET_DISPATCH(), (list))) {
+   if (!islist(ctx, list)) {
       _mesa_printf("%u is not a display list ID\n", list);
       return;
    }
 
-   dlist =
-      (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
-                                                    list);
+   dlist = lookup_list(ctx, list);
    if (!dlist)
       return;
 
@@ -8345,12 +8384,6 @@ print_list(GLcontext *ctx, GLuint list)
             _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
                          n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
             break;
-         case OPCODE_INDEX:
-            _mesa_printf("INDEX: %f\n", n[1].f);
-            break;
-         case OPCODE_EDGEFLAG:
-            _mesa_printf("EDGEFLAG: %d\n", n[1].i);
-            break;
          case OPCODE_BEGIN:
             _mesa_printf("BEGIN %x\n", n[1].i);
             break;
@@ -8442,7 +8475,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
    vfmt->Color4f = save_Color4f;
    vfmt->Color4fv = save_Color4fv;
    vfmt->EdgeFlag = save_EdgeFlag;
-   vfmt->EdgeFlagv = save_EdgeFlagv;
    vfmt->End = save_End;
    vfmt->EvalCoord1f = save_EvalCoord1f;
    vfmt->EvalCoord1fv = save_EvalCoord1fv;