Support ARB_texture_env_crossbar. Changes the way programs are
[mesa.git] / src / mesa / main / vtxfmt.c
index d7b18e4c1cc9aba9feb6f747c7a2dbcb2de29500..1496fd1c00b1d5c760aa73ab113e0ad9f7f1d7a5 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  6.3
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  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"),
@@ -50,6 +49,7 @@
 {                                                                      \
    GET_CURRENT_CONTEXT(ctx);                                           \
    struct gl_tnl_module *tnl = &(ctx->TnlModule);                      \
+   typedef void (*func_ptr_t)(void);                                   \
                                                                        \
    ASSERT( tnl->Current );                                             \
    ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES );               \
@@ -57,7 +57,7 @@
    /* Save the swapped function's dispatch entry so it can be */       \
    /* restored later. */                                               \
    tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC);       \
-   tnl->Swapped[tnl->SwapCount][1] = (void *)TAG(FUNC);                        \
+   *(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC);    \
    tnl->SwapCount++;                                                   \
                                                                        \
    if ( 0 )                                                            \
 
 
 
-static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
+static void
+install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
 {
    tab->ArrayElement = vfmt->ArrayElement;
    tab->Color3f = vfmt->Color3f;
    tab->Color3fv = vfmt->Color3fv;
-   tab->Color3ub = vfmt->Color3ub;
-   tab->Color3ubv = vfmt->Color3ubv;
    tab->Color4f = vfmt->Color4f;
    tab->Color4fv = vfmt->Color4fv;
-   tab->Color4ub = vfmt->Color4ub;
-   tab->Color4ubv = vfmt->Color4ubv;
    tab->EdgeFlag = vfmt->EdgeFlag;
    tab->EdgeFlagv = vfmt->EdgeFlagv;
    tab->EvalCoord1f = vfmt->EvalCoord1f;
@@ -93,8 +90,8 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
    tab->EvalPoint2 = vfmt->EvalPoint2;
    tab->FogCoordfEXT = vfmt->FogCoordfEXT;
    tab->FogCoordfvEXT = vfmt->FogCoordfvEXT;
-   tab->Indexi = vfmt->Indexi;
-   tab->Indexiv = vfmt->Indexiv;
+   tab->Indexf = vfmt->Indexf;
+   tab->Indexfv = vfmt->Indexfv;
    tab->Materialfv = vfmt->Materialfv;
    tab->MultiTexCoord1fARB = vfmt->MultiTexCoord1fARB;
    tab->MultiTexCoord1fvARB = vfmt->MultiTexCoord1fvARB;
@@ -108,8 +105,6 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
    tab->Normal3fv = vfmt->Normal3fv;
    tab->SecondaryColor3fEXT = vfmt->SecondaryColor3fEXT;
    tab->SecondaryColor3fvEXT = vfmt->SecondaryColor3fvEXT;
-   tab->SecondaryColor3ubEXT = vfmt->SecondaryColor3ubEXT;
-   tab->SecondaryColor3ubvEXT = vfmt->SecondaryColor3ubvEXT;
    tab->TexCoord1f = vfmt->TexCoord1f;
    tab->TexCoord1fv = vfmt->TexCoord1fv;
    tab->TexCoord2f = vfmt->TexCoord2f;
@@ -125,16 +120,32 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
    tab->Vertex4f = vfmt->Vertex4f;
    tab->Vertex4fv = vfmt->Vertex4fv;
    tab->CallList = vfmt->CallList;
+   tab->CallLists = vfmt->CallLists;
    tab->Begin = vfmt->Begin;
    tab->End = vfmt->End;
+   tab->VertexAttrib1fNV = vfmt->VertexAttrib1fNV;
+   tab->VertexAttrib1fvNV = vfmt->VertexAttrib1fvNV;
+   tab->VertexAttrib2fNV = vfmt->VertexAttrib2fNV;
+   tab->VertexAttrib2fvNV = vfmt->VertexAttrib2fvNV;
+   tab->VertexAttrib3fNV = vfmt->VertexAttrib3fNV;
+   tab->VertexAttrib3fvNV = vfmt->VertexAttrib3fvNV;
    tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV;
+   tab->VertexAttrib4fvNV = vfmt->VertexAttrib4fvNV;
+   tab->VertexAttrib1fARB = vfmt->VertexAttrib1fARB;
+   tab->VertexAttrib1fvARB = vfmt->VertexAttrib1fvARB;
+   tab->VertexAttrib2fARB = vfmt->VertexAttrib2fARB;
+   tab->VertexAttrib2fvARB = vfmt->VertexAttrib2fvARB;
+   tab->VertexAttrib3fARB = vfmt->VertexAttrib3fARB;
+   tab->VertexAttrib3fvARB = vfmt->VertexAttrib3fvARB;
+   tab->VertexAttrib4fARB = vfmt->VertexAttrib4fARB;
+   tab->VertexAttrib4fvARB = vfmt->VertexAttrib4fvARB;
    tab->Rectf = vfmt->Rectf;
    tab->DrawArrays = vfmt->DrawArrays;
    tab->DrawElements = vfmt->DrawElements;
    tab->DrawRangeElements = vfmt->DrawRangeElements;
    tab->EvalMesh1 = vfmt->EvalMesh1;
    tab->EvalMesh2 = vfmt->EvalMesh2;
-   assert(tab->EvalMesh2);
+   ASSERT(tab->EvalMesh2);
 }
 
 
@@ -145,19 +156,16 @@ void _mesa_init_exec_vtxfmt( GLcontext *ctx )
 }
 
 
-void _mesa_install_exec_vtxfmt( GLcontext *ctx, GLvertexformat *vfmt )
+void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt )
 {
    ctx->TnlModule.Current = vfmt;
    _mesa_restore_exec_vtxfmt( ctx );
-   if ( ctx->ExecPrefersFloat != vfmt->prefer_float_colors )
-      _mesa_loopback_prefer_float( ctx->Exec, vfmt->prefer_float_colors );
 }
 
-void _mesa_install_save_vtxfmt( GLcontext *ctx, GLvertexformat *vfmt )
+
+void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt )
 {
    install_vtxfmt( ctx->Save, vfmt );
-   if ( ctx->SavePrefersFloat != vfmt->prefer_float_colors )
-      _mesa_loopback_prefer_float( ctx->Save, vfmt->prefer_float_colors );
 }