use BCOPY macro on FreeBSD
[mesa.git] / src / mesa / main / dlist.c
index 1babb47010f09aedb7c069a155bf594f5e12ed3e..13976d8b1fbe302e47e87e82c83224dbd15966fb 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: dlist.c,v 1.18 1999/11/12 23:38:42 brianp Exp $ */
+/* $Id: dlist.c,v 1.36 2000/03/21 17:42:27 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
  * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #else
 #include "glheader.h"
 #include "accum.h"
-#include "alpha.h"
 #include "attrib.h"
 #include "bitmap.h"
 #include "bbox.h"
 #include "blend.h"
+#include "buffers.h"
 #include "clip.h"
 #include "colortab.h"
 #include "context.h"
 #include "copypix.h"
 #include "cva.h"
 #include "depth.h"
-#include "drawpix.h"
 #include "enable.h"
 #include "enums.h"
 #include "eval.h"
 #include "extensions.h"
 #include "feedback.h"
-#include "fog.h"
 #include "get.h"
-#include "glmisc.h"
+#include "glapi.h"
 #include "hash.h"
 #include "image.h"
 #include "imaging.h"
 #include "light.h"
 #include "lines.h"
 #include "dlist.h"
-#include "logic.h"
 #include "macros.h"
-#include "masking.h"
 #include "matrix.h"
 #include "mem.h"
 #include "pipeline.h"
 #include "pixel.h"
 #include "points.h"
 #include "polygon.h"
-#include "rastpos.h"
 #include "readpix.h"
 #include "rect.h"
-#include "scissor.h"
-#include "stencil.h"
+#include "state.h"
 #include "texobj.h"
 #include "teximage.h"
 #include "texstate.h"
@@ -78,7 +72,6 @@
 #include "vb.h"
 #include "vbfill.h"
 #include "vbxform.h"
-#include "winpos.h"
 #include "xform.h"
 #endif
 
@@ -173,6 +166,7 @@ typedef enum {
        OPCODE_FRONT_FACE,
        OPCODE_FRUSTUM,
        OPCODE_HINT,
+       OPCODE_HINT_PGI,
        OPCODE_INDEX_MASK,
        OPCODE_INIT_NAMES,
        OPCODE_LIGHT,
@@ -336,7 +330,7 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
    if (list==0)
       return;
 
-   block = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+   block = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
    n = block;
 
    done = block ? GL_FALSE : GL_TRUE;
@@ -416,7 +410,7 @@ void gl_destroy_list( GLcontext *ctx, GLuint list )
       }
    }
 
-   HashRemove(ctx->Shared->DisplayList, list);
+   _mesa_HashRemove(ctx->Shared->DisplayList, list);
 }
 
 
@@ -532,6 +526,7 @@ void gl_init_lists( void )
       InstSize[OPCODE_FRONT_FACE] = 2;
       InstSize[OPCODE_FRUSTUM] = 7;
       InstSize[OPCODE_HINT] = 3;
+      InstSize[OPCODE_HINT_PGI] = 3;
       InstSize[OPCODE_INDEX_MASK] = 2;
       InstSize[OPCODE_INIT_NAMES] = 1;
       InstSize[OPCODE_LIGHT] = 7;
@@ -616,7 +611,7 @@ static void save_Accum( GLenum op, GLfloat value )
       n[2].f = value;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Accum)( op, value );
+      (*ctx->Exec->Accum)( op, value );
    }
 }
 
@@ -632,7 +627,7 @@ static void save_AlphaFunc( GLenum func, GLclampf ref )
       n[2].f = (GLfloat) ref;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.AlphaFunc)( func, ref );
+      (*ctx->Exec->AlphaFunc)( func, ref );
    }
 }
 
@@ -654,7 +649,7 @@ static void save_BindTexture( GLenum target, GLuint texture )
       n[2].ui = texture;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.BindTexture)( target, texture );
+      (*ctx->Exec->BindTexture)( target, texture );
    }
 }
 
@@ -682,7 +677,7 @@ static void save_Bitmap( GLsizei width, GLsizei height,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Bitmap)( width, height,
+      (*ctx->Exec->Bitmap)( width, height,
                            xorig, yorig, xmove, ymove, pixels );
    }
 }
@@ -698,7 +693,7 @@ static void save_BlendEquation( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.BlendEquationEXT)( mode );
+      (*ctx->Exec->BlendEquation)( mode );
    }
 }
 
@@ -714,13 +709,13 @@ static void save_BlendFunc( GLenum sfactor, GLenum dfactor )
       n[2].e = dfactor;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.BlendFunc)( sfactor, dfactor );
+      (*ctx->Exec->BlendFunc)( sfactor, dfactor );
    }
 }
 
 
-static void save_BlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB,
-                                       GLenum sfactorA, GLenum dfactorA)
+static void save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
+                                      GLenum sfactorA, GLenum dfactorA)
 {
    GET_CURRENT_CONTEXT(ctx);
    Node *n;
@@ -733,7 +728,7 @@ static void save_BlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB,
       n[4].e = dfactorA;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.BlendFuncSeparateINGR)( sfactorRGB, dfactorRGB,
+      (*ctx->Exec->BlendFuncSeparateEXT)( sfactorRGB, dfactorRGB,
                                           sfactorA, dfactorA);
    }
 }
@@ -753,7 +748,7 @@ static void save_BlendColor( GLfloat red, GLfloat green,
       n[4].f = alpha;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.BlendColorEXT)( red, green, blue, alpha );
+      (*ctx->Exec->BlendColor)( red, green, blue, alpha );
    }
 }
 
@@ -768,7 +763,7 @@ static void save_CallList( GLuint list )
       n[1].ui = list;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CallList)( list );
+      (*ctx->Exec->CallList)( list );
    }
 }
 
@@ -787,7 +782,7 @@ static void save_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
       }
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CallLists)( n, type, lists );
+      (*ctx->Exec->CallLists)( n, type, lists );
    }
 }
 
@@ -802,7 +797,7 @@ static void save_Clear( GLbitfield mask )
       n[1].bf = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Clear)( mask );
+      (*ctx->Exec->Clear)( mask );
    }
 }
 
@@ -821,7 +816,7 @@ static void save_ClearAccum( GLfloat red, GLfloat green,
       n[4].f = alpha;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClearAccum)( red, green, blue, alpha );
+      (*ctx->Exec->ClearAccum)( red, green, blue, alpha );
    }
 }
 
@@ -840,7 +835,7 @@ static void save_ClearColor( GLclampf red, GLclampf green,
       n[4].f = alpha;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClearColor)( red, green, blue, alpha );
+      (*ctx->Exec->ClearColor)( red, green, blue, alpha );
    }
 }
 
@@ -855,7 +850,7 @@ static void save_ClearDepth( GLclampd depth )
       n[1].f = (GLfloat) depth;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClearDepth)( depth );
+      (*ctx->Exec->ClearDepth)( depth );
    }
 }
 
@@ -870,7 +865,7 @@ static void save_ClearIndex( GLfloat c )
       n[1].f = c;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClearIndex)( c );
+      (*ctx->Exec->ClearIndex)( c );
    }
 }
 
@@ -885,7 +880,7 @@ static void save_ClearStencil( GLint s )
       n[1].i = s;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClearStencil)( s );
+      (*ctx->Exec->ClearStencil)( s );
    }
 }
 
@@ -904,7 +899,7 @@ static void save_ClipPlane( GLenum plane, const GLdouble *equ )
       n[5].f = equ[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClipPlane)( plane, equ );
+      (*ctx->Exec->ClipPlane)( plane, equ );
    }
 }
 
@@ -924,7 +919,7 @@ static void save_ColorMask( GLboolean red, GLboolean green,
       n[4].b = alpha;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ColorMask)( red, green, blue, alpha );
+      (*ctx->Exec->ColorMask)( red, green, blue, alpha );
    }
 }
 
@@ -940,22 +935,22 @@ static void save_ColorMaterial( GLenum face, GLenum mode )
       n[2].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ColorMaterial)( face, mode );
+      (*ctx->Exec->ColorMaterial)( face, mode );
    }
 }
 
 
-static void save_ColorTableEXT( GLenum target, GLenum internalFormat,
-                                GLsizei width, GLenum format, GLenum type,
-                                const GLvoid *table )
+static void save_ColorTable( GLenum target, GLenum internalFormat,
+                             GLsizei width, GLenum format, GLenum type,
+                             const GLvoid *table )
 {
    GET_CURRENT_CONTEXT(ctx);
    if (target == GL_PROXY_TEXTURE_1D ||
        target == GL_PROXY_TEXTURE_2D ||
        target == GL_PROXY_TEXTURE_3D) {
       /* execute immediately */
-      (*ctx->Exec.ColorTableEXT)( target, internalFormat, width,
-                                  format, type, table );
+      (*ctx->Exec->ColorTable)( target, internalFormat, width,
+                                format, type, table );
    }
    else {
       GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type, table,
@@ -975,16 +970,16 @@ static void save_ColorTableEXT( GLenum target, GLenum internalFormat,
          FREE(image);
       }
       if (ctx->ExecuteFlag) {
-         (*ctx->Exec.ColorTableEXT)( target, internalFormat, width,
-                                     format, type, table );
+         (*ctx->Exec->ColorTable)( target, internalFormat, width,
+                                   format, type, table );
       }
    }
 }
 
 
-static void save_ColorSubTableEXT( GLenum target, GLsizei start, GLsizei count,
-                                   GLenum format, GLenum type,
-                                   const GLvoid *table)
+static void save_ColorSubTable( GLenum target, GLsizei start, GLsizei count,
+                                GLenum format, GLenum type,
+                                const GLvoid *table)
 {
    GET_CURRENT_CONTEXT(ctx);
    GLvoid *image = _mesa_unpack_image(count, 1, 1, format, type, table,
@@ -1004,7 +999,7 @@ static void save_ColorSubTableEXT( GLenum target, GLsizei start, GLsizei count,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ColorSubTableEXT)(target, start, count, format, type, table);
+      (*ctx->Exec->ColorSubTable)(target, start, count, format, type, table);
    }
 }
 
@@ -1025,7 +1020,7 @@ static void save_CopyPixels( GLint x, GLint y,
       n[5].e = type;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyPixels)( x, y, width, height, type );
+      (*ctx->Exec->CopyPixels)( x, y, width, height, type );
    }
 }
 
@@ -1049,7 +1044,7 @@ save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
       n[7].i = border;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyTexImage1D)( target, level, internalformat,
+      (*ctx->Exec->CopyTexImage1D)( target, level, internalformat,
                                    x, y, width, border );
    }
 }
@@ -1076,7 +1071,7 @@ save_CopyTexImage2D( GLenum target, GLint level,
       n[8].i = border;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyTexImage2D)( target, level, internalformat,
+      (*ctx->Exec->CopyTexImage2D)( target, level, internalformat,
                                    x, y, width, height, border );
    }
 }
@@ -1101,7 +1096,7 @@ save_CopyTexSubImage1D( GLenum target, GLint level,
       n[6].i = width;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyTexSubImage1D)( target, level, xoffset, x, y, width );
+      (*ctx->Exec->CopyTexSubImage1D)( target, level, xoffset, x, y, width );
    }
 }
 
@@ -1127,7 +1122,7 @@ save_CopyTexSubImage2D( GLenum target, GLint level,
       n[8].i = height;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyTexSubImage2D)( target, level, xoffset, yoffset,
+      (*ctx->Exec->CopyTexSubImage2D)( target, level, xoffset, yoffset,
                                x, y, width, height );
    }
 }
@@ -1155,7 +1150,7 @@ save_CopyTexSubImage3D( GLenum target, GLint level,
       n[9].i = height;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CopyTexSubImage3D)( target, level,
+      (*ctx->Exec->CopyTexSubImage3D)( target, level,
                                       xoffset, yoffset, zoffset,
                                       x, y, width, height );
    }
@@ -1172,7 +1167,7 @@ static void save_CullFace( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.CullFace)( mode );
+      (*ctx->Exec->CullFace)( mode );
    }
 }
 
@@ -1187,7 +1182,7 @@ static void save_DepthFunc( GLenum func )
       n[1].e = func;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.DepthFunc)( func );
+      (*ctx->Exec->DepthFunc)( func );
    }
 }
 
@@ -1202,7 +1197,7 @@ static void save_DepthMask( GLboolean mask )
       n[1].b = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.DepthMask)( mask );
+      (*ctx->Exec->DepthMask)( mask );
    }
 }
 
@@ -1218,7 +1213,7 @@ static void save_DepthRange( GLclampd nearval, GLclampd farval )
       n[2].f = (GLfloat) farval;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.DepthRange)( nearval, farval );
+      (*ctx->Exec->DepthRange)( nearval, farval );
    }
 }
 
@@ -1233,7 +1228,7 @@ static void save_Disable( GLenum cap )
       n[1].e = cap;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Disable)( cap );
+      (*ctx->Exec->Disable)( cap );
    }
 }
 
@@ -1248,7 +1243,7 @@ static void save_DrawBuffer( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.DrawBuffer)( mode );
+      (*ctx->Exec->DrawBuffer)( mode );
    }
 }
 
@@ -1274,7 +1269,7 @@ static void save_DrawPixels( GLsizei width, GLsizei height,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.DrawPixels)( width, height, format, type, pixels );
+      (*ctx->Exec->DrawPixels)( width, height, format, type, pixels );
    }
 }
 
@@ -1290,7 +1285,7 @@ static void save_Enable( GLenum cap )
       n[1].e = cap;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Enable)( cap );
+      (*ctx->Exec->Enable)( cap );
    }
 }
 
@@ -1308,7 +1303,7 @@ static void save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
       n[3].i = i2;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.EvalMesh1)( mode, i1, i2 );
+      (*ctx->Exec->EvalMesh1)( mode, i1, i2 );
    }
 }
 
@@ -1328,7 +1323,7 @@ static void save_EvalMesh2(
       n[5].i = j2;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.EvalMesh2)( mode, i1, i2, j1, j2 );
+      (*ctx->Exec->EvalMesh2)( mode, i1, i2, j1, j2 );
    }
 }
 
@@ -1349,7 +1344,7 @@ static void save_Fogfv( GLenum pname, const GLfloat *params )
       n[5].f = params[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Fogfv)( pname, params );
+      (*ctx->Exec->Fogfv)( pname, params );
    }
 }
 
@@ -1385,7 +1380,7 @@ static void save_Fogiv(GLenum pname, const GLint *params )
 }
 
 
-void save_Fogi(GLenum pname, GLint param )
+static void save_Fogi(GLenum pname, GLint param )
 {
    save_Fogiv(pname, &param);
 }
@@ -1401,7 +1396,7 @@ static void save_FrontFace( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.FrontFace)( mode );
+      (*ctx->Exec->FrontFace)( mode );
    }
 }
 
@@ -1423,7 +1418,7 @@ static void save_Frustum( GLdouble left, GLdouble right,
       n[6].f = farval;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Frustum)( left, right, bottom, top, nearval, farval );
+      (*ctx->Exec->Frustum)( left, right, bottom, top, nearval, farval );
    }
 }
 
@@ -1439,11 +1434,27 @@ static void save_Hint( GLenum target, GLenum mode )
       n[2].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Hint)( target, mode );
+      (*ctx->Exec->Hint)( target, mode );
    }
 }
 
 
+/* GL_PGI_misc_hints*/
+static void save_HintPGI( GLenum target, GLint mode )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   FLUSH_VB(ctx, "dlist");
+   n = alloc_instruction( ctx, OPCODE_HINT_PGI, 2 );
+   if (n) {
+      n[1].e = target;
+      n[2].i = mode;
+   }
+   if (ctx->ExecuteFlag) {
+      (*ctx->Exec->HintPGI)( target, mode );
+   }
+}
+
 
 static void save_IndexMask( GLuint mask )
 {
@@ -1455,7 +1466,7 @@ static void save_IndexMask( GLuint mask )
       n[1].ui = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.IndexMask)( mask );
+      (*ctx->Exec->IndexMask)( mask );
    }
 }
 
@@ -1466,7 +1477,7 @@ static void save_InitNames( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_INIT_NAMES, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.InitNames)();
+      (*ctx->Exec->InitNames)();
    }
 }
 
@@ -1520,7 +1531,7 @@ static void save_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
       }
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Lightfv)( light, pname, params );
+      (*ctx->Exec->Lightfv)( light, pname, params );
    }
 }
 
@@ -1589,7 +1600,7 @@ static void save_LightModelfv( GLenum pname, const GLfloat *params )
       n[5].f = params[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LightModelfv)( pname, params );
+      (*ctx->Exec->LightModelfv)( pname, params );
    }
 }
 
@@ -1640,7 +1651,7 @@ static void save_LineStipple( GLint factor, GLushort pattern )
       n[2].us = pattern;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LineStipple)( factor, pattern );
+      (*ctx->Exec->LineStipple)( factor, pattern );
    }
 }
 
@@ -1655,7 +1666,7 @@ static void save_LineWidth( GLfloat width )
       n[1].f = width;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LineWidth)( width );
+      (*ctx->Exec->LineWidth)( width );
    }
 }
 
@@ -1670,7 +1681,7 @@ static void save_ListBase( GLuint base )
       n[1].ui = base;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ListBase)( base );
+      (*ctx->Exec->ListBase)( base );
    }
 }
 
@@ -1681,7 +1692,7 @@ static void save_LoadIdentity( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_LOAD_IDENTITY, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LoadIdentity)();
+      (*ctx->Exec->LoadIdentity)();
    }
 }
 
@@ -1699,7 +1710,7 @@ static void save_LoadMatrixf( const GLfloat *m )
       }
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LoadMatrixf)( m );
+      (*ctx->Exec->LoadMatrixf)( m );
    }
 }
 
@@ -1725,7 +1736,7 @@ static void save_LoadName( GLuint name )
       n[1].ui = name;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LoadName)( name );
+      (*ctx->Exec->LoadName)( name );
    }
 }
 
@@ -1740,7 +1751,7 @@ static void save_LogicOp( GLenum opcode )
       n[1].e = opcode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.LogicOp)( opcode );
+      (*ctx->Exec->LogicOp)( opcode );
    }
 }
 
@@ -1762,7 +1773,7 @@ static void save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride,
       n[6].data = (void *) pnts;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Map1d)( target, u1, u2, stride, order, points );
+      (*ctx->Exec->Map1d)( target, u1, u2, stride, order, points );
    }
 }
 
@@ -1783,7 +1794,7 @@ static void save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride,
       n[6].data = (void *) pnts;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Map1f)( target, u1, u2, stride, order, points );
+      (*ctx->Exec->Map1f)( target, u1, u2, stride, order, points );
    }
 }
 
@@ -1813,7 +1824,7 @@ static void save_Map2d( GLenum target,
       n[10].data = (void *) pnts;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Map2d)( target,
+      (*ctx->Exec->Map2d)( target,
                           u1, u2, ustride, uorder,
                           v1, v2, vstride, vorder, points );
    }
@@ -1845,7 +1856,7 @@ static void save_Map2f( GLenum target,
       n[10].data = (void *) pnts;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder,
+      (*ctx->Exec->Map2f)( target, u1, u2, ustride, uorder,
                           v1, v2, vstride, vorder, points );
    }
 }
@@ -1863,7 +1874,7 @@ static void save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 )
       n[3].f = u2;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.MapGrid1f)( un, u1, u2 );
+      (*ctx->Exec->MapGrid1f)( un, u1, u2 );
    }
 }
 
@@ -1890,7 +1901,7 @@ static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2,
       n[6].f = v2;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.MapGrid2f)( un, u1, u2, vn, v1, v2 );
+      (*ctx->Exec->MapGrid2f)( un, u1, u2, vn, v1, v2 );
    }
 }
 
@@ -1913,7 +1924,7 @@ static void save_MatrixMode( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.MatrixMode)( mode );
+      (*ctx->Exec->MatrixMode)( mode );
    }
 }
 
@@ -1931,7 +1942,7 @@ static void save_MultMatrixf( const GLfloat *m )
       }
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.MultMatrixf)( m );
+      (*ctx->Exec->MultMatrixf)( m );
    }
 }
 
@@ -1975,7 +1986,7 @@ static void save_Ortho( GLdouble left, GLdouble right,
       n[6].f = farval;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Ortho)( left, right, bottom, top, nearval, farval );
+      (*ctx->Exec->Ortho)( left, right, bottom, top, nearval, farval );
    }
 }
 
@@ -1993,7 +2004,7 @@ static void save_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
       MEMCPY( n[3].data, (void *) values, mapsize * sizeof(GLfloat) );
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PixelMapfv)( map, mapsize, values );
+      (*ctx->Exec->PixelMapfv)( map, mapsize, values );
    }
 }
 
@@ -2045,7 +2056,7 @@ static void save_PixelTransferf( GLenum pname, GLfloat param )
       n[2].f = param;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PixelTransferf)( pname, param );
+      (*ctx->Exec->PixelTransferf)( pname, param );
    }
 }
 
@@ -2067,7 +2078,7 @@ static void save_PixelZoom( GLfloat xfactor, GLfloat yfactor )
       n[2].f = yfactor;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PixelZoom)( xfactor, yfactor );
+      (*ctx->Exec->PixelZoom)( xfactor, yfactor );
    }
 }
 
@@ -2085,7 +2096,7 @@ static void save_PointParameterfvEXT( GLenum pname, const GLfloat *params )
       n[4].f = params[2];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PointParameterfvEXT)( pname, params );
+      (*ctx->Exec->PointParameterfvEXT)( pname, params );
    }
 }
 
@@ -2106,7 +2117,7 @@ static void save_PointSize( GLfloat size )
       n[1].f = size;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PointSize)( size );
+      (*ctx->Exec->PointSize)( size );
    }
 }
 
@@ -2122,7 +2133,7 @@ static void save_PolygonMode( GLenum face, GLenum mode )
       n[2].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PolygonMode)( face, mode );
+      (*ctx->Exec->PolygonMode)( face, mode );
    }
 }
 
@@ -2143,7 +2154,7 @@ static void save_PolygonStipple( const GLubyte *pattern )
       MEMCPY( data, pattern, 32 * 4 );
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PolygonStipple)( (GLubyte*) pattern );
+      (*ctx->Exec->PolygonStipple)( (GLubyte*) pattern );
    }
 }
 
@@ -2159,14 +2170,15 @@ static void save_PolygonOffset( GLfloat factor, GLfloat units )
       n[2].f = units;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PolygonOffset)( factor, units );
+      (*ctx->Exec->PolygonOffset)( factor, units );
    }
 }
 
 
 static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
 {
-   save_PolygonOffset(factor, DEPTH_SCALE * bias);
+   GET_CURRENT_CONTEXT(ctx);
+   save_PolygonOffset(factor, ctx->Visual->DepthMaxF * bias);
 }
 
 
@@ -2176,7 +2188,7 @@ static void save_PopAttrib( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_POP_ATTRIB, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PopAttrib)();
+      (*ctx->Exec->PopAttrib)();
    }
 }
 
@@ -2187,7 +2199,7 @@ static void save_PopMatrix( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_POP_MATRIX, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PopMatrix)();
+      (*ctx->Exec->PopMatrix)();
    }
 }
 
@@ -2198,7 +2210,7 @@ static void save_PopName( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_POP_NAME, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PopName)();
+      (*ctx->Exec->PopName)();
    }
 }
 
@@ -2219,7 +2231,7 @@ static void save_PrioritizeTextures( GLsizei num, const GLuint *textures,
       }
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PrioritizeTextures)( num, textures, priorities );
+      (*ctx->Exec->PrioritizeTextures)( num, textures, priorities );
    }
 }
 
@@ -2234,7 +2246,7 @@ static void save_PushAttrib( GLbitfield mask )
       n[1].bf = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PushAttrib)( mask );
+      (*ctx->Exec->PushAttrib)( mask );
    }
 }
 
@@ -2245,7 +2257,7 @@ static void save_PushMatrix( void )
    FLUSH_VB(ctx, "dlist");
    (void) alloc_instruction( ctx, OPCODE_PUSH_MATRIX, 0 );
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PushMatrix)();
+      (*ctx->Exec->PushMatrix)();
    }
 }
 
@@ -2260,7 +2272,7 @@ static void save_PushName( GLuint name )
       n[1].ui = name;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PushName)( name );
+      (*ctx->Exec->PushName)( name );
    }
 }
 
@@ -2278,121 +2290,121 @@ static void save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
       n[4].f = w;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.RasterPos4f)( x, y, z, w );
+      (*ctx->Exec->RasterPos4f)( x, y, z, w );
    }
 }
 
-void save_RasterPos2d(GLdouble x, GLdouble y)
+static void save_RasterPos2d(GLdouble x, GLdouble y)
 {
    save_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
-void save_RasterPos2f(GLfloat x, GLfloat y)
+static void save_RasterPos2f(GLfloat x, GLfloat y)
 {
    save_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
-void save_RasterPos2i(GLint x, GLint y)
+static void save_RasterPos2i(GLint x, GLint y)
 {
    save_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
-void save_RasterPos2s(GLshort x, GLshort y)
+static void save_RasterPos2s(GLshort x, GLshort y)
 {
    save_RasterPos4f(x, y, 0.0F, 1.0F);
 }
 
-void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
+static void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
 {
    save_RasterPos4f(x, y, z, 1.0F);
 }
 
-void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
+static void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
 {
    save_RasterPos4f(x, y, z, 1.0F);
 }
 
-void save_RasterPos3i(GLint x, GLint y, GLint z)
+static void save_RasterPos3i(GLint x, GLint y, GLint z)
 {
    save_RasterPos4f(x, y, z, 1.0F);
 }
 
-void save_RasterPos3s(GLshort x, GLshort y, GLshort z)
+static void save_RasterPos3s(GLshort x, GLshort y, GLshort z)
 {
    save_RasterPos4f(x, y, z, 1.0F);
 }
 
-void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+static void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
 {
    save_RasterPos4f(x, y, z, w);
 }
 
-void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
+static void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
 {
    save_RasterPos4f(x, y, z, w);
 }
 
-void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
+static void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
 {
    save_RasterPos4f(x, y, z, w);
 }
 
-void save_RasterPos2dv(const GLdouble *v)
+static void save_RasterPos2dv(const GLdouble *v)
 {
    save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void save_RasterPos2fv(const GLfloat *v)
+static void save_RasterPos2fv(const GLfloat *v)
 {
    save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void save_RasterPos2iv(const GLint *v)
+static void save_RasterPos2iv(const GLint *v)
 {
    save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void save_RasterPos2sv(const GLshort *v)
+static void save_RasterPos2sv(const GLshort *v)
 {
    save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
 }
 
-void save_RasterPos3dv(const GLdouble *v)
+static void save_RasterPos3dv(const GLdouble *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
-void save_RasterPos3fv(const GLfloat *v)
+static void save_RasterPos3fv(const GLfloat *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
-void save_RasterPos3iv(const GLint *v)
+static void save_RasterPos3iv(const GLint *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
-void save_RasterPos3sv(const GLshort *v)
+static void save_RasterPos3sv(const GLshort *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], 1.0F);
 }
 
-void save_RasterPos4dv(const GLdouble *v)
+static void save_RasterPos4dv(const GLdouble *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], v[3]);
 }
 
-void save_RasterPos4fv(const GLfloat *v)
+static void save_RasterPos4fv(const GLfloat *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], v[3]);
 }
 
-void save_RasterPos4iv(const GLint *v)
+static void save_RasterPos4iv(const GLint *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], v[3]);
 }
 
-void save_RasterPos4sv(const GLshort *v)
+static void save_RasterPos4sv(const GLshort *v)
 {
    save_RasterPos4f(v[0], v[1], v[2], v[3]);
 }
@@ -2408,7 +2420,7 @@ static void save_PassThrough( GLfloat token )
       n[1].f = token;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.PassThrough)( token );
+      (*ctx->Exec->PassThrough)( token );
    }
 }
 
@@ -2423,7 +2435,7 @@ static void save_ReadBuffer( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ReadBuffer)( mode );
+      (*ctx->Exec->ReadBuffer)( mode );
    }
 }
 
@@ -2441,7 +2453,7 @@ static void save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
       n[4].f = y2;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Rectf)( x1, y1, x2, y2 );
+      (*ctx->Exec->Rectf)( x1, y1, x2, y2 );
    }
 }
 
@@ -2507,7 +2519,7 @@ static void save_Scalef( GLfloat x, GLfloat y, GLfloat z )
       n[3].f = z;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Scalef)( x, y, z );
+      (*ctx->Exec->Scalef)( x, y, z );
    }
 }
 
@@ -2531,7 +2543,7 @@ static void save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
       n[4].i = height;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Scissor)( x, y, width, height );
+      (*ctx->Exec->Scissor)( x, y, width, height );
    }
 }
 
@@ -2546,7 +2558,7 @@ static void save_ShadeModel( GLenum mode )
       n[1].e = mode;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ShadeModel)( mode );
+      (*ctx->Exec->ShadeModel)( mode );
    }
 }
 
@@ -2563,7 +2575,7 @@ static void save_StencilFunc( GLenum func, GLint ref, GLuint mask )
       n[3].ui = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.StencilFunc)( func, ref, mask );
+      (*ctx->Exec->StencilFunc)( func, ref, mask );
    }
 }
 
@@ -2578,7 +2590,7 @@ static void save_StencilMask( GLuint mask )
       n[1].ui = mask;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.StencilMask)( mask );
+      (*ctx->Exec->StencilMask)( mask );
    }
 }
 
@@ -2595,7 +2607,7 @@ static void save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
       n[3].e = zpass;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.StencilOp)( fail, zfail, zpass );
+      (*ctx->Exec->StencilOp)( fail, zfail, zpass );
    }
 }
 
@@ -2615,7 +2627,7 @@ static void save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params )
       n[6].f = params[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexEnvfv)( target, pname, params );
+      (*ctx->Exec->TexEnvfv)( target, pname, params );
    }
 }
 
@@ -2661,7 +2673,7 @@ static void save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
       n[6].f = params[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexGenfv)( coord, pname, params );
+      (*ctx->Exec->TexGenfv)( coord, pname, params );
    }
 }
 
@@ -2723,7 +2735,7 @@ static void save_TexParameterfv( GLenum target,
       n[6].f = params[3];
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexParameterfv)( target, pname, params );
+      (*ctx->Exec->TexParameterfv)( target, pname, params );
    }
 }
 
@@ -2761,7 +2773,7 @@ static void save_TexImage1D( GLenum target,
    GET_CURRENT_CONTEXT(ctx);
    if (target == GL_PROXY_TEXTURE_1D) {
       /* don't compile, execute immediately */
-      (*ctx->Exec.TexImage1D)( target, level, components, width,
+      (*ctx->Exec->TexImage1D)( target, level, components, width,
                                border, format, type, pixels );
    }
    else {
@@ -2784,7 +2796,7 @@ static void save_TexImage1D( GLenum target,
          FREE(image);
       }
       if (ctx->ExecuteFlag) {
-         (*ctx->Exec.TexImage1D)( target, level, components, width,
+         (*ctx->Exec->TexImage1D)( target, level, components, width,
                                   border, format, type, pixels );
       }
    }
@@ -2800,7 +2812,7 @@ static void save_TexImage2D( GLenum target,
    GET_CURRENT_CONTEXT(ctx);
    if (target == GL_PROXY_TEXTURE_2D) {
       /* don't compile, execute immediately */
-      (*ctx->Exec.TexImage2D)( target, level, components, width,
+      (*ctx->Exec->TexImage2D)( target, level, components, width,
                                height, border, format, type, pixels );
    }
    else {
@@ -2824,7 +2836,7 @@ static void save_TexImage2D( GLenum target,
          FREE(image);
       }
       if (ctx->ExecuteFlag) {
-         (*ctx->Exec.TexImage2D)( target, level, components, width,
+         (*ctx->Exec->TexImage2D)( target, level, components, width,
                                   height, border, format, type, pixels );
       }
    }
@@ -2841,7 +2853,7 @@ static void save_TexImage3D( GLenum target,
    GET_CURRENT_CONTEXT(ctx);
    if (target == GL_PROXY_TEXTURE_3D) {
       /* don't compile, execute immediately */
-      (*ctx->Exec.TexImage3D)( target, level, components, width,
+      (*ctx->Exec->TexImage3D)( target, level, components, width,
                                height, depth, border, format, type, pixels );
    }
    else {
@@ -2866,7 +2878,7 @@ static void save_TexImage3D( GLenum target,
          FREE(image);
       }
       if (ctx->ExecuteFlag) {
-         (*ctx->Exec.TexImage3D)( target, level, components, width,
+         (*ctx->Exec->TexImage3D)( target, level, components, width,
                                 height, depth, border, format, type, pixels );
       }
    }
@@ -2896,7 +2908,7 @@ static void save_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexSubImage1D)( target, level, xoffset, width,
+      (*ctx->Exec->TexSubImage1D)( target, level, xoffset, width,
                                   format, type, pixels );
    }
 }
@@ -2929,7 +2941,7 @@ static void save_TexSubImage2D( GLenum target, GLint level,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexSubImage2D)( target, level, xoffset, yoffset,
+      (*ctx->Exec->TexSubImage2D)( target, level, xoffset, yoffset,
                            width, height, format, type, pixels );
    }
 }
@@ -2964,7 +2976,7 @@ static void save_TexSubImage3D( GLenum target, GLint level,
       FREE(image);
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.TexSubImage3D)( target, level,
+      (*ctx->Exec->TexSubImage3D)( target, level,
                                   xoffset, yoffset, zoffset,
                                   width, height, depth, format, type, pixels );
    }
@@ -2983,7 +2995,7 @@ static void save_Translatef( GLfloat x, GLfloat y, GLfloat z )
       n[3].f = z;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Translatef)( x, y, z );
+      (*ctx->Exec->Translatef)( x, y, z );
    }
 }
 
@@ -3008,7 +3020,7 @@ static void save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
       n[4].i = (GLint) height;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.Viewport)( x, y, width, height );
+      (*ctx->Exec->Viewport)( x, y, width, height );
    }
 }
 
@@ -3026,10 +3038,124 @@ static void save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
       n[4].f = w;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.WindowPos4fMESA)( x, y, z, w );
+      (*ctx->Exec->WindowPos4fMESA)( x, y, z, w );
    }
 }
 
+static void save_WindowPos2dMESA(GLdouble x, GLdouble y)
+{
+   save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void save_WindowPos2fMESA(GLfloat x, GLfloat y)
+{
+   save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void save_WindowPos2iMESA(GLint x, GLint y)
+{
+   save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void save_WindowPos2sMESA(GLshort x, GLshort y)
+{
+   save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
+}
+
+static void save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
+{
+   save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
+{
+   save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void save_WindowPos3iMESA(GLint x, GLint y, GLint z)
+{
+   save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
+{
+   save_WindowPos4fMESA(x, y, z, 1.0F);
+}
+
+static void save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
+{
+   save_WindowPos4fMESA(x, y, z, w);
+}
+
+static void save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
+{
+   save_WindowPos4fMESA(x, y, z, w);
+}
+
+static void save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
+{
+   save_WindowPos4fMESA(x, y, z, w);
+}
+
+static void save_WindowPos2dvMESA(const GLdouble *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_WindowPos2fvMESA(const GLfloat *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_WindowPos2ivMESA(const GLint *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_WindowPos2svMESA(const GLshort *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
+}
+
+static void save_WindowPos3dvMESA(const GLdouble *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_WindowPos3fvMESA(const GLfloat *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_WindowPos3ivMESA(const GLint *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_WindowPos3svMESA(const GLshort *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
+}
+
+static void save_WindowPos4dvMESA(const GLdouble *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
+
+static void save_WindowPos4fvMESA(const GLfloat *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
+
+static void save_WindowPos4ivMESA(const GLint *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
+
+static void save_WindowPos4svMESA(const GLshort *v)
+{
+   save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
+}
 
 
 
@@ -3044,7 +3170,7 @@ static void save_ActiveTextureARB( GLenum target )
       n[1].e = target;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ActiveTextureARB)( target );
+      (*ctx->Exec->ActiveTextureARB)( target );
    }
 }
 
@@ -3060,12 +3186,45 @@ static void save_ClientActiveTextureARB( GLenum target )
       n[1].e = target;
    }
    if (ctx->ExecuteFlag) {
-      (*ctx->Exec.ClientActiveTextureARB)( target );
+      (*ctx->Exec->ClientActiveTextureARB)( target );
    }
 }
 
 
 
+static void save_LoadTransposeMatrixdARB( const GLdouble m[16] )
+{
+   GLdouble tm[16];
+   gl_matrix_transposed(tm, m);
+   save_LoadMatrixd(tm);
+}
+
+
+static void save_LoadTransposeMatrixfARB( const GLfloat m[16] )
+{
+   GLfloat tm[16];
+   gl_matrix_transposef(tm, m);
+   save_LoadMatrixf(tm);
+}
+
+
+static void save_MultTransposeMatrixdARB( const GLdouble m[16] )
+{
+   GLdouble tm[16];
+   gl_matrix_transposed(tm, m);
+   save_MultMatrixd(tm);
+}
+
+
+static void save_MultTransposeMatrixfARB( const GLfloat m[16] )
+{
+   GLfloat tm[16];
+   gl_matrix_transposef(tm, m);
+   save_MultMatrixf(tm);
+}
+
+
+
 void gl_compile_cassette( GLcontext *ctx )
 {
    Node *n = alloc_instruction( ctx, OPCODE_VERTEX_CASSETTE, 8 );
@@ -3137,7 +3296,7 @@ void gl_save_error( GLcontext *ctx, GLenum error, const char *s )
 static GLboolean
 islist(GLcontext *ctx, GLuint list)
 {
-   if (list > 0 && HashLookup(ctx->Shared->DisplayList, list)) {
+   if (list > 0 && _mesa_HashLookup(ctx->Shared->DisplayList, list)) {
       return GL_TRUE;
    }
    else {
@@ -3171,7 +3330,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
 
    ctx->CallDepth++;
 
-   n = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+   n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
 
    done = GL_FALSE;
    while (!done) {
@@ -3207,44 +3366,46 @@ static void execute_list( GLcontext *ctx, GLuint list )
                (MESA_VERBOSE & VERBOSE_IMMEDIATE))
               gl_print_cassette( (struct immediate *) n[1].data );
 
-           if (0)
-              fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x\n",
+           if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) {
+              fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x ",
                       IM->id,
                       IM->Start, IM->Count, IM->BeginState);
+              gl_print_vert_flags("orflag", IM->OrFlag);
+           }
 
            gl_fixup_cassette( ctx, (struct immediate *) n[1].data ); 
            gl_execute_cassette( ctx, (struct immediate *) n[1].data ); 
             break;
         }
          case OPCODE_ACCUM:
-           (*ctx->Exec.Accum)( n[1].e, n[2].f );
+           (*ctx->Exec->Accum)( n[1].e, n[2].f );
            break;
          case OPCODE_ALPHA_FUNC:
-           (*ctx->Exec.AlphaFunc)( n[1].e, n[2].f );
+           (*ctx->Exec->AlphaFunc)( n[1].e, n[2].f );
            break;
          case OPCODE_BIND_TEXTURE:
-            (*ctx->Exec.BindTexture)( n[1].e, n[2].ui );
+            (*ctx->Exec->BindTexture)( n[1].e, n[2].ui );
             break;
         case OPCODE_BITMAP:
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.Bitmap)( (GLsizei) n[1].i, (GLsizei) n[2].i,
-                                n[3].f, n[4].f, n[5].f, n[6].f, n[7].data );
+               (*ctx->Exec->Bitmap)( (GLsizei) n[1].i, (GLsizei) n[2].i,
+                 n[3].f, n[4].f, n[5].f, n[6].f, (const GLubyte *) n[7].data );
                ctx->Unpack = save;  /* restore */
             }
            break;
         case OPCODE_BLEND_COLOR:
-           (*ctx->Exec.BlendColorEXT)( n[1].f, n[2].f, n[3].f, n[4].f );
+           (*ctx->Exec->BlendColor)( n[1].f, n[2].f, n[3].f, n[4].f );
            break;
         case OPCODE_BLEND_EQUATION:
-           (*ctx->Exec.BlendEquationEXT)( n[1].e );
+           (*ctx->Exec->BlendEquation)( n[1].e );
            break;
         case OPCODE_BLEND_FUNC:
-           (*ctx->Exec.BlendFunc)( n[1].e, n[2].e );
+           (*ctx->Exec->BlendFunc)( n[1].e, n[2].e );
            break;
         case OPCODE_BLEND_FUNC_SEPARATE:
-           (*ctx->Exec.BlendFuncSeparateINGR)(n[1].e, n[2].e, n[3].e, n[4].e);
+           (*ctx->Exec->BlendFuncSeparateEXT)(n[1].e, n[2].e, n[3].e, n[4].e);
            break;
          case OPCODE_CALL_LIST:
            /* Generated by glCallList(), don't add ListBase */
@@ -3259,22 +3420,22 @@ static void execute_list( GLcontext *ctx, GLuint list )
             }
             break;
         case OPCODE_CLEAR:
-           (*ctx->Exec.Clear)( n[1].bf );
+           (*ctx->Exec->Clear)( n[1].bf );
            break;
         case OPCODE_CLEAR_COLOR:
-           (*ctx->Exec.ClearColor)( n[1].f, n[2].f, n[3].f, n[4].f );
+           (*ctx->Exec->ClearColor)( n[1].f, n[2].f, n[3].f, n[4].f );
            break;
         case OPCODE_CLEAR_ACCUM:
-           (*ctx->Exec.ClearAccum)( n[1].f, n[2].f, n[3].f, n[4].f );
+           (*ctx->Exec->ClearAccum)( n[1].f, n[2].f, n[3].f, n[4].f );
            break;
         case OPCODE_CLEAR_DEPTH:
-           (*ctx->Exec.ClearDepth)( (GLclampd) n[1].f );
+           (*ctx->Exec->ClearDepth)( (GLclampd) n[1].f );
            break;
         case OPCODE_CLEAR_INDEX:
-           (*ctx->Exec.ClearIndex)( n[1].ui );
+           (*ctx->Exec->ClearIndex)( n[1].ui );
            break;
         case OPCODE_CLEAR_STENCIL:
-           (*ctx->Exec.ClearStencil)( n[1].i );
+           (*ctx->Exec->ClearStencil)( n[1].i );
            break;
          case OPCODE_CLIP_PLANE:
             {
@@ -3283,21 +3444,21 @@ static void execute_list( GLcontext *ctx, GLuint list )
                eq[1] = n[3].f;
                eq[2] = n[4].f;
                eq[3] = n[5].f;
-               (*ctx->Exec.ClipPlane)( n[1].e, eq );
+               (*ctx->Exec->ClipPlane)( n[1].e, eq );
             }
             break;
         case OPCODE_COLOR_MASK:
-           (*ctx->Exec.ColorMask)( n[1].b, n[2].b, n[3].b, n[4].b );
+           (*ctx->Exec->ColorMask)( n[1].b, n[2].b, n[3].b, n[4].b );
            break;
         case OPCODE_COLOR_MATERIAL:
-           (*ctx->Exec.ColorMaterial)( n[1].e, n[2].e );
+           (*ctx->Exec->ColorMaterial)( n[1].e, n[2].e );
            break;
          case OPCODE_COLOR_TABLE:
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.ColorTableEXT)( n[1].e, n[2].e, n[3].i, n[4].e,
-                                           n[5].e, n[6].data );
+               (*ctx->Exec->ColorTable)( n[1].e, n[2].e, n[3].i, n[4].e,
+                                         n[5].e, n[6].data );
                ctx->Unpack = save;  /* restore */
             }
             break;
@@ -3305,70 +3466,70 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.ColorSubTableEXT)( n[1].e, n[2].i, n[3].i,
-                                              n[4].e, n[5].e, n[6].data );
+               (*ctx->Exec->ColorSubTable)( n[1].e, n[2].i, n[3].i,
+                                            n[4].e, n[5].e, n[6].data );
                ctx->Unpack = save;  /* restore */
             }
             break;
         case OPCODE_COPY_PIXELS:
-           (*ctx->Exec.CopyPixels)( n[1].i, n[2].i,
+           (*ctx->Exec->CopyPixels)( n[1].i, n[2].i,
                           (GLsizei) n[3].i, (GLsizei) n[4].i, n[5].e );
            break;
          case OPCODE_COPY_TEX_IMAGE1D:
-           (*ctx->Exec.CopyTexImage1D)( n[1].e, n[2].i, n[3].e, n[4].i,
+           (*ctx->Exec->CopyTexImage1D)( n[1].e, n[2].i, n[3].e, n[4].i,
                                          n[5].i, n[6].i, n[7].i );
             break;
          case OPCODE_COPY_TEX_IMAGE2D:
-           (*ctx->Exec.CopyTexImage2D)( n[1].e, n[2].i, n[3].e, n[4].i,
+           (*ctx->Exec->CopyTexImage2D)( n[1].e, n[2].i, n[3].e, n[4].i,
                                          n[5].i, n[6].i, n[7].i, n[8].i );
             break;
          case OPCODE_COPY_TEX_SUB_IMAGE1D:
-           (*ctx->Exec.CopyTexSubImage1D)( n[1].e, n[2].i, n[3].i,
+           (*ctx->Exec->CopyTexSubImage1D)( n[1].e, n[2].i, n[3].i,
                                             n[4].i, n[5].i, n[6].i );
             break;
          case OPCODE_COPY_TEX_SUB_IMAGE2D:
-           (*ctx->Exec.CopyTexSubImage2D)( n[1].e, n[2].i, n[3].i,
+           (*ctx->Exec->CopyTexSubImage2D)( n[1].e, n[2].i, n[3].i,
                                      n[4].i, n[5].i, n[6].i, n[7].i, n[8].i );
             break;
          case OPCODE_COPY_TEX_SUB_IMAGE3D:
-            (*ctx->Exec.CopyTexSubImage3D)( n[1].e, n[2].i, n[3].i,
+            (*ctx->Exec->CopyTexSubImage3D)( n[1].e, n[2].i, n[3].i,
                             n[4].i, n[5].i, n[6].i, n[7].i, n[8].i , n[9].i);
             break;
         case OPCODE_CULL_FACE:
-           (*ctx->Exec.CullFace)( n[1].e );
+           (*ctx->Exec->CullFace)( n[1].e );
            break;
         case OPCODE_DEPTH_FUNC:
-           (*ctx->Exec.DepthFunc)( n[1].e );
+           (*ctx->Exec->DepthFunc)( n[1].e );
            break;
         case OPCODE_DEPTH_MASK:
-           (*ctx->Exec.DepthMask)( n[1].b );
+           (*ctx->Exec->DepthMask)( n[1].b );
            break;
         case OPCODE_DEPTH_RANGE:
-           (*ctx->Exec.DepthRange)( (GLclampd) n[1].f, (GLclampd) n[2].f );
+           (*ctx->Exec->DepthRange)( (GLclampd) n[1].f, (GLclampd) n[2].f );
            break;
         case OPCODE_DISABLE:
-           (*ctx->Exec.Disable)( n[1].e );
+           (*ctx->Exec->Disable)( n[1].e );
            break;
         case OPCODE_DRAW_BUFFER:
-           (*ctx->Exec.DrawBuffer)( n[1].e );
+           (*ctx->Exec->DrawBuffer)( n[1].e );
            break;
         case OPCODE_DRAW_PIXELS:
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.DrawPixels)( n[1].i, n[2].i, n[3].e, n[4].e,
+               (*ctx->Exec->DrawPixels)( n[1].i, n[2].i, n[3].e, n[4].e,
                                         n[5].data );
                ctx->Unpack = save;  /* restore */
             }
            break;
         case OPCODE_ENABLE:
-           (*ctx->Exec.Enable)( n[1].e );
+           (*ctx->Exec->Enable)( n[1].e );
            break;
         case OPCODE_EVALMESH1:
-           (*ctx->Exec.EvalMesh1)( n[1].e, n[2].i, n[3].i );
+           (*ctx->Exec->EvalMesh1)( n[1].e, n[2].i, n[3].i );
            break;
         case OPCODE_EVALMESH2:
-           (*ctx->Exec.EvalMesh2)( n[1].e, n[2].i, n[3].i, n[4].i, n[5].i );
+           (*ctx->Exec->EvalMesh2)( n[1].e, n[2].i, n[3].i, n[4].i, n[5].i );
            break;
         case OPCODE_FOG:
            {
@@ -3377,23 +3538,26 @@ static void execute_list( GLcontext *ctx, GLuint list )
               p[1] = n[3].f;
               p[2] = n[4].f;
               p[3] = n[5].f;
-              (*ctx->Exec.Fogfv)( n[1].e, p );
+              (*ctx->Exec->Fogfv)( n[1].e, p );
            }
            break;
         case OPCODE_FRONT_FACE:
-           (*ctx->Exec.FrontFace)( n[1].e );
+           (*ctx->Exec->FrontFace)( n[1].e );
            break;
          case OPCODE_FRUSTUM:
-            (*ctx->Exec.Frustum)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+            (*ctx->Exec->Frustum)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
             break;
         case OPCODE_HINT:
-           (*ctx->Exec.Hint)( n[1].e, n[2].e );
+           (*ctx->Exec->Hint)( n[1].e, n[2].e );
+           break;
+        case OPCODE_HINT_PGI:
+           (*ctx->Exec->HintPGI)( n[1].e, n[2].i );
            break;
         case OPCODE_INDEX_MASK:
-           (*ctx->Exec.IndexMask)( n[1].ui );
+           (*ctx->Exec->IndexMask)( n[1].ui );
            break;
         case OPCODE_INIT_NAMES:
-           (*ctx->Exec.InitNames)();
+           (*ctx->Exec->InitNames)();
            break;
          case OPCODE_LIGHT:
            {
@@ -3402,7 +3566,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
               p[1] = n[4].f;
               p[2] = n[5].f;
               p[3] = n[6].f;
-              (*ctx->Exec.Lightfv)( n[1].e, n[2].e, p );
+              (*ctx->Exec->Lightfv)( n[1].e, n[2].e, p );
            }
            break;
          case OPCODE_LIGHT_MODEL:
@@ -3412,24 +3576,24 @@ static void execute_list( GLcontext *ctx, GLuint list )
               p[1] = n[3].f;
               p[2] = n[4].f;
               p[3] = n[5].f;
-              (*ctx->Exec.LightModelfv)( n[1].e, p );
+              (*ctx->Exec->LightModelfv)( n[1].e, p );
            }
            break;
         case OPCODE_LINE_STIPPLE:
-           (*ctx->Exec.LineStipple)( n[1].i, n[2].us );
+           (*ctx->Exec->LineStipple)( n[1].i, n[2].us );
            break;
         case OPCODE_LINE_WIDTH:
-           (*ctx->Exec.LineWidth)( n[1].f );
+           (*ctx->Exec->LineWidth)( n[1].f );
            break;
         case OPCODE_LIST_BASE:
-           (*ctx->Exec.ListBase)( n[1].ui );
+           (*ctx->Exec->ListBase)( n[1].ui );
            break;
         case OPCODE_LOAD_IDENTITY:
-            (*ctx->Exec.LoadIdentity)();
+            (*ctx->Exec->LoadIdentity)();
             break;
         case OPCODE_LOAD_MATRIX:
            if (sizeof(Node)==sizeof(GLfloat)) {
-              (*ctx->Exec.LoadMatrixf)( &n[1].f );
+              (*ctx->Exec->LoadMatrixf)( &n[1].f );
            }
            else {
               GLfloat m[16];
@@ -3437,14 +3601,14 @@ static void execute_list( GLcontext *ctx, GLuint list )
               for (i=0;i<16;i++) {
                  m[i] = n[1+i].f;
               }
-              (*ctx->Exec.LoadMatrixf)( m );
+              (*ctx->Exec->LoadMatrixf)( m );
            }
            break;
         case OPCODE_LOAD_NAME:
-           (*ctx->Exec.LoadName)( n[1].ui );
+           (*ctx->Exec->LoadName)( n[1].ui );
            break;
         case OPCODE_LOGIC_OP:
-           (*ctx->Exec.LogicOp)( n[1].e );
+           (*ctx->Exec->LogicOp)( n[1].e );
            break;
         case OPCODE_MAP1:
             {
@@ -3453,7 +3617,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
                GLint uorder = n[5].i;
                GLfloat u1 = n[2].f;
                GLfloat u2 = n[3].f;
-               (*ctx->Exec.Map1f)( target, u1, u2, ustride, uorder,
+               (*ctx->Exec->Map1f)( target, u1, u2, ustride, uorder,
                                    (GLfloat *) n[6].data );
             }
            break;
@@ -3468,23 +3632,23 @@ static void execute_list( GLcontext *ctx, GLuint list )
                GLint vstride = n[7].i;
                GLint uorder = n[8].i;
                GLint vorder = n[9].i;
-               (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder,
+               (*ctx->Exec->Map2f)( target, u1, u2, ustride, uorder,
                                    v1, v2, vstride, vorder,
                                    (GLfloat *) n[10].data );
             }
            break;
         case OPCODE_MAPGRID1:
-           (*ctx->Exec.MapGrid1f)( n[1].i, n[2].f, n[3].f );
+           (*ctx->Exec->MapGrid1f)( n[1].i, n[2].f, n[3].f );
            break;
         case OPCODE_MAPGRID2:
-           (*ctx->Exec.MapGrid2f)( n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
+           (*ctx->Exec->MapGrid2f)( n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
            break;
          case OPCODE_MATRIX_MODE:
-            (*ctx->Exec.MatrixMode)( n[1].e );
+            (*ctx->Exec->MatrixMode)( n[1].e );
             break;
         case OPCODE_MULT_MATRIX:
            if (sizeof(Node)==sizeof(GLfloat)) {
-              (*ctx->Exec.MultMatrixf)( &n[1].f );
+              (*ctx->Exec->MultMatrixf)( &n[1].f );
            }
            else {
               GLfloat m[16];
@@ -3492,26 +3656,26 @@ static void execute_list( GLcontext *ctx, GLuint list )
               for (i=0;i<16;i++) {
                  m[i] = n[1+i].f;
               }
-              (*ctx->Exec.MultMatrixf)( m );
+              (*ctx->Exec->MultMatrixf)( m );
            }
            break;
          case OPCODE_ORTHO:
-            (*ctx->Exec.Ortho)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
+            (*ctx->Exec->Ortho)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f );
             break;
         case OPCODE_PASSTHROUGH:
-           (*ctx->Exec.PassThrough)( n[1].f );
+           (*ctx->Exec->PassThrough)( n[1].f );
            break;
         case OPCODE_PIXEL_MAP:
-           (*ctx->Exec.PixelMapfv)( n[1].e, n[2].i, (GLfloat *) n[3].data );
+           (*ctx->Exec->PixelMapfv)( n[1].e, n[2].i, (GLfloat *) n[3].data );
            break;
         case OPCODE_PIXEL_TRANSFER:
-           (*ctx->Exec.PixelTransferf)( n[1].e, n[2].f );
+           (*ctx->Exec->PixelTransferf)( n[1].e, n[2].f );
            break;
         case OPCODE_PIXEL_ZOOM:
-           (*ctx->Exec.PixelZoom)( n[1].f, n[2].f );
+           (*ctx->Exec->PixelZoom)( n[1].f, n[2].f );
            break;
         case OPCODE_POINT_SIZE:
-           (*ctx->Exec.PointSize)( n[1].f );
+           (*ctx->Exec->PointSize)( n[1].f );
            break;
         case OPCODE_POINT_PARAMETERS:
            {
@@ -3519,65 +3683,65 @@ static void execute_list( GLcontext *ctx, GLuint list )
                params[0] = n[2].f;
                params[1] = n[3].f;
                params[2] = n[4].f;
-               (*ctx->Exec.PointParameterfvEXT)( n[1].e, params ); 
+               (*ctx->Exec->PointParameterfvEXT)( n[1].e, params ); 
            }
            break;
         case OPCODE_POLYGON_MODE:
-           (*ctx->Exec.PolygonMode)( n[1].e, n[2].e );
+           (*ctx->Exec->PolygonMode)( n[1].e, n[2].e );
            break;
         case OPCODE_POLYGON_STIPPLE:
-           (*ctx->Exec.PolygonStipple)( (GLubyte *) n[1].data );
+           (*ctx->Exec->PolygonStipple)( (GLubyte *) n[1].data );
            break;
         case OPCODE_POLYGON_OFFSET:
-           (*ctx->Exec.PolygonOffset)( n[1].f, n[2].f );
+           (*ctx->Exec->PolygonOffset)( n[1].f, n[2].f );
            break;
         case OPCODE_POP_ATTRIB:
-           (*ctx->Exec.PopAttrib)();
+           (*ctx->Exec->PopAttrib)();
            break;
         case OPCODE_POP_MATRIX:
-           (*ctx->Exec.PopMatrix)();
+           (*ctx->Exec->PopMatrix)();
            break;
         case OPCODE_POP_NAME:
-           (*ctx->Exec.PopName)();
+           (*ctx->Exec->PopName)();
            break;
         case OPCODE_PRIORITIZE_TEXTURE:
-            (*ctx->Exec.PrioritizeTextures)( 1, &n[1].ui, &n[2].f );
+            (*ctx->Exec->PrioritizeTextures)( 1, &n[1].ui, &n[2].f );
            break;
         case OPCODE_PUSH_ATTRIB:
-           (*ctx->Exec.PushAttrib)( n[1].bf );
+           (*ctx->Exec->PushAttrib)( n[1].bf );
            break;
         case OPCODE_PUSH_MATRIX:
-           (*ctx->Exec.PushMatrix)();
+           (*ctx->Exec->PushMatrix)();
            break;
         case OPCODE_PUSH_NAME:
-           (*ctx->Exec.PushName)( n[1].ui );
+           (*ctx->Exec->PushName)( n[1].ui );
            break;
         case OPCODE_RASTER_POS:
-            (*ctx->Exec.RasterPos4f)( n[1].f, n[2].f, n[3].f, n[4].f );
+            (*ctx->Exec->RasterPos4f)( n[1].f, n[2].f, n[3].f, n[4].f );
            break;
         case OPCODE_READ_BUFFER:
-           (*ctx->Exec.ReadBuffer)( n[1].e );
+           (*ctx->Exec->ReadBuffer)( n[1].e );
            break;
          case OPCODE_RECTF:
-            (*ctx->Exec.Rectf)( n[1].f, n[2].f, n[3].f, n[4].f );
+            (*ctx->Exec->Rectf)( n[1].f, n[2].f, n[3].f, n[4].f );
             break;
          case OPCODE_SCALE:
-            (*ctx->Exec.Scalef)( n[1].f, n[2].f, n[3].f );
+            (*ctx->Exec->Scalef)( n[1].f, n[2].f, n[3].f );
             break;
         case OPCODE_SCISSOR:
-           (*ctx->Exec.Scissor)( n[1].i, n[2].i, n[3].i, n[4].i );
+           (*ctx->Exec->Scissor)( n[1].i, n[2].i, n[3].i, n[4].i );
            break;
         case OPCODE_SHADE_MODEL:
-           (*ctx->Exec.ShadeModel)( n[1].e );
+           (*ctx->Exec->ShadeModel)( n[1].e );
            break;
         case OPCODE_STENCIL_FUNC:
-           (*ctx->Exec.StencilFunc)( n[1].e, n[2].i, n[3].ui );
+           (*ctx->Exec->StencilFunc)( n[1].e, n[2].i, n[3].ui );
            break;
         case OPCODE_STENCIL_MASK:
-           (*ctx->Exec.StencilMask)( n[1].ui );
+           (*ctx->Exec->StencilMask)( n[1].ui );
            break;
         case OPCODE_STENCIL_OP:
-           (*ctx->Exec.StencilOp)( n[1].e, n[2].e, n[3].e );
+           (*ctx->Exec->StencilOp)( n[1].e, n[2].e, n[3].e );
            break;
          case OPCODE_TEXENV:
             {
@@ -3586,7 +3750,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
                params[1] = n[4].f;
                params[2] = n[5].f;
                params[3] = n[6].f;
-               (*ctx->Exec.TexEnvfv)( n[1].e, n[2].e, params );
+               (*ctx->Exec->TexEnvfv)( n[1].e, n[2].e, params );
             }
             break;
          case OPCODE_TEXGEN:
@@ -3596,7 +3760,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
                params[1] = n[4].f;
                params[2] = n[5].f;
                params[3] = n[6].f;
-               (*ctx->Exec.TexGenfv)( n[1].e, n[2].e, params );
+               (*ctx->Exec->TexGenfv)( n[1].e, n[2].e, params );
             }
             break;
          case OPCODE_TEXPARAMETER:
@@ -3606,14 +3770,14 @@ static void execute_list( GLcontext *ctx, GLuint list )
                params[1] = n[4].f;
                params[2] = n[5].f;
                params[3] = n[6].f;
-               (*ctx->Exec.TexParameterfv)( n[1].e, n[2].e, params );
+               (*ctx->Exec->TexParameterfv)( n[1].e, n[2].e, params );
             }
             break;
         case OPCODE_TEX_IMAGE1D:
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexImage1D)(
+               (*ctx->Exec->TexImage1D)(
                                         n[1].e, /* target */
                                         n[2].i, /* level */
                                         n[3].i, /* components */
@@ -3629,7 +3793,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexImage2D)(
+               (*ctx->Exec->TexImage2D)(
                                         n[1].e, /* target */
                                         n[2].i, /* level */
                                         n[3].i, /* components */
@@ -3646,7 +3810,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexImage3D)(
+               (*ctx->Exec->TexImage3D)(
                                         n[1].e, /* target */
                                         n[2].i, /* level */
                                         n[3].i, /* components */
@@ -3664,7 +3828,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexSubImage1D)( n[1].e, n[2].i, n[3].i,
+               (*ctx->Exec->TexSubImage1D)( n[1].e, n[2].i, n[3].i,
                                            n[4].i, n[5].e,
                                            n[6].e, n[7].data );
                ctx->Unpack = save;  /* restore */
@@ -3674,7 +3838,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexSubImage2D)( n[1].e, n[2].i, n[3].i,
+               (*ctx->Exec->TexSubImage2D)( n[1].e, n[2].i, n[3].i,
                                            n[4].i, n[5].e,
                                            n[6].i, n[7].e, n[8].e, n[9].data );
                ctx->Unpack = save;  /* restore */
@@ -3684,7 +3848,7 @@ static void execute_list( GLcontext *ctx, GLuint list )
             {
                struct gl_pixelstore_attrib save = ctx->Unpack;
                ctx->Unpack = _mesa_native_packing;
-               (*ctx->Exec.TexSubImage3D)( n[1].e, n[2].i, n[3].i,
+               (*ctx->Exec->TexSubImage3D)( n[1].e, n[2].i, n[3].i,
                                            n[4].i, n[5].i, n[6].i, n[7].i,
                                            n[8].i, n[9].e, n[10].e,
                                            n[11].data );
@@ -3692,20 +3856,20 @@ static void execute_list( GLcontext *ctx, GLuint list )
             }
             break;
          case OPCODE_TRANSLATE:
-            (*ctx->Exec.Translatef)( n[1].f, n[2].f, n[3].f );
+            (*ctx->Exec->Translatef)( n[1].f, n[2].f, n[3].f );
             break;
         case OPCODE_VIEWPORT:
-           (*ctx->Exec.Viewport)(n[1].i, n[2].i,
+           (*ctx->Exec->Viewport)(n[1].i, n[2].i,
                                   (GLsizei) n[3].i, (GLsizei) n[4].i);
            break;
         case OPCODE_WINDOW_POS:
-            (*ctx->Exec.WindowPos4fMESA)( n[1].f, n[2].f, n[3].f, n[4].f );
+            (*ctx->Exec->WindowPos4fMESA)( n[1].f, n[2].f, n[3].f, n[4].f );
            break;
          case OPCODE_ACTIVE_TEXTURE:  /* GL_ARB_multitexture */
-            (*ctx->Exec.ActiveTextureARB)( n[1].e );
+            (*ctx->Exec->ActiveTextureARB)( n[1].e );
             break;
          case OPCODE_CLIENT_ACTIVE_TEXTURE:  /* GL_ARB_multitexture */
-            (*ctx->Exec.ClientActiveTextureARB)( n[1].e );
+            (*ctx->Exec->ClientActiveTextureARB)( n[1].e );
             break;
         case OPCODE_CONTINUE:
            n = (Node *) n[1].next;
@@ -3793,14 +3957,22 @@ _mesa_GenLists(GLsizei range )
       return 0;
    }
 
-   base = HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
+   /*
+    * Make this an atomic operation
+    */
+   _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+
+   base = _mesa_HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
    if (base) {
       /* reserve the list IDs by with empty/dummy lists */
       GLint i;
       for (i=0; i<range; i++) {
-         HashInsert(ctx->Shared->DisplayList, base+i, make_empty_list());
+         _mesa_HashInsert(ctx->Shared->DisplayList, base+i, make_empty_list());
       }
    }
+
+   _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+
    return base;
 }
 
@@ -3849,7 +4021,7 @@ _mesa_NewList( GLuint list, GLenum mode )
    ctx->CompileCVAFlag = GL_FALSE;
    ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
 
-   ctx->CurrentDispatch = &ctx->Save;
+   ctx->CurrentDispatch = ctx->Save;
    _glapi_set_dispatch( ctx->CurrentDispatch );
 }
 
@@ -3878,7 +4050,7 @@ _mesa_EndList( void )
    /* Destroy old list, if any */
    gl_destroy_list(ctx, ctx->CurrentListNum);
    /* Install the list */
-   HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr);
+   _mesa_HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr);
 
 
    if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
@@ -3902,7 +4074,7 @@ _mesa_EndList( void )
     */
    ctx->NewState = ~0;
 
-   ctx->CurrentDispatch = &ctx->Exec;
+   ctx->CurrentDispatch = ctx->Exec;
    _glapi_set_dispatch( ctx->CurrentDispatch );
 }
 
@@ -3930,7 +4102,7 @@ _mesa_CallList( GLuint list )
 
    /* also restore API function pointers to point to "save" versions */
    if (save_compile_flag) {
-      ctx->CurrentDispatch = &ctx->Save;
+      ctx->CurrentDispatch = ctx->Save;
       _glapi_set_dispatch( ctx->CurrentDispatch );
    }
 }
@@ -3965,7 +4137,7 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists )
 
    /* also restore API function pointers to point to "save" versions */
    if (save_compile_flag) {
-      ctx->CurrentDispatch = &ctx->Save;
+      ctx->CurrentDispatch = ctx->Save;
       _glapi_set_dispatch( ctx->CurrentDispatch );
    }
 
@@ -3995,6 +4167,9 @@ _mesa_ListBase( GLuint base )
 void
 _mesa_init_dlist_table( struct _glapi_table *table )
 {
+   _mesa_init_no_op_table(table);
+
+   /* GL 1.0 */
    table->Accum = save_Accum;
    table->AlphaFunc = save_AlphaFunc;
    table->Begin = save_Begin;
@@ -4303,7 +4478,7 @@ _mesa_init_dlist_table( struct _glapi_table *table )
    table->Vertex4sv = _mesa_Vertex4sv;
    table->Viewport = save_Viewport;
 
-#ifdef _GLAPI_VERSION_1_1
+   /* GL 1.1 */
    table->AreTexturesResident = _mesa_AreTexturesResident;
    table->ArrayElement = _mesa_ArrayElement;
    table->BindTexture = save_BindTexture;
@@ -4333,21 +4508,19 @@ _mesa_init_dlist_table( struct _glapi_table *table )
    table->TexSubImage1D = save_TexSubImage1D;
    table->TexSubImage2D = save_TexSubImage2D;
    table->VertexPointer = _mesa_VertexPointer;
-#endif
 
-#ifdef _GLAPI_VERSION_1_2
+   /* GL 1.2 */
    table->CopyTexSubImage3D = save_CopyTexSubImage3D;
    table->DrawRangeElements = _mesa_DrawRangeElements;
    table->TexImage3D = save_TexImage3D;
    table->TexSubImage3D = save_TexSubImage3D;
-#endif
 
-#ifdef _GLAPI_ARB_imaging
-   /* NOT supported, just call stub functions */
-   table->BlendColor = _mesa_BlendColor;
-   table->BlendEquation = _mesa_BlendEquation;
-   table->ColorSubTable = _mesa_ColorSubTable;
-   table->ColorTable = _mesa_ColorTable;
+   /* GL_ARB_imaging */
+   /* Not all are supported */
+   table->BlendColor = save_BlendColor;
+   table->BlendEquation = save_BlendEquation;
+   table->ColorSubTable = save_ColorSubTable;
+   table->ColorTable = save_ColorTable;
    table->ColorTableParameterfv = _mesa_ColorTableParameterfv;
    table->ColorTableParameteriv = _mesa_ColorTableParameteriv;
    table->ConvolutionFilter1D = _mesa_ConvolutionFilter1D;
@@ -4378,39 +4551,48 @@ _mesa_init_dlist_table( struct _glapi_table *table )
    table->ResetHistogram = _mesa_ResetHistogram;
    table->ResetMinmax = _mesa_ResetMinmax;
    table->SeparableFilter2D = _mesa_SeparableFilter2D;
+
+   /* GL_EXT_texture3d */
+#if 0
+   table->CopyTexSubImage3DEXT = save_CopyTexSubImage3D;
+   table->TexImage3DEXT = save_TexImage3DEXT;
+   table->TexSubImage3DEXT = save_TexSubImage3D;
 #endif
 
-#ifdef _GLAPI_EXT_paletted_texture
-   table->ColorTableEXT = save_ColorTableEXT;
-   table->ColorSubTableEXT = save_ColorSubTableEXT;
-   table->GetColorTableEXT = _mesa_GetColorTableEXT;
-   table->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfvEXT;
-   table->GetColorTableParameterivEXT = _mesa_GetColorTableParameterivEXT;
+   /* GL_EXT_paletted_texture */
+#if 0
+   table->ColorTableEXT = save_ColorTable;
+   table->ColorSubTableEXT = save_ColorSubTable;
 #endif
+   table->GetColorTableEXT = _mesa_GetColorTable;
+   table->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
+   table->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
 
-#ifdef _GLAPI_EXT_compiled_vertex_array
+   /* GL_EXT_compiled_vertex_array */
    table->LockArraysEXT = _mesa_LockArraysEXT;
    table->UnlockArraysEXT = _mesa_UnlockArraysEXT;
-#endif
 
-#ifdef _GLAPI_EXT_point_parameters
+   /* GL_EXT_point_parameters */
    table->PointParameterfEXT = save_PointParameterfEXT;
    table->PointParameterfvEXT = save_PointParameterfvEXT;
-#endif
 
-#ifdef _GLAPI_EXT_polygon_offset
+   /* GL_PGI_misc_hints */
+   table->HintPGI = save_HintPGI;
+
+   /* GL_EXT_polygon_offset */
    table->PolygonOffsetEXT = save_PolygonOffsetEXT;
-#endif
 
-#ifdef _GLAPI_EXT_blend_minmax
-   table->BlendEquationEXT = save_BlendEquation;
+   /* GL_EXT_blend_minmax */
+#if 0
+   table->BlendEquationEXT = save_BlendEquationEXT;
 #endif
 
-#ifdef _GLAPI_EXT_blend_color
-   table->BlendColorEXT = save_BlendColor;
+   /* GL_EXT_blend_color */
+#if 0 
+   table->BlendColorEXT = save_BlendColorEXT;
 #endif
 
-#ifdef _GLAPI_ARB_multitexture
+   /* GL_ARB_multitexture */
    table->ActiveTextureARB = save_ActiveTextureARB;
    table->ClientActiveTextureARB = save_ClientActiveTextureARB;
    table->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
@@ -4445,19 +4627,45 @@ _mesa_init_dlist_table( struct _glapi_table *table )
    table->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB;
    table->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
    table->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
-#endif
-
-#ifdef _GLAPI_INGR_blend_func_separate
-   table->BlendFuncSeparateINGR = save_BlendFuncSeparateINGR;
-#endif
 
-#ifdef _GLAPI_MESA_window_pos
+   /* GL_EXT_blend_func_separate */
+   table->BlendFuncSeparateEXT = save_BlendFuncSeparateEXT;
+
+   /* GL_MESA_window_pos */
+   table->WindowPos2dMESA = save_WindowPos2dMESA;
+   table->WindowPos2dvMESA = save_WindowPos2dvMESA;
+   table->WindowPos2fMESA = save_WindowPos2fMESA;
+   table->WindowPos2fvMESA = save_WindowPos2fvMESA;
+   table->WindowPos2iMESA = save_WindowPos2iMESA;
+   table->WindowPos2ivMESA = save_WindowPos2ivMESA;
+   table->WindowPos2sMESA = save_WindowPos2sMESA;
+   table->WindowPos2svMESA = save_WindowPos2svMESA;
+   table->WindowPos3dMESA = save_WindowPos3dMESA;
+   table->WindowPos3dvMESA = save_WindowPos3dvMESA;
+   table->WindowPos3fMESA = save_WindowPos3fMESA;
+   table->WindowPos3fvMESA = save_WindowPos3fvMESA;
+   table->WindowPos3iMESA = save_WindowPos3iMESA;
+   table->WindowPos3ivMESA = save_WindowPos3ivMESA;
+   table->WindowPos3sMESA = save_WindowPos3sMESA;
+   table->WindowPos3svMESA = save_WindowPos3svMESA;
+   table->WindowPos4dMESA = save_WindowPos4dMESA;
+   table->WindowPos4dvMESA = save_WindowPos4dvMESA;
    table->WindowPos4fMESA = save_WindowPos4fMESA;
-#endif
+   table->WindowPos4fvMESA = save_WindowPos4fvMESA;
+   table->WindowPos4iMESA = save_WindowPos4iMESA;
+   table->WindowPos4ivMESA = save_WindowPos4ivMESA;
+   table->WindowPos4sMESA = save_WindowPos4sMESA;
+   table->WindowPos4svMESA = save_WindowPos4svMESA;
 
-#ifdef _GLAPI_MESA_resize_buffers
+   /* GL_MESA_resize_buffers */
    table->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
-#endif
+
+   /* GL_ARB_transpose_matrix */
+   table->LoadTransposeMatrixdARB = save_LoadTransposeMatrixdARB;
+   table->LoadTransposeMatrixfARB = save_LoadTransposeMatrixfARB;
+   table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
+   table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
+
 }
 
 
@@ -4486,7 +4694,7 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
       return;
    }
 
-   n = (Node *) HashLookup(ctx->Shared->DisplayList, list);
+   n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list);
 
    fprintf( f, "START-LIST %u, address %p\n", list, (void*)n );
 
@@ -4592,6 +4800,7 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list )
                    ((struct immediate *) n[1].data)->id,
                    n[2].ui,
                    n[3].ui);
+           gl_print_cassette( (struct immediate *) n[1].data );
            break;
         case OPCODE_CONTINUE:
             fprintf(f,"DISPLAY-LIST-CONTINUE\n");