2003-04-17 02:33:08 +00:00
|
|
|
/* $Id: state.c,v 1.104 2003/04/17 02:33:09 brianp Exp $ */
|
2000-02-02 19:15:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Mesa 3-D graphics library
|
2003-03-01 01:50:20 +00:00
|
|
|
* Version: 5.1
|
2000-02-02 19:15:19 +00:00
|
|
|
*
|
2003-03-01 01:50:20 +00:00
|
|
|
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
2000-02-02 19:15:19 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included
|
|
|
|
* in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2000-02-02 19:34:08 +00:00
|
|
|
/*
|
2003-03-29 17:01:00 +00:00
|
|
|
* /brief This file manages recalculation of derived values in the
|
|
|
|
* __GLcontext. Also, this is where we initialize the API dispatch table.
|
2000-02-02 19:34:08 +00:00
|
|
|
*/
|
|
|
|
|
2000-02-02 19:15:19 +00:00
|
|
|
|
|
|
|
#include "glheader.h"
|
|
|
|
#include "accum.h"
|
2000-11-24 10:25:05 +00:00
|
|
|
#include "api_loopback.h"
|
2003-04-17 02:33:08 +00:00
|
|
|
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
|
|
|
|
#include "arbprogram.h"
|
|
|
|
#endif
|
2000-02-02 19:15:19 +00:00
|
|
|
#include "attrib.h"
|
|
|
|
#include "blend.h"
|
2003-03-29 17:01:00 +00:00
|
|
|
#if FEATURE_ARB_vertex_buffer_object
|
|
|
|
#include "bufferobj.h"
|
|
|
|
#endif
|
2000-02-02 19:15:19 +00:00
|
|
|
#include "buffers.h"
|
|
|
|
#include "clip.h"
|
|
|
|
#include "colortab.h"
|
|
|
|
#include "context.h"
|
2000-08-23 14:33:04 +00:00
|
|
|
#include "convolve.h"
|
2000-02-02 19:15:19 +00:00
|
|
|
#include "depth.h"
|
|
|
|
#include "dlist.h"
|
|
|
|
#include "drawpix.h"
|
|
|
|
#include "enable.h"
|
|
|
|
#include "eval.h"
|
|
|
|
#include "get.h"
|
|
|
|
#include "feedback.h"
|
|
|
|
#include "fog.h"
|
|
|
|
#include "hint.h"
|
2000-11-10 18:06:14 +00:00
|
|
|
#include "histogram.h"
|
2003-03-01 01:50:20 +00:00
|
|
|
#include "imports.h"
|
2000-02-02 19:15:19 +00:00
|
|
|
#include "light.h"
|
|
|
|
#include "lines.h"
|
|
|
|
#include "matrix.h"
|
|
|
|
#include "pixel.h"
|
|
|
|
#include "points.h"
|
|
|
|
#include "polygon.h"
|
|
|
|
#include "rastpos.h"
|
|
|
|
#include "state.h"
|
|
|
|
#include "stencil.h"
|
|
|
|
#include "teximage.h"
|
|
|
|
#include "texobj.h"
|
|
|
|
#include "texstate.h"
|
2000-11-22 07:32:16 +00:00
|
|
|
#include "mtypes.h"
|
2000-02-02 19:15:19 +00:00
|
|
|
#include "varray.h"
|
2003-01-14 04:55:45 +00:00
|
|
|
#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
|
|
|
|
#include "nvprogram.h"
|
2002-10-16 17:57:51 +00:00
|
|
|
#endif
|
2003-04-08 02:27:16 +00:00
|
|
|
#if FEATURE_NV_fragment_program
|
|
|
|
#include "nvfragprog.h"
|
|
|
|
#endif
|
2000-11-16 21:05:34 +00:00
|
|
|
|
|
|
|
#include "math/m_matrix.h"
|
|
|
|
#include "math/m_xform.h"
|
2000-02-02 19:15:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
generic_noop(void)
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
2002-10-02 21:44:08 +00:00
|
|
|
_mesa_problem(NULL, "User called no-op dispatch function");
|
2000-02-02 19:15:19 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-05-24 15:04:45 +00:00
|
|
|
/*
|
|
|
|
* Set all pointers in the given dispatch table to point to a
|
|
|
|
* generic no-op function.
|
|
|
|
*/
|
2000-02-02 19:15:19 +00:00
|
|
|
void
|
2000-05-24 15:04:45 +00:00
|
|
|
_mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize)
|
2000-02-02 19:15:19 +00:00
|
|
|
{
|
2000-05-24 15:04:45 +00:00
|
|
|
GLuint i;
|
|
|
|
void **dispatch = (void **) table;
|
|
|
|
for (i = 0; i < tableSize; i++) {
|
|
|
|
dispatch[i] = (void *) generic_noop;
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
|
2000-02-02 19:15:19 +00:00
|
|
|
/*
|
|
|
|
* Initialize the given dispatch table with pointers to Mesa's
|
|
|
|
* immediate-mode commands.
|
2000-11-24 10:25:05 +00:00
|
|
|
*
|
|
|
|
* Pointers to begin/end object commands and a few others
|
|
|
|
* are provided via the vtxfmt interface elsewhere.
|
2000-02-02 19:15:19 +00:00
|
|
|
*/
|
|
|
|
void
|
2000-05-24 15:04:45 +00:00
|
|
|
_mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
|
2000-02-02 19:15:19 +00:00
|
|
|
{
|
|
|
|
/* first initialize all dispatch slots to no-op */
|
2000-05-24 15:04:45 +00:00
|
|
|
_mesa_init_no_op_table(exec, tableSize);
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2001-05-10 15:42:42 +00:00
|
|
|
_mesa_loopback_init_api_table( exec, GL_TRUE );
|
2000-11-24 10:25:05 +00:00
|
|
|
|
2000-02-02 19:15:19 +00:00
|
|
|
/* load the dispatch slots we understand */
|
|
|
|
exec->Accum = _mesa_Accum;
|
|
|
|
exec->AlphaFunc = _mesa_AlphaFunc;
|
|
|
|
exec->Bitmap = _mesa_Bitmap;
|
|
|
|
exec->BlendFunc = _mesa_BlendFunc;
|
|
|
|
exec->CallList = _mesa_CallList;
|
|
|
|
exec->CallLists = _mesa_CallLists;
|
|
|
|
exec->Clear = _mesa_Clear;
|
|
|
|
exec->ClearAccum = _mesa_ClearAccum;
|
|
|
|
exec->ClearColor = _mesa_ClearColor;
|
|
|
|
exec->ClearDepth = _mesa_ClearDepth;
|
|
|
|
exec->ClearIndex = _mesa_ClearIndex;
|
|
|
|
exec->ClearStencil = _mesa_ClearStencil;
|
|
|
|
exec->ClipPlane = _mesa_ClipPlane;
|
|
|
|
exec->ColorMask = _mesa_ColorMask;
|
|
|
|
exec->ColorMaterial = _mesa_ColorMaterial;
|
|
|
|
exec->CopyPixels = _mesa_CopyPixels;
|
|
|
|
exec->CullFace = _mesa_CullFace;
|
|
|
|
exec->DeleteLists = _mesa_DeleteLists;
|
|
|
|
exec->DepthFunc = _mesa_DepthFunc;
|
|
|
|
exec->DepthMask = _mesa_DepthMask;
|
|
|
|
exec->DepthRange = _mesa_DepthRange;
|
|
|
|
exec->Disable = _mesa_Disable;
|
|
|
|
exec->DrawBuffer = _mesa_DrawBuffer;
|
|
|
|
exec->DrawPixels = _mesa_DrawPixels;
|
|
|
|
exec->Enable = _mesa_Enable;
|
|
|
|
exec->EndList = _mesa_EndList;
|
|
|
|
exec->FeedbackBuffer = _mesa_FeedbackBuffer;
|
|
|
|
exec->Finish = _mesa_Finish;
|
|
|
|
exec->Flush = _mesa_Flush;
|
2000-10-27 16:44:40 +00:00
|
|
|
exec->FogCoordPointerEXT = _mesa_FogCoordPointerEXT;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->Fogf = _mesa_Fogf;
|
|
|
|
exec->Fogfv = _mesa_Fogfv;
|
|
|
|
exec->Fogi = _mesa_Fogi;
|
|
|
|
exec->Fogiv = _mesa_Fogiv;
|
|
|
|
exec->FrontFace = _mesa_FrontFace;
|
|
|
|
exec->Frustum = _mesa_Frustum;
|
|
|
|
exec->GenLists = _mesa_GenLists;
|
|
|
|
exec->GetBooleanv = _mesa_GetBooleanv;
|
|
|
|
exec->GetClipPlane = _mesa_GetClipPlane;
|
|
|
|
exec->GetDoublev = _mesa_GetDoublev;
|
|
|
|
exec->GetError = _mesa_GetError;
|
|
|
|
exec->GetFloatv = _mesa_GetFloatv;
|
|
|
|
exec->GetIntegerv = _mesa_GetIntegerv;
|
|
|
|
exec->GetLightfv = _mesa_GetLightfv;
|
|
|
|
exec->GetLightiv = _mesa_GetLightiv;
|
|
|
|
exec->GetMapdv = _mesa_GetMapdv;
|
|
|
|
exec->GetMapfv = _mesa_GetMapfv;
|
|
|
|
exec->GetMapiv = _mesa_GetMapiv;
|
|
|
|
exec->GetMaterialfv = _mesa_GetMaterialfv;
|
|
|
|
exec->GetMaterialiv = _mesa_GetMaterialiv;
|
|
|
|
exec->GetPixelMapfv = _mesa_GetPixelMapfv;
|
|
|
|
exec->GetPixelMapuiv = _mesa_GetPixelMapuiv;
|
|
|
|
exec->GetPixelMapusv = _mesa_GetPixelMapusv;
|
|
|
|
exec->GetPolygonStipple = _mesa_GetPolygonStipple;
|
|
|
|
exec->GetString = _mesa_GetString;
|
|
|
|
exec->GetTexEnvfv = _mesa_GetTexEnvfv;
|
|
|
|
exec->GetTexEnviv = _mesa_GetTexEnviv;
|
|
|
|
exec->GetTexGendv = _mesa_GetTexGendv;
|
|
|
|
exec->GetTexGenfv = _mesa_GetTexGenfv;
|
|
|
|
exec->GetTexGeniv = _mesa_GetTexGeniv;
|
|
|
|
exec->GetTexImage = _mesa_GetTexImage;
|
|
|
|
exec->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv;
|
|
|
|
exec->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv;
|
|
|
|
exec->GetTexParameterfv = _mesa_GetTexParameterfv;
|
|
|
|
exec->GetTexParameteriv = _mesa_GetTexParameteriv;
|
|
|
|
exec->Hint = _mesa_Hint;
|
|
|
|
exec->IndexMask = _mesa_IndexMask;
|
|
|
|
exec->InitNames = _mesa_InitNames;
|
|
|
|
exec->IsEnabled = _mesa_IsEnabled;
|
|
|
|
exec->IsList = _mesa_IsList;
|
|
|
|
exec->LightModelf = _mesa_LightModelf;
|
|
|
|
exec->LightModelfv = _mesa_LightModelfv;
|
|
|
|
exec->LightModeli = _mesa_LightModeli;
|
|
|
|
exec->LightModeliv = _mesa_LightModeliv;
|
|
|
|
exec->Lightf = _mesa_Lightf;
|
|
|
|
exec->Lightfv = _mesa_Lightfv;
|
|
|
|
exec->Lighti = _mesa_Lighti;
|
|
|
|
exec->Lightiv = _mesa_Lightiv;
|
|
|
|
exec->LineStipple = _mesa_LineStipple;
|
|
|
|
exec->LineWidth = _mesa_LineWidth;
|
|
|
|
exec->ListBase = _mesa_ListBase;
|
|
|
|
exec->LoadIdentity = _mesa_LoadIdentity;
|
|
|
|
exec->LoadMatrixd = _mesa_LoadMatrixd;
|
|
|
|
exec->LoadMatrixf = _mesa_LoadMatrixf;
|
|
|
|
exec->LoadName = _mesa_LoadName;
|
|
|
|
exec->LogicOp = _mesa_LogicOp;
|
|
|
|
exec->Map1d = _mesa_Map1d;
|
|
|
|
exec->Map1f = _mesa_Map1f;
|
|
|
|
exec->Map2d = _mesa_Map2d;
|
|
|
|
exec->Map2f = _mesa_Map2f;
|
|
|
|
exec->MapGrid1d = _mesa_MapGrid1d;
|
|
|
|
exec->MapGrid1f = _mesa_MapGrid1f;
|
|
|
|
exec->MapGrid2d = _mesa_MapGrid2d;
|
|
|
|
exec->MapGrid2f = _mesa_MapGrid2f;
|
|
|
|
exec->MatrixMode = _mesa_MatrixMode;
|
|
|
|
exec->MultMatrixd = _mesa_MultMatrixd;
|
|
|
|
exec->MultMatrixf = _mesa_MultMatrixf;
|
|
|
|
exec->NewList = _mesa_NewList;
|
|
|
|
exec->Ortho = _mesa_Ortho;
|
|
|
|
exec->PassThrough = _mesa_PassThrough;
|
|
|
|
exec->PixelMapfv = _mesa_PixelMapfv;
|
|
|
|
exec->PixelMapuiv = _mesa_PixelMapuiv;
|
|
|
|
exec->PixelMapusv = _mesa_PixelMapusv;
|
|
|
|
exec->PixelStoref = _mesa_PixelStoref;
|
|
|
|
exec->PixelStorei = _mesa_PixelStorei;
|
|
|
|
exec->PixelTransferf = _mesa_PixelTransferf;
|
|
|
|
exec->PixelTransferi = _mesa_PixelTransferi;
|
|
|
|
exec->PixelZoom = _mesa_PixelZoom;
|
|
|
|
exec->PointSize = _mesa_PointSize;
|
|
|
|
exec->PolygonMode = _mesa_PolygonMode;
|
|
|
|
exec->PolygonOffset = _mesa_PolygonOffset;
|
|
|
|
exec->PolygonStipple = _mesa_PolygonStipple;
|
|
|
|
exec->PopAttrib = _mesa_PopAttrib;
|
|
|
|
exec->PopMatrix = _mesa_PopMatrix;
|
|
|
|
exec->PopName = _mesa_PopName;
|
|
|
|
exec->PushAttrib = _mesa_PushAttrib;
|
|
|
|
exec->PushMatrix = _mesa_PushMatrix;
|
|
|
|
exec->PushName = _mesa_PushName;
|
|
|
|
exec->RasterPos2d = _mesa_RasterPos2d;
|
|
|
|
exec->RasterPos2dv = _mesa_RasterPos2dv;
|
|
|
|
exec->RasterPos2f = _mesa_RasterPos2f;
|
|
|
|
exec->RasterPos2fv = _mesa_RasterPos2fv;
|
|
|
|
exec->RasterPos2i = _mesa_RasterPos2i;
|
|
|
|
exec->RasterPos2iv = _mesa_RasterPos2iv;
|
|
|
|
exec->RasterPos2s = _mesa_RasterPos2s;
|
|
|
|
exec->RasterPos2sv = _mesa_RasterPos2sv;
|
|
|
|
exec->RasterPos3d = _mesa_RasterPos3d;
|
|
|
|
exec->RasterPos3dv = _mesa_RasterPos3dv;
|
|
|
|
exec->RasterPos3f = _mesa_RasterPos3f;
|
|
|
|
exec->RasterPos3fv = _mesa_RasterPos3fv;
|
|
|
|
exec->RasterPos3i = _mesa_RasterPos3i;
|
|
|
|
exec->RasterPos3iv = _mesa_RasterPos3iv;
|
|
|
|
exec->RasterPos3s = _mesa_RasterPos3s;
|
|
|
|
exec->RasterPos3sv = _mesa_RasterPos3sv;
|
|
|
|
exec->RasterPos4d = _mesa_RasterPos4d;
|
|
|
|
exec->RasterPos4dv = _mesa_RasterPos4dv;
|
|
|
|
exec->RasterPos4f = _mesa_RasterPos4f;
|
|
|
|
exec->RasterPos4fv = _mesa_RasterPos4fv;
|
|
|
|
exec->RasterPos4i = _mesa_RasterPos4i;
|
|
|
|
exec->RasterPos4iv = _mesa_RasterPos4iv;
|
|
|
|
exec->RasterPos4s = _mesa_RasterPos4s;
|
|
|
|
exec->RasterPos4sv = _mesa_RasterPos4sv;
|
|
|
|
exec->ReadBuffer = _mesa_ReadBuffer;
|
|
|
|
exec->ReadPixels = _mesa_ReadPixels;
|
|
|
|
exec->RenderMode = _mesa_RenderMode;
|
|
|
|
exec->Rotated = _mesa_Rotated;
|
|
|
|
exec->Rotatef = _mesa_Rotatef;
|
|
|
|
exec->Scaled = _mesa_Scaled;
|
|
|
|
exec->Scalef = _mesa_Scalef;
|
|
|
|
exec->Scissor = _mesa_Scissor;
|
2000-10-27 16:44:40 +00:00
|
|
|
exec->SecondaryColorPointerEXT = _mesa_SecondaryColorPointerEXT;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->SelectBuffer = _mesa_SelectBuffer;
|
|
|
|
exec->ShadeModel = _mesa_ShadeModel;
|
|
|
|
exec->StencilFunc = _mesa_StencilFunc;
|
|
|
|
exec->StencilMask = _mesa_StencilMask;
|
|
|
|
exec->StencilOp = _mesa_StencilOp;
|
|
|
|
exec->TexEnvf = _mesa_TexEnvf;
|
|
|
|
exec->TexEnvfv = _mesa_TexEnvfv;
|
|
|
|
exec->TexEnvi = _mesa_TexEnvi;
|
|
|
|
exec->TexEnviv = _mesa_TexEnviv;
|
|
|
|
exec->TexGend = _mesa_TexGend;
|
|
|
|
exec->TexGendv = _mesa_TexGendv;
|
|
|
|
exec->TexGenf = _mesa_TexGenf;
|
|
|
|
exec->TexGenfv = _mesa_TexGenfv;
|
|
|
|
exec->TexGeni = _mesa_TexGeni;
|
|
|
|
exec->TexGeniv = _mesa_TexGeniv;
|
|
|
|
exec->TexImage1D = _mesa_TexImage1D;
|
|
|
|
exec->TexImage2D = _mesa_TexImage2D;
|
|
|
|
exec->TexParameterf = _mesa_TexParameterf;
|
|
|
|
exec->TexParameterfv = _mesa_TexParameterfv;
|
|
|
|
exec->TexParameteri = _mesa_TexParameteri;
|
|
|
|
exec->TexParameteriv = _mesa_TexParameteriv;
|
|
|
|
exec->Translated = _mesa_Translated;
|
|
|
|
exec->Translatef = _mesa_Translatef;
|
|
|
|
exec->Viewport = _mesa_Viewport;
|
|
|
|
|
|
|
|
/* 1.1 */
|
|
|
|
exec->AreTexturesResident = _mesa_AreTexturesResident;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->AreTexturesResidentEXT = _mesa_AreTexturesResident;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->BindTexture = _mesa_BindTexture;
|
|
|
|
exec->ColorPointer = _mesa_ColorPointer;
|
|
|
|
exec->CopyTexImage1D = _mesa_CopyTexImage1D;
|
|
|
|
exec->CopyTexImage2D = _mesa_CopyTexImage2D;
|
|
|
|
exec->CopyTexSubImage1D = _mesa_CopyTexSubImage1D;
|
|
|
|
exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D;
|
|
|
|
exec->DeleteTextures = _mesa_DeleteTextures;
|
|
|
|
exec->DisableClientState = _mesa_DisableClientState;
|
|
|
|
exec->EdgeFlagPointer = _mesa_EdgeFlagPointer;
|
|
|
|
exec->EnableClientState = _mesa_EnableClientState;
|
|
|
|
exec->GenTextures = _mesa_GenTextures;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GenTexturesEXT = _mesa_GenTextures;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetPointerv = _mesa_GetPointerv;
|
|
|
|
exec->IndexPointer = _mesa_IndexPointer;
|
|
|
|
exec->InterleavedArrays = _mesa_InterleavedArrays;
|
|
|
|
exec->IsTexture = _mesa_IsTexture;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->IsTextureEXT = _mesa_IsTexture;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->NormalPointer = _mesa_NormalPointer;
|
|
|
|
exec->PopClientAttrib = _mesa_PopClientAttrib;
|
|
|
|
exec->PrioritizeTextures = _mesa_PrioritizeTextures;
|
|
|
|
exec->PushClientAttrib = _mesa_PushClientAttrib;
|
|
|
|
exec->TexCoordPointer = _mesa_TexCoordPointer;
|
|
|
|
exec->TexSubImage1D = _mesa_TexSubImage1D;
|
|
|
|
exec->TexSubImage2D = _mesa_TexSubImage2D;
|
|
|
|
exec->VertexPointer = _mesa_VertexPointer;
|
|
|
|
|
|
|
|
/* 1.2 */
|
|
|
|
exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D;
|
|
|
|
exec->TexImage3D = _mesa_TexImage3D;
|
|
|
|
exec->TexSubImage3D = _mesa_TexSubImage3D;
|
|
|
|
|
|
|
|
/* OpenGL 1.2 GL_ARB_imaging */
|
|
|
|
exec->BlendColor = _mesa_BlendColor;
|
|
|
|
exec->BlendEquation = _mesa_BlendEquation;
|
|
|
|
exec->ColorSubTable = _mesa_ColorSubTable;
|
|
|
|
exec->ColorTable = _mesa_ColorTable;
|
|
|
|
exec->ColorTableParameterfv = _mesa_ColorTableParameterfv;
|
|
|
|
exec->ColorTableParameteriv = _mesa_ColorTableParameteriv;
|
|
|
|
exec->ConvolutionFilter1D = _mesa_ConvolutionFilter1D;
|
|
|
|
exec->ConvolutionFilter2D = _mesa_ConvolutionFilter2D;
|
|
|
|
exec->ConvolutionParameterf = _mesa_ConvolutionParameterf;
|
|
|
|
exec->ConvolutionParameterfv = _mesa_ConvolutionParameterfv;
|
|
|
|
exec->ConvolutionParameteri = _mesa_ConvolutionParameteri;
|
|
|
|
exec->ConvolutionParameteriv = _mesa_ConvolutionParameteriv;
|
|
|
|
exec->CopyColorSubTable = _mesa_CopyColorSubTable;
|
|
|
|
exec->CopyColorTable = _mesa_CopyColorTable;
|
|
|
|
exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D;
|
|
|
|
exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D;
|
|
|
|
exec->GetColorTable = _mesa_GetColorTable;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetColorTableEXT = _mesa_GetColorTable;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetConvolutionFilter = _mesa_GetConvolutionFilter;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetConvolutionFilterEXT = _mesa_GetConvolutionFilter;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetConvolutionParameterfvEXT = _mesa_GetConvolutionParameterfv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetConvolutionParameterivEXT = _mesa_GetConvolutionParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetHistogram = _mesa_GetHistogram;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetHistogramEXT = _mesa_GetHistogram;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetHistogramParameterfvEXT = _mesa_GetHistogramParameterfv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetHistogramParameterivEXT = _mesa_GetHistogramParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetMinmax = _mesa_GetMinmax;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetMinmaxEXT = _mesa_GetMinmax;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetMinmaxParameterfvEXT = _mesa_GetMinmaxParameterfv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetMinmaxParameterivEXT = _mesa_GetMinmaxParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->GetSeparableFilter = _mesa_GetSeparableFilter;
|
2002-11-06 15:16:23 +00:00
|
|
|
exec->GetSeparableFilterEXT = _mesa_GetSeparableFilter;
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->Histogram = _mesa_Histogram;
|
|
|
|
exec->Minmax = _mesa_Minmax;
|
|
|
|
exec->ResetHistogram = _mesa_ResetHistogram;
|
|
|
|
exec->ResetMinmax = _mesa_ResetMinmax;
|
|
|
|
exec->SeparableFilter2D = _mesa_SeparableFilter2D;
|
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 2. GL_EXT_blend_color */
|
|
|
|
#if 0
|
|
|
|
exec->BlendColorEXT = _mesa_BlendColorEXT;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* 3. GL_EXT_polygon_offset */
|
|
|
|
exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT;
|
|
|
|
|
|
|
|
/* 6. GL_EXT_texture3d */
|
2000-02-24 22:04:03 +00:00
|
|
|
#if 0
|
2000-02-02 19:15:19 +00:00
|
|
|
exec->CopyTexSubImage3DEXT = _mesa_CopyTexSubImage3D;
|
|
|
|
exec->TexImage3DEXT = _mesa_TexImage3DEXT;
|
|
|
|
exec->TexSubImage3DEXT = _mesa_TexSubImage3D;
|
2000-02-24 22:04:03 +00:00
|
|
|
#endif
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 11. GL_EXT_histogram */
|
|
|
|
exec->GetHistogramEXT = _mesa_GetHistogram;
|
|
|
|
exec->GetHistogramParameterfvEXT = _mesa_GetHistogramParameterfv;
|
|
|
|
exec->GetHistogramParameterivEXT = _mesa_GetHistogramParameteriv;
|
|
|
|
exec->GetMinmaxEXT = _mesa_GetMinmax;
|
|
|
|
exec->GetMinmaxParameterfvEXT = _mesa_GetMinmaxParameterfv;
|
|
|
|
exec->GetMinmaxParameterivEXT = _mesa_GetMinmaxParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* ?. GL_SGIX_pixel_texture */
|
2000-04-07 16:27:26 +00:00
|
|
|
exec->PixelTexGenSGIX = _mesa_PixelTexGenSGIX;
|
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 15. GL_SGIS_pixel_texture */
|
2000-04-07 16:27:26 +00:00
|
|
|
exec->PixelTexGenParameteriSGIS = _mesa_PixelTexGenParameteriSGIS;
|
|
|
|
exec->PixelTexGenParameterivSGIS = _mesa_PixelTexGenParameterivSGIS;
|
|
|
|
exec->PixelTexGenParameterfSGIS = _mesa_PixelTexGenParameterfSGIS;
|
|
|
|
exec->PixelTexGenParameterfvSGIS = _mesa_PixelTexGenParameterfvSGIS;
|
|
|
|
exec->GetPixelTexGenParameterivSGIS = _mesa_GetPixelTexGenParameterivSGIS;
|
|
|
|
exec->GetPixelTexGenParameterfvSGIS = _mesa_GetPixelTexGenParameterfvSGIS;
|
|
|
|
|
2000-06-12 15:30:51 +00:00
|
|
|
/* 30. GL_EXT_vertex_array */
|
|
|
|
exec->ColorPointerEXT = _mesa_ColorPointerEXT;
|
|
|
|
exec->EdgeFlagPointerEXT = _mesa_EdgeFlagPointerEXT;
|
|
|
|
exec->IndexPointerEXT = _mesa_IndexPointerEXT;
|
|
|
|
exec->NormalPointerEXT = _mesa_NormalPointerEXT;
|
|
|
|
exec->TexCoordPointerEXT = _mesa_TexCoordPointerEXT;
|
|
|
|
exec->VertexPointerEXT = _mesa_VertexPointerEXT;
|
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 37. GL_EXT_blend_minmax */
|
|
|
|
#if 0
|
|
|
|
exec->BlendEquationEXT = _mesa_BlendEquationEXT;
|
|
|
|
#endif
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 54. GL_EXT_point_parameters */
|
2001-12-04 23:43:31 +00:00
|
|
|
exec->PointParameterfEXT = _mesa_PointParameterfEXT;
|
|
|
|
exec->PointParameterfvEXT = _mesa_PointParameterfvEXT;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 78. GL_EXT_paletted_texture */
|
2000-02-24 22:04:03 +00:00
|
|
|
#if 0
|
2000-05-04 13:48:49 +00:00
|
|
|
exec->ColorTableEXT = _mesa_ColorTableEXT;
|
|
|
|
exec->ColorSubTableEXT = _mesa_ColorSubTableEXT;
|
2000-02-24 22:04:03 +00:00
|
|
|
#endif
|
2000-05-04 13:48:49 +00:00
|
|
|
exec->GetColorTableEXT = _mesa_GetColorTable;
|
|
|
|
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
|
|
|
|
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 97. GL_EXT_compiled_vertex_array */
|
|
|
|
exec->LockArraysEXT = _mesa_LockArraysEXT;
|
|
|
|
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
|
|
|
|
|
2002-06-30 15:47:00 +00:00
|
|
|
/* 148. GL_EXT_multi_draw_arrays */
|
|
|
|
exec->MultiDrawArraysEXT = _mesa_MultiDrawArraysEXT;
|
|
|
|
exec->MultiDrawElementsEXT = _mesa_MultiDrawElementsEXT;
|
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* 173. GL_INGR_blend_func_separate */
|
|
|
|
exec->BlendFuncSeparateEXT = _mesa_BlendFuncSeparateEXT;
|
|
|
|
|
|
|
|
/* 196. GL_MESA_resize_buffers */
|
|
|
|
exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
|
|
|
|
|
|
|
|
/* 197. GL_MESA_window_pos */
|
|
|
|
exec->WindowPos2dMESA = _mesa_WindowPos2dMESA;
|
|
|
|
exec->WindowPos2dvMESA = _mesa_WindowPos2dvMESA;
|
|
|
|
exec->WindowPos2fMESA = _mesa_WindowPos2fMESA;
|
|
|
|
exec->WindowPos2fvMESA = _mesa_WindowPos2fvMESA;
|
|
|
|
exec->WindowPos2iMESA = _mesa_WindowPos2iMESA;
|
|
|
|
exec->WindowPos2ivMESA = _mesa_WindowPos2ivMESA;
|
|
|
|
exec->WindowPos2sMESA = _mesa_WindowPos2sMESA;
|
|
|
|
exec->WindowPos2svMESA = _mesa_WindowPos2svMESA;
|
|
|
|
exec->WindowPos3dMESA = _mesa_WindowPos3dMESA;
|
|
|
|
exec->WindowPos3dvMESA = _mesa_WindowPos3dvMESA;
|
|
|
|
exec->WindowPos3fMESA = _mesa_WindowPos3fMESA;
|
|
|
|
exec->WindowPos3fvMESA = _mesa_WindowPos3fvMESA;
|
|
|
|
exec->WindowPos3iMESA = _mesa_WindowPos3iMESA;
|
|
|
|
exec->WindowPos3ivMESA = _mesa_WindowPos3ivMESA;
|
|
|
|
exec->WindowPos3sMESA = _mesa_WindowPos3sMESA;
|
|
|
|
exec->WindowPos3svMESA = _mesa_WindowPos3svMESA;
|
|
|
|
exec->WindowPos4dMESA = _mesa_WindowPos4dMESA;
|
|
|
|
exec->WindowPos4dvMESA = _mesa_WindowPos4dvMESA;
|
|
|
|
exec->WindowPos4fMESA = _mesa_WindowPos4fMESA;
|
|
|
|
exec->WindowPos4fvMESA = _mesa_WindowPos4fvMESA;
|
|
|
|
exec->WindowPos4iMESA = _mesa_WindowPos4iMESA;
|
|
|
|
exec->WindowPos4ivMESA = _mesa_WindowPos4ivMESA;
|
|
|
|
exec->WindowPos4sMESA = _mesa_WindowPos4sMESA;
|
|
|
|
exec->WindowPos4svMESA = _mesa_WindowPos4svMESA;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2001-12-14 03:13:04 +00:00
|
|
|
/* 233. GL_NV_vertex_program */
|
2002-10-16 17:57:51 +00:00
|
|
|
#if FEATURE_NV_vertex_program
|
2001-12-14 02:50:01 +00:00
|
|
|
exec->BindProgramNV = _mesa_BindProgramNV;
|
|
|
|
exec->DeleteProgramsNV = _mesa_DeleteProgramsNV;
|
|
|
|
exec->ExecuteProgramNV = _mesa_ExecuteProgramNV;
|
|
|
|
exec->GenProgramsNV = _mesa_GenProgramsNV;
|
|
|
|
exec->AreProgramsResidentNV = _mesa_AreProgramsResidentNV;
|
|
|
|
exec->RequestResidentProgramsNV = _mesa_RequestResidentProgramsNV;
|
|
|
|
exec->GetProgramParameterfvNV = _mesa_GetProgramParameterfvNV;
|
|
|
|
exec->GetProgramParameterdvNV = _mesa_GetProgramParameterdvNV;
|
|
|
|
exec->GetProgramivNV = _mesa_GetProgramivNV;
|
|
|
|
exec->GetProgramStringNV = _mesa_GetProgramStringNV;
|
|
|
|
exec->GetTrackMatrixivNV = _mesa_GetTrackMatrixivNV;
|
|
|
|
exec->GetVertexAttribdvNV = _mesa_GetVertexAttribdvNV;
|
|
|
|
exec->GetVertexAttribfvNV = _mesa_GetVertexAttribfvNV;
|
|
|
|
exec->GetVertexAttribivNV = _mesa_GetVertexAttribivNV;
|
|
|
|
exec->GetVertexAttribPointervNV = _mesa_GetVertexAttribPointervNV;
|
|
|
|
exec->IsProgramNV = _mesa_IsProgramNV;
|
|
|
|
exec->LoadProgramNV = _mesa_LoadProgramNV;
|
|
|
|
exec->ProgramParameter4dNV = _mesa_ProgramParameter4dNV;
|
|
|
|
exec->ProgramParameter4dvNV = _mesa_ProgramParameter4dvNV;
|
|
|
|
exec->ProgramParameter4fNV = _mesa_ProgramParameter4fNV;
|
|
|
|
exec->ProgramParameter4fvNV = _mesa_ProgramParameter4fvNV;
|
|
|
|
exec->ProgramParameters4dvNV = _mesa_ProgramParameters4dvNV;
|
|
|
|
exec->ProgramParameters4fvNV = _mesa_ProgramParameters4fvNV;
|
|
|
|
exec->TrackMatrixNV = _mesa_TrackMatrixNV;
|
|
|
|
exec->VertexAttribPointerNV = _mesa_VertexAttribPointerNV;
|
2002-10-16 17:57:51 +00:00
|
|
|
#endif
|
2001-12-14 02:50:01 +00:00
|
|
|
|
2003-04-17 02:33:08 +00:00
|
|
|
/* 282. GL_NV_fragment_program */
|
2003-03-29 16:37:07 +00:00
|
|
|
#if FEATURE_NV_fragment_program
|
2003-01-14 04:55:45 +00:00
|
|
|
exec->ProgramNamedParameter4fNV = _mesa_ProgramNamedParameter4fNV;
|
|
|
|
exec->ProgramNamedParameter4dNV = _mesa_ProgramNamedParameter4dNV;
|
|
|
|
exec->ProgramNamedParameter4fvNV = _mesa_ProgramNamedParameter4fvNV;
|
|
|
|
exec->ProgramNamedParameter4dvNV = _mesa_ProgramNamedParameter4dvNV;
|
|
|
|
exec->GetProgramNamedParameterfvNV = _mesa_GetProgramNamedParameterfvNV;
|
|
|
|
exec->GetProgramNamedParameterdvNV = _mesa_GetProgramNamedParameterdvNV;
|
|
|
|
exec->ProgramLocalParameter4dARB = _mesa_ProgramLocalParameter4dARB;
|
|
|
|
exec->ProgramLocalParameter4dvARB = _mesa_ProgramLocalParameter4dvARB;
|
|
|
|
exec->ProgramLocalParameter4fARB = _mesa_ProgramLocalParameter4fARB;
|
|
|
|
exec->ProgramLocalParameter4fvARB = _mesa_ProgramLocalParameter4fvARB;
|
|
|
|
exec->GetProgramLocalParameterdvARB = _mesa_GetProgramLocalParameterdvARB;
|
|
|
|
exec->GetProgramLocalParameterfvARB = _mesa_GetProgramLocalParameterfvARB;
|
|
|
|
#endif
|
|
|
|
|
2002-05-27 17:03:08 +00:00
|
|
|
/* 262. GL_NV_point_sprite */
|
|
|
|
exec->PointParameteriNV = _mesa_PointParameteriNV;
|
|
|
|
exec->PointParameterivNV = _mesa_PointParameterivNV;
|
|
|
|
|
2002-09-06 02:56:08 +00:00
|
|
|
/* 268. GL_EXT_stencil_two_side */
|
|
|
|
exec->ActiveStencilFaceEXT = _mesa_ActiveStencilFaceEXT;
|
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* ARB 1. GL_ARB_multitexture */
|
2001-12-04 23:43:31 +00:00
|
|
|
exec->ActiveTextureARB = _mesa_ActiveTextureARB;
|
|
|
|
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-05-04 13:48:49 +00:00
|
|
|
/* ARB 3. GL_ARB_transpose_matrix */
|
2001-12-04 23:43:31 +00:00
|
|
|
exec->LoadTransposeMatrixdARB = _mesa_LoadTransposeMatrixdARB;
|
|
|
|
exec->LoadTransposeMatrixfARB = _mesa_LoadTransposeMatrixfARB;
|
|
|
|
exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
|
|
|
|
exec->MultTransposeMatrixfARB = _mesa_MultTransposeMatrixfARB;
|
2000-05-23 20:10:49 +00:00
|
|
|
|
2001-05-29 15:23:48 +00:00
|
|
|
/* ARB 5. GL_ARB_multisample */
|
2001-12-04 23:43:31 +00:00
|
|
|
exec->SampleCoverageARB = _mesa_SampleCoverageARB;
|
2001-05-29 15:23:48 +00:00
|
|
|
|
2000-05-23 20:10:49 +00:00
|
|
|
/* ARB 12. GL_ARB_texture_compression */
|
2001-12-04 23:43:31 +00:00
|
|
|
exec->CompressedTexImage3DARB = _mesa_CompressedTexImage3DARB;
|
|
|
|
exec->CompressedTexImage2DARB = _mesa_CompressedTexImage2DARB;
|
|
|
|
exec->CompressedTexImage1DARB = _mesa_CompressedTexImage1DARB;
|
|
|
|
exec->CompressedTexSubImage3DARB = _mesa_CompressedTexSubImage3DARB;
|
|
|
|
exec->CompressedTexSubImage2DARB = _mesa_CompressedTexSubImage2DARB;
|
|
|
|
exec->CompressedTexSubImage1DARB = _mesa_CompressedTexSubImage1DARB;
|
|
|
|
exec->GetCompressedTexImageARB = _mesa_GetCompressedTexImageARB;
|
2000-05-23 20:10:49 +00:00
|
|
|
|
2002-04-02 16:15:16 +00:00
|
|
|
/* ARB 14. GL_ARB_point_parameters */
|
|
|
|
/* reuse EXT_point_parameters functions */
|
2003-03-29 17:01:00 +00:00
|
|
|
|
2003-04-17 02:33:08 +00:00
|
|
|
/* ARB 26. GL_ARB_vertex_program */
|
|
|
|
/* ARB 27. GL_ARB_fragment_program */
|
|
|
|
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
|
|
|
|
exec->VertexAttrib1sARB = _mesa_VertexAttrib1sARB;
|
|
|
|
exec->VertexAttrib1fARB = _mesa_VertexAttrib1fARB;
|
|
|
|
exec->VertexAttrib1dARB = _mesa_VertexAttrib1dARB;
|
|
|
|
exec->VertexAttrib2sARB = _mesa_VertexAttrib2sARB;
|
|
|
|
exec->VertexAttrib2fARB = _mesa_VertexAttrib2fARB;
|
|
|
|
exec->VertexAttrib2dARB = _mesa_VertexAttrib2dARB;
|
|
|
|
exec->VertexAttrib3sARB = _mesa_VertexAttrib3sARB;
|
|
|
|
exec->VertexAttrib3fARB = _mesa_VertexAttrib3fARB;
|
|
|
|
exec->VertexAttrib3dARB = _mesa_VertexAttrib3dARB;
|
|
|
|
exec->VertexAttrib4sARB = _mesa_VertexAttrib4sARB;
|
|
|
|
exec->VertexAttrib4fARB = _mesa_VertexAttrib4fARB;
|
|
|
|
exec->VertexAttrib4dARB = _mesa_VertexAttrib4dARB;
|
|
|
|
exec->VertexAttrib4NubARB = _mesa_VertexAttrib4NubARB;
|
|
|
|
exec->VertexAttrib1svARB = _mesa_VertexAttrib1svARB;
|
|
|
|
exec->VertexAttrib1fvARB = _mesa_VertexAttrib1fvARB;
|
|
|
|
exec->VertexAttrib1dvARB = _mesa_VertexAttrib1dvARB;
|
|
|
|
exec->VertexAttrib2svARB = _mesa_VertexAttrib2svARB;
|
|
|
|
exec->VertexAttrib2fvARB = _mesa_VertexAttrib2fvARB;
|
|
|
|
exec->VertexAttrib2dvARB = _mesa_VertexAttrib2dvARB;
|
|
|
|
exec->VertexAttrib3svARB = _mesa_VertexAttrib3svARB;
|
|
|
|
exec->VertexAttrib3fvARB = _mesa_VertexAttrib3fvARB;
|
|
|
|
exec->VertexAttrib3dvARB = _mesa_VertexAttrib3dvARB;
|
|
|
|
exec->VertexAttrib4bvARB = _mesa_VertexAttrib4bvARB;
|
|
|
|
exec->VertexAttrib4svARB = _mesa_VertexAttrib4svARB;
|
|
|
|
exec->VertexAttrib4ivARB = _mesa_VertexAttrib4ivARB;
|
|
|
|
exec->VertexAttrib4ubvARB = _mesa_VertexAttrib4ubvARB;
|
|
|
|
exec->VertexAttrib4usvARB = _mesa_VertexAttrib4usvARB;
|
|
|
|
exec->VertexAttrib4uivARB = _mesa_VertexAttrib4uivARB;
|
|
|
|
exec->VertexAttrib4fvARB = _mesa_VertexAttrib4fvARB;
|
|
|
|
exec->VertexAttrib4dvARB = _mesa_VertexAttrib4dvARB;
|
|
|
|
exec->VertexAttrib4NbvARB = _mesa_VertexAttrib4NbvARB;
|
|
|
|
exec->VertexAttrib4NsvARB = _mesa_VertexAttrib4NsvARB;
|
|
|
|
exec->VertexAttrib4NivARB = _mesa_VertexAttrib4NivARB;
|
|
|
|
exec->VertexAttrib4NubvARB = _mesa_VertexAttrib4NubvARB;
|
|
|
|
exec->VertexAttrib4NusvARB = _mesa_VertexAttrib4NusvARB;
|
|
|
|
exec->VertexAttrib4NuivARB = _mesa_VertexAttrib4NuivARB;
|
|
|
|
exec->VertexAttribPointerARB = _mesa_VertexAttribPointerARB;
|
|
|
|
exec->EnableVertexAttribArrayARB = _mesa_EnableVertexAttribArrayARB;
|
|
|
|
exec->DisableVertexAttribArrayARB = _mesa_DisableVertexAttribArrayARB;
|
|
|
|
exec->ProgramStringARB = _mesa_ProgramStringARB;
|
|
|
|
exec->BindProgramARB = _mesa_BindProgramARB;
|
|
|
|
exec->DeleteProgramsARB = _mesa_DeleteProgramsARB;
|
|
|
|
exec->GenProgramsARB = _mesa_GenProgramsARB;
|
|
|
|
exec->ProgramEnvParameter4dARB = _mesa_ProgramEnvParameter4dARB;
|
|
|
|
exec->ProgramEnvParameter4dvARB = _mesa_ProgramEnvParameter4dvARB;
|
|
|
|
exec->ProgramEnvParameter4fARB = _mesa_ProgramEnvParameter4fARB;
|
|
|
|
exec->ProgramEnvParameter4fvARB = _mesa_ProgramEnvParameter4fvARB;
|
|
|
|
exec->ProgramLocalParameter4dARB = _mesa_ProgramLocalParameter4dARB;
|
|
|
|
exec->ProgramLocalParameter4dvARB = _mesa_ProgramLocalParameter4dvARB;
|
|
|
|
exec->ProgramLocalParameter4fARB = _mesa_ProgramLocalParameter4fARB;
|
|
|
|
exec->ProgramLocalParameter4fvARB = _mesa_ProgramLocalParameter4fvARB;
|
|
|
|
exec->GetProgramEnvParameterdvARB = _mesa_GetProgramEnvParameterdvARB;
|
|
|
|
exec->GetProgramEnvParameterfvARB = _mesa_GetProgramEnvParameterfvARB;
|
|
|
|
exec->GetProgramLocalParameterdvARB = _mesa_GetProgramLocalParameterdvARB;
|
|
|
|
exec->GetProgramLocalParameterfvARB = _mesa_GetProgramLocalParameterfvARB;
|
|
|
|
exec->GetProgramivARB = _mesa_GetProgramivARB;
|
|
|
|
exec->GetProgramStringARB = _mesa_GetProgramStringARB;
|
|
|
|
exec->GetVertexAttribdvARB = _mesa_GetVertexAttribdvARB;
|
|
|
|
exec->GetVertexAttribfvARB = _mesa_GetVertexAttribfvARB;
|
|
|
|
exec->GetVertexAttribivARB = _mesa_GetVertexAttribivARB;
|
|
|
|
exec->GetVertexAttribPointervARB = _mesa_GetVertexAttribPointervARB;
|
|
|
|
exec->IsProgramARB = _mesa_IsProgramARB;
|
|
|
|
#endif
|
|
|
|
|
2003-03-29 17:01:00 +00:00
|
|
|
/* ARB 28. GL_ARB_vertex_buffer_object */
|
|
|
|
#if FEATURE_ARB_vertex_buffer_object
|
|
|
|
exec->BindBufferARB = _mesa_BindBufferARB;
|
|
|
|
exec->DeleteBuffersARB = _mesa_DeleteBuffersARB;
|
|
|
|
exec->GenBuffersARB = _mesa_GenBuffersARB;
|
|
|
|
exec->IsBufferARB = _mesa_IsBufferARB;
|
|
|
|
exec->BufferDataARB = _mesa_BufferDataARB;
|
|
|
|
exec->BufferSubDataARB = _mesa_BufferSubDataARB;
|
|
|
|
exec->GetBufferSubDataARB = _mesa_GetBufferSubDataARB;
|
|
|
|
exec->MapBufferARB = _mesa_MapBufferARB;
|
|
|
|
exec->UnmapBufferARB = _mesa_UnmapBufferARB;
|
|
|
|
exec->GetBufferParameterivARB = _mesa_GetBufferParameterivARB;
|
|
|
|
exec->GetBufferPointervARB = _mesa_GetBufferPointervARB;
|
|
|
|
#endif
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-05-23 20:10:49 +00:00
|
|
|
|
2000-02-02 19:15:19 +00:00
|
|
|
/**********************************************************************/
|
|
|
|
/***** State update logic *****/
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
|
2002-06-25 02:31:37 +00:00
|
|
|
/*
|
|
|
|
* Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
|
|
|
|
* in ctx->_TriangleCaps if needed.
|
|
|
|
*/
|
2000-11-13 20:02:56 +00:00
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
update_polygon( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
2000-12-26 05:09:27 +00:00
|
|
|
ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
|
|
|
|
|
2001-01-08 17:42:13 +00:00
|
|
|
if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
|
|
|
|
ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* Any Polygon offsets enabled? */
|
|
|
|
if (ctx->Polygon.OffsetPoint ||
|
|
|
|
ctx->Polygon.OffsetLine ||
|
2000-12-16 00:19:12 +00:00
|
|
|
ctx->Polygon.OffsetFill) {
|
2000-11-13 20:02:56 +00:00
|
|
|
ctx->_TriangleCaps |= DD_TRI_OFFSET;
|
2000-12-16 00:19:12 +00:00
|
|
|
}
|
2000-11-13 20:02:56 +00:00
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
calculate_model_project_matrix( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
2002-10-02 21:44:08 +00:00
|
|
|
_math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
|
|
|
|
ctx->ProjectionMatrixStack.Top,
|
|
|
|
ctx->ModelviewMatrixStack.Top );
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2002-10-02 21:44:08 +00:00
|
|
|
_math_matrix_analyse( &ctx->_ModelProjectMatrix );
|
2000-11-13 20:02:56 +00:00
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
update_modelview_scale( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
|
|
|
ctx->_ModelViewInvScale = 1.0F;
|
2001-12-18 04:06:44 +00:00
|
|
|
if (ctx->ModelviewMatrixStack.Top->flags & (MAT_FLAG_UNIFORM_SCALE |
|
2000-11-13 20:02:56 +00:00
|
|
|
MAT_FLAG_GENERAL_SCALE |
|
|
|
|
MAT_FLAG_GENERAL_3D |
|
|
|
|
MAT_FLAG_GENERAL) ) {
|
2001-12-18 04:06:44 +00:00
|
|
|
const GLfloat *m = ctx->ModelviewMatrixStack.Top->inv;
|
2000-11-13 20:02:56 +00:00
|
|
|
GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
|
|
|
|
if (f < 1e-12) f = 1.0;
|
|
|
|
if (ctx->_NeedEyeCoords)
|
2003-03-01 01:50:20 +00:00
|
|
|
ctx->_ModelViewInvScale = 1.0F / SQRTF(f);
|
2000-11-13 20:02:56 +00:00
|
|
|
else
|
2003-03-01 01:50:20 +00:00
|
|
|
ctx->_ModelViewInvScale = SQRTF(f);
|
2000-11-13 20:02:56 +00:00
|
|
|
}
|
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
/* Bring uptodate any state that relies on _NeedEyeCoords.
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
update_tnl_spaces( GLcontext *ctx, GLuint oldneedeyecoords )
|
2000-11-22 07:32:16 +00:00
|
|
|
{
|
2000-11-13 20:02:56 +00:00
|
|
|
/* Check if the truth-value interpretations of the bitfields have
|
2000-11-22 07:32:16 +00:00
|
|
|
* changed:
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
2000-11-19 23:10:25 +00:00
|
|
|
if ((oldneedeyecoords == 0) != (ctx->_NeedEyeCoords == 0)) {
|
2000-11-13 20:02:56 +00:00
|
|
|
/* Recalculate all state that depends on _NeedEyeCoords.
|
2000-02-02 19:15:19 +00:00
|
|
|
*/
|
2000-11-19 23:10:25 +00:00
|
|
|
update_modelview_scale(ctx);
|
2001-03-03 20:33:27 +00:00
|
|
|
_mesa_compute_light_positions( ctx );
|
2000-11-13 20:02:56 +00:00
|
|
|
|
|
|
|
if (ctx->Driver.LightingSpaceChange)
|
|
|
|
ctx->Driver.LightingSpaceChange( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
2000-11-19 23:10:25 +00:00
|
|
|
else {
|
2000-11-13 20:02:56 +00:00
|
|
|
GLuint new_state = ctx->NewState;
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
/* Recalculate that same state only if it has been invalidated
|
2001-03-12 00:48:37 +00:00
|
|
|
* by other statechanges.
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_MODELVIEW)
|
2000-11-19 23:10:25 +00:00
|
|
|
update_modelview_scale(ctx);
|
2000-11-13 20:02:56 +00:00
|
|
|
|
|
|
|
if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW))
|
2001-03-03 20:33:27 +00:00
|
|
|
_mesa_compute_light_positions( ctx );
|
2000-11-13 20:02:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
update_drawbuffer( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
|
|
|
ctx->DrawBuffer->_Xmin = 0;
|
|
|
|
ctx->DrawBuffer->_Ymin = 0;
|
|
|
|
ctx->DrawBuffer->_Xmax = ctx->DrawBuffer->Width;
|
|
|
|
ctx->DrawBuffer->_Ymax = ctx->DrawBuffer->Height;
|
|
|
|
if (ctx->Scissor.Enabled) {
|
|
|
|
if (ctx->Scissor.X > ctx->DrawBuffer->_Xmin) {
|
|
|
|
ctx->DrawBuffer->_Xmin = ctx->Scissor.X;
|
|
|
|
}
|
|
|
|
if (ctx->Scissor.Y > ctx->DrawBuffer->_Ymin) {
|
|
|
|
ctx->DrawBuffer->_Ymin = ctx->Scissor.Y;
|
|
|
|
}
|
|
|
|
if (ctx->Scissor.X + ctx->Scissor.Width < ctx->DrawBuffer->_Xmax) {
|
|
|
|
ctx->DrawBuffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width;
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
2000-11-13 20:02:56 +00:00
|
|
|
if (ctx->Scissor.Y + ctx->Scissor.Height < ctx->DrawBuffer->_Ymax) {
|
|
|
|
ctx->DrawBuffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
|
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* NOTE: This routine references Tranform attribute values to compute
|
|
|
|
* userclip positions in clip space, but is only called on
|
|
|
|
* _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values
|
2002-06-16 01:14:22 +00:00
|
|
|
* up to date across changes to the Transform attributes.
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
|
|
|
static void
|
2000-11-19 23:10:25 +00:00
|
|
|
update_projection( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
2001-12-18 04:06:44 +00:00
|
|
|
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
|
2001-03-12 00:48:37 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* Recompute clip plane positions in clipspace. This is also done
|
|
|
|
* in _mesa_ClipPlane().
|
|
|
|
*/
|
2002-03-29 17:27:59 +00:00
|
|
|
if (ctx->Transform.ClipPlanesEnabled) {
|
2000-11-13 20:02:56 +00:00
|
|
|
GLuint p;
|
2000-11-27 18:22:13 +00:00
|
|
|
for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
|
2002-03-29 17:27:59 +00:00
|
|
|
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
|
2001-03-03 20:33:27 +00:00
|
|
|
_mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
|
2000-11-13 20:02:56 +00:00
|
|
|
ctx->Transform.EyeUserPlane[p],
|
2001-12-18 04:06:44 +00:00
|
|
|
ctx->ProjectionMatrixStack.Top->inv );
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-11-13 20:02:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-19 23:10:25 +00:00
|
|
|
/*
|
|
|
|
* Return a bitmask of IMAGE_*_BIT flags which to indicate which
|
|
|
|
* pixel transfer operations are enabled.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
update_image_transfer_state(GLcontext *ctx)
|
|
|
|
{
|
|
|
|
GLuint mask = 0;
|
|
|
|
|
|
|
|
if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F ||
|
|
|
|
ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F ||
|
|
|
|
ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F ||
|
|
|
|
ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F)
|
|
|
|
mask |= IMAGE_SCALE_BIAS_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset)
|
|
|
|
mask |= IMAGE_SHIFT_OFFSET_BIT;
|
2000-11-22 07:32:16 +00:00
|
|
|
|
2000-11-19 23:10:25 +00:00
|
|
|
if (ctx->Pixel.MapColorFlag)
|
|
|
|
mask |= IMAGE_MAP_COLOR_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.ColorTableEnabled)
|
|
|
|
mask |= IMAGE_COLOR_TABLE_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.Convolution1DEnabled ||
|
|
|
|
ctx->Pixel.Convolution2DEnabled ||
|
2000-11-28 00:07:51 +00:00
|
|
|
ctx->Pixel.Separable2DEnabled) {
|
2000-11-19 23:10:25 +00:00
|
|
|
mask |= IMAGE_CONVOLUTION_BIT;
|
2000-11-28 00:07:51 +00:00
|
|
|
if (ctx->Pixel.PostConvolutionScale[0] != 1.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionScale[1] != 1.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionScale[2] != 1.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionScale[3] != 1.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionBias[0] != 0.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionBias[1] != 0.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionBias[2] != 0.0F ||
|
|
|
|
ctx->Pixel.PostConvolutionBias[3] != 0.0F) {
|
|
|
|
mask |= IMAGE_POST_CONVOLUTION_SCALE_BIAS;
|
|
|
|
}
|
|
|
|
}
|
2000-11-19 23:10:25 +00:00
|
|
|
|
|
|
|
if (ctx->Pixel.PostConvolutionColorTableEnabled)
|
|
|
|
mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT;
|
|
|
|
|
2001-12-18 04:06:44 +00:00
|
|
|
if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY ||
|
2000-11-19 23:10:25 +00:00
|
|
|
ctx->Pixel.PostColorMatrixScale[0] != 1.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixBias[0] != 0.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixScale[1] != 1.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixBias[1] != 0.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixScale[2] != 1.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixBias[2] != 0.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixScale[3] != 1.0F ||
|
|
|
|
ctx->Pixel.PostColorMatrixBias[3] != 0.0F)
|
|
|
|
mask |= IMAGE_COLOR_MATRIX_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.PostColorMatrixColorTableEnabled)
|
|
|
|
mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.HistogramEnabled)
|
|
|
|
mask |= IMAGE_HISTOGRAM_BIT;
|
|
|
|
|
|
|
|
if (ctx->Pixel.MinMaxEnabled)
|
|
|
|
mask |= IMAGE_MIN_MAX_BIT;
|
|
|
|
|
|
|
|
ctx->_ImageTransferState = mask;
|
|
|
|
}
|
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Note: This routine refers to derived texture attribute values to
|
|
|
|
* compute the ENABLE_TEXMAT flags, but is only called on
|
|
|
|
* _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
|
|
|
|
* flags are updated by _mesa_update_textures(), below.
|
|
|
|
*
|
|
|
|
* If both TEXTURE and TEXTURE_MATRIX change at once, these values
|
|
|
|
* will be computed twice.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
update_texture_matrices( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
GLuint i;
|
|
|
|
|
2001-03-29 21:16:25 +00:00
|
|
|
ctx->Texture._TexMatEnabled = 0;
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
|
2001-12-18 04:06:44 +00:00
|
|
|
if (ctx->TextureMatrixStack[i].Top->flags & MAT_DIRTY) {
|
|
|
|
_math_matrix_analyse( ctx->TextureMatrixStack[i].Top );
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
if (ctx->Texture.Unit[i]._ReallyEnabled &&
|
2001-12-18 04:06:44 +00:00
|
|
|
ctx->TextureMatrixStack[i].Top->type != MATRIX_IDENTITY)
|
2001-03-29 21:16:25 +00:00
|
|
|
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
|
2002-02-13 00:53:19 +00:00
|
|
|
|
|
|
|
if (ctx->Driver.TextureMatrix)
|
|
|
|
ctx->Driver.TextureMatrix( ctx, i, ctx->TextureMatrixStack[i].Top);
|
2001-02-06 21:42:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Note: This routine refers to derived texture matrix values to
|
|
|
|
* compute the ENABLE_TEXMAT flags, but is only called on
|
|
|
|
* _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
|
|
|
|
* flags are updated by _mesa_update_texture_matrices, above.
|
|
|
|
*
|
|
|
|
* If both TEXTURE and TEXTURE_MATRIX change at once, these values
|
|
|
|
* will be computed twice.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
update_texture_state( GLcontext *ctx )
|
|
|
|
{
|
2002-06-15 03:03:06 +00:00
|
|
|
GLuint unit;
|
2001-02-06 21:42:48 +00:00
|
|
|
|
2002-06-15 03:03:06 +00:00
|
|
|
ctx->Texture._EnabledUnits = 0;
|
2001-02-06 21:42:48 +00:00
|
|
|
ctx->Texture._GenFlags = 0;
|
|
|
|
ctx->_NeedNormals &= ~NEED_NORMALS_TEXGEN;
|
|
|
|
ctx->_NeedEyeCoords &= ~NEED_EYE_TEXGEN;
|
2001-03-29 21:16:25 +00:00
|
|
|
ctx->Texture._TexMatEnabled = 0;
|
|
|
|
ctx->Texture._TexGenEnabled = 0;
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
/* Update texture unit state.
|
|
|
|
*/
|
2002-06-15 03:03:06 +00:00
|
|
|
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
|
|
|
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
2003-03-15 17:33:25 +00:00
|
|
|
GLuint enableBits;
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
texUnit->_ReallyEnabled = 0;
|
|
|
|
texUnit->_GenFlags = 0;
|
|
|
|
|
2003-03-15 17:33:25 +00:00
|
|
|
/* Get the bitmask of texture enables */
|
|
|
|
if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
|
|
|
|
enableBits = ctx->FragmentProgram.Current->TexturesUsed[unit];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!texUnit->Enabled)
|
|
|
|
continue;
|
|
|
|
enableBits = texUnit->Enabled;
|
|
|
|
}
|
2001-02-06 21:42:48 +00:00
|
|
|
|
2002-06-15 03:03:06 +00:00
|
|
|
/* Look for the highest-priority texture target that's enabled and
|
2003-03-15 17:33:25 +00:00
|
|
|
* complete. That's the one we'll use for texturing. If we're using
|
|
|
|
* a fragment program we're guaranteed that bitcount(enabledBits) <= 1.
|
2001-02-06 21:42:48 +00:00
|
|
|
*/
|
2003-03-15 17:33:25 +00:00
|
|
|
if (enableBits & TEXTURE_CUBE_BIT) {
|
2001-02-06 21:42:48 +00:00
|
|
|
struct gl_texture_object *texObj = texUnit->CurrentCubeMap;
|
|
|
|
if (!texObj->Complete) {
|
|
|
|
_mesa_test_texobj_completeness(ctx, texObj);
|
|
|
|
}
|
|
|
|
if (texObj->Complete) {
|
2002-06-15 03:03:06 +00:00
|
|
|
texUnit->_ReallyEnabled = TEXTURE_CUBE_BIT;
|
2001-02-06 21:42:48 +00:00
|
|
|
texUnit->_Current = texObj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-15 17:33:25 +00:00
|
|
|
if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_3D_BIT)) {
|
2001-02-06 21:42:48 +00:00
|
|
|
struct gl_texture_object *texObj = texUnit->Current3D;
|
|
|
|
if (!texObj->Complete) {
|
|
|
|
_mesa_test_texobj_completeness(ctx, texObj);
|
|
|
|
}
|
|
|
|
if (texObj->Complete) {
|
2002-06-15 03:03:06 +00:00
|
|
|
texUnit->_ReallyEnabled = TEXTURE_3D_BIT;
|
2001-02-06 21:42:48 +00:00
|
|
|
texUnit->_Current = texObj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-15 17:33:25 +00:00
|
|
|
if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_RECT_BIT)) {
|
2002-06-15 03:03:06 +00:00
|
|
|
struct gl_texture_object *texObj = texUnit->CurrentRect;
|
|
|
|
if (!texObj->Complete) {
|
|
|
|
_mesa_test_texobj_completeness(ctx, texObj);
|
|
|
|
}
|
|
|
|
if (texObj->Complete) {
|
|
|
|
texUnit->_ReallyEnabled = TEXTURE_RECT_BIT;
|
|
|
|
texUnit->_Current = texObj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-15 17:33:25 +00:00
|
|
|
if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_2D_BIT)) {
|
2001-02-06 21:42:48 +00:00
|
|
|
struct gl_texture_object *texObj = texUnit->Current2D;
|
|
|
|
if (!texObj->Complete) {
|
|
|
|
_mesa_test_texobj_completeness(ctx, texObj);
|
|
|
|
}
|
|
|
|
if (texObj->Complete) {
|
2002-06-15 03:03:06 +00:00
|
|
|
texUnit->_ReallyEnabled = TEXTURE_2D_BIT;
|
2001-02-06 21:42:48 +00:00
|
|
|
texUnit->_Current = texObj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-15 17:33:25 +00:00
|
|
|
if (!texUnit->_ReallyEnabled && (enableBits & TEXTURE_1D_BIT)) {
|
2001-02-06 21:42:48 +00:00
|
|
|
struct gl_texture_object *texObj = texUnit->Current1D;
|
|
|
|
if (!texObj->Complete) {
|
|
|
|
_mesa_test_texobj_completeness(ctx, texObj);
|
|
|
|
}
|
|
|
|
if (texObj->Complete) {
|
2002-06-15 03:03:06 +00:00
|
|
|
texUnit->_ReallyEnabled = TEXTURE_1D_BIT;
|
2001-02-06 21:42:48 +00:00
|
|
|
texUnit->_Current = texObj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!texUnit->_ReallyEnabled) {
|
|
|
|
texUnit->_Current = NULL;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2002-10-08 23:59:33 +00:00
|
|
|
if (texUnit->_ReallyEnabled)
|
|
|
|
ctx->Texture._EnabledUnits |= (1 << unit);
|
2001-02-06 21:42:48 +00:00
|
|
|
|
|
|
|
if (texUnit->TexGenEnabled) {
|
|
|
|
if (texUnit->TexGenEnabled & S_BIT) {
|
|
|
|
texUnit->_GenFlags |= texUnit->_GenBitS;
|
|
|
|
}
|
|
|
|
if (texUnit->TexGenEnabled & T_BIT) {
|
|
|
|
texUnit->_GenFlags |= texUnit->_GenBitT;
|
|
|
|
}
|
|
|
|
if (texUnit->TexGenEnabled & Q_BIT) {
|
|
|
|
texUnit->_GenFlags |= texUnit->_GenBitQ;
|
|
|
|
}
|
|
|
|
if (texUnit->TexGenEnabled & R_BIT) {
|
|
|
|
texUnit->_GenFlags |= texUnit->_GenBitR;
|
|
|
|
}
|
|
|
|
|
2002-06-15 03:03:06 +00:00
|
|
|
ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
|
2001-02-06 21:42:48 +00:00
|
|
|
ctx->Texture._GenFlags |= texUnit->_GenFlags;
|
|
|
|
}
|
|
|
|
|
2002-06-15 03:03:06 +00:00
|
|
|
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
|
|
|
|
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
|
2001-02-06 21:42:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS) {
|
|
|
|
ctx->_NeedNormals |= NEED_NORMALS_TEXGEN;
|
|
|
|
ctx->_NeedEyeCoords |= NEED_EYE_TEXGEN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) {
|
|
|
|
ctx->_NeedEyeCoords |= NEED_EYE_TEXGEN;
|
|
|
|
}
|
2003-04-08 02:27:16 +00:00
|
|
|
|
|
|
|
ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits;
|
|
|
|
/* Fragment programs may need texture coordinates but not the
|
|
|
|
* corresponding texture images.
|
|
|
|
*/
|
|
|
|
if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
|
|
|
|
ctx->Texture._EnabledCoordUnits |=
|
|
|
|
(ctx->FragmentProgram.Current->InputsRead >> FRAG_ATTRIB_TEX0);
|
|
|
|
}
|
2001-02-06 21:42:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-04-08 02:27:16 +00:00
|
|
|
/*
|
|
|
|
* Update items which depend on vertex/fragment programs.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
update_program( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
|
|
|
|
if (ctx->FragmentProgram.Current->InputsRead & (1 << FRAG_ATTRIB_COL1))
|
|
|
|
ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-13 00:53:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/*
|
|
|
|
* If ctx->NewState is non-zero then this function MUST be called before
|
|
|
|
* rendering any primitive. Basically, function pointers and miscellaneous
|
|
|
|
* flags are updated to reflect the current state of the state machine.
|
|
|
|
*
|
2000-12-26 05:09:27 +00:00
|
|
|
* The above constraint is now maintained largely by the two Exec
|
|
|
|
* dispatch tables, which trigger the appropriate flush on transition
|
|
|
|
* between State and Geometry modes.
|
|
|
|
*
|
|
|
|
* Special care is taken with the derived value _NeedEyeCoords. This
|
2000-11-13 20:02:56 +00:00
|
|
|
* is a bitflag which is updated with information from a number of
|
|
|
|
* attribute groups (MODELVIEW, LIGHT, TEXTURE). A lot of derived
|
|
|
|
* state references this value, and must be treated with care to
|
|
|
|
* ensure that updates are done correctly. All state dependent on
|
|
|
|
* _NeedEyeCoords is calculated from within _mesa_update_tnl_spaces(),
|
2001-03-12 00:48:37 +00:00
|
|
|
* and from nowhere else.
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
2001-03-03 20:33:27 +00:00
|
|
|
void _mesa_update_state( GLcontext *ctx )
|
2000-11-13 20:02:56 +00:00
|
|
|
{
|
2001-02-12 19:04:30 +00:00
|
|
|
const GLuint new_state = ctx->NewState;
|
|
|
|
const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
|
2000-11-13 20:02:56 +00:00
|
|
|
|
|
|
|
if (MESA_VERBOSE & VERBOSE_STATE)
|
2002-04-09 16:56:50 +00:00
|
|
|
_mesa_print_state("_mesa_update_state", new_state);
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_MODELVIEW)
|
2001-12-18 04:06:44 +00:00
|
|
|
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_PROJECTION)
|
2000-11-19 23:10:25 +00:00
|
|
|
update_projection( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_TEXTURE_MATRIX)
|
2001-02-06 21:42:48 +00:00
|
|
|
update_texture_matrices( ctx );
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_COLOR_MATRIX)
|
2001-12-18 04:06:44 +00:00
|
|
|
_math_matrix_analyse( ctx->ColorMatrixStack.Top );
|
2000-11-22 07:32:16 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* References ColorMatrix.type (derived above).
|
|
|
|
*/
|
2000-12-26 05:09:27 +00:00
|
|
|
if (new_state & _IMAGE_NEW_TRANSFER_STATE)
|
2000-11-19 23:10:25 +00:00
|
|
|
update_image_transfer_state(ctx);
|
2000-11-13 20:02:56 +00:00
|
|
|
|
|
|
|
/* Contributes to NeedEyeCoords, NeedNormals.
|
2000-02-02 19:15:19 +00:00
|
|
|
*/
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_TEXTURE)
|
2001-02-06 21:42:48 +00:00
|
|
|
update_texture_state( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & (_NEW_BUFFERS|_NEW_SCISSOR))
|
2000-11-19 23:10:25 +00:00
|
|
|
update_drawbuffer( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_POLYGON)
|
2000-11-19 23:10:25 +00:00
|
|
|
update_polygon( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* Contributes to NeedEyeCoords, NeedNormals.
|
|
|
|
*/
|
2000-11-22 07:32:16 +00:00
|
|
|
if (new_state & _NEW_LIGHT)
|
2001-03-03 20:33:27 +00:00
|
|
|
_mesa_update_lighting( ctx );
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2000-11-13 20:02:56 +00:00
|
|
|
/* We can light in object space if the modelview matrix preserves
|
|
|
|
* lengths and relative angles.
|
|
|
|
*/
|
|
|
|
if (new_state & (_NEW_MODELVIEW|_NEW_LIGHT)) {
|
|
|
|
ctx->_NeedEyeCoords &= ~NEED_EYE_LIGHT_MODELVIEW;
|
|
|
|
if (ctx->Light.Enabled &&
|
2001-12-18 04:06:44 +00:00
|
|
|
!TEST_MAT_FLAGS( ctx->ModelviewMatrixStack.Top, MAT_FLAGS_LENGTH_PRESERVING))
|
2000-11-13 20:02:56 +00:00
|
|
|
ctx->_NeedEyeCoords |= NEED_EYE_LIGHT_MODELVIEW;
|
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
|
2003-04-08 02:27:16 +00:00
|
|
|
if (new_state & _NEW_PROGRAM)
|
|
|
|
update_program( ctx );
|
2002-02-13 00:53:19 +00:00
|
|
|
|
|
|
|
#if 0
|
2002-01-12 02:55:30 +00:00
|
|
|
/* XXX this is a bit of a hack. We should be checking elsewhere if
|
|
|
|
* vertex program mode is enabled. We set _NeedEyeCoords to zero to
|
|
|
|
* ensure that the combined modelview/projection matrix is computed
|
|
|
|
* in calculate_model_project_matrix().
|
|
|
|
*/
|
|
|
|
if (ctx->VertexProgram.Enabled)
|
|
|
|
ctx->_NeedEyeCoords = 0;
|
2002-02-13 00:53:19 +00:00
|
|
|
/* KW: it's now always computed.
|
|
|
|
*/
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Keep ModelviewProject uptodate always to allow tnl
|
|
|
|
* implementations that go model->clip even when eye is required.
|
|
|
|
*/
|
|
|
|
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
|
|
|
|
calculate_model_project_matrix(ctx);
|
2000-12-08 00:20:15 +00:00
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
/* ctx->_NeedEyeCoords is now uptodate.
|
2000-11-13 20:02:56 +00:00
|
|
|
*
|
2000-12-26 05:09:27 +00:00
|
|
|
* If the truth value of this variable has changed, update for the
|
|
|
|
* new lighting space and recompute the positions of lights and the
|
2000-11-13 20:02:56 +00:00
|
|
|
* normal transform.
|
2000-11-22 07:32:16 +00:00
|
|
|
*
|
2000-11-13 20:02:56 +00:00
|
|
|
* If the lighting space hasn't changed, may still need to recompute
|
2001-03-12 00:48:37 +00:00
|
|
|
* light positions & normal transforms for other reasons.
|
2000-11-13 20:02:56 +00:00
|
|
|
*/
|
|
|
|
if (new_state & (_NEW_MODELVIEW |
|
|
|
|
_NEW_LIGHT |
|
2000-12-26 05:09:27 +00:00
|
|
|
_MESA_NEW_NEED_EYE_COORDS))
|
2000-11-19 23:10:25 +00:00
|
|
|
update_tnl_spaces( ctx, oldneedeyecoords );
|
2000-11-13 20:02:56 +00:00
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
/*
|
|
|
|
* Here the driver sets up all the ctx->Driver function pointers
|
|
|
|
* to it's specific, private functions, and performs any
|
|
|
|
* internal state management necessary, including invalidating
|
|
|
|
* state of active modules.
|
2000-12-26 05:09:27 +00:00
|
|
|
*
|
|
|
|
* Set ctx->NewState to zero to avoid recursion if
|
|
|
|
* Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
|
2000-11-16 21:05:34 +00:00
|
|
|
*/
|
2000-02-02 19:15:19 +00:00
|
|
|
ctx->NewState = 0;
|
2000-12-26 05:09:27 +00:00
|
|
|
ctx->Driver.UpdateState(ctx, new_state);
|
2001-02-16 00:35:34 +00:00
|
|
|
ctx->Array.NewState = 0;
|
2001-02-12 19:04:30 +00:00
|
|
|
|
2001-02-16 00:35:34 +00:00
|
|
|
/* At this point we can do some assertions to be sure the required
|
2001-03-12 00:48:37 +00:00
|
|
|
* device driver function pointers are all initialized.
|
2001-02-12 19:04:30 +00:00
|
|
|
*/
|
2001-02-16 00:35:34 +00:00
|
|
|
ASSERT(ctx->Driver.GetString);
|
|
|
|
ASSERT(ctx->Driver.UpdateState);
|
|
|
|
ASSERT(ctx->Driver.Clear);
|
|
|
|
ASSERT(ctx->Driver.GetBufferSize);
|
2001-02-12 19:04:30 +00:00
|
|
|
if (ctx->Visual.accumRedBits > 0) {
|
2001-02-16 00:35:34 +00:00
|
|
|
ASSERT(ctx->Driver.Accum);
|
2001-02-12 19:04:30 +00:00
|
|
|
}
|
2001-02-16 00:35:34 +00:00
|
|
|
ASSERT(ctx->Driver.DrawPixels);
|
|
|
|
ASSERT(ctx->Driver.ReadPixels);
|
|
|
|
ASSERT(ctx->Driver.CopyPixels);
|
|
|
|
ASSERT(ctx->Driver.Bitmap);
|
2002-03-16 18:07:39 +00:00
|
|
|
ASSERT(ctx->Driver.ResizeBuffers);
|
2001-02-16 00:35:34 +00:00
|
|
|
ASSERT(ctx->Driver.TexImage1D);
|
|
|
|
ASSERT(ctx->Driver.TexImage2D);
|
|
|
|
ASSERT(ctx->Driver.TexImage3D);
|
|
|
|
ASSERT(ctx->Driver.TexSubImage1D);
|
|
|
|
ASSERT(ctx->Driver.TexSubImage2D);
|
|
|
|
ASSERT(ctx->Driver.TexSubImage3D);
|
2001-02-20 16:42:25 +00:00
|
|
|
ASSERT(ctx->Driver.CopyTexImage1D);
|
|
|
|
ASSERT(ctx->Driver.CopyTexImage2D);
|
|
|
|
ASSERT(ctx->Driver.CopyTexSubImage1D);
|
|
|
|
ASSERT(ctx->Driver.CopyTexSubImage2D);
|
|
|
|
ASSERT(ctx->Driver.CopyTexSubImage3D);
|
2001-02-12 19:04:30 +00:00
|
|
|
if (ctx->Extensions.ARB_texture_compression) {
|
2001-06-15 14:18:46 +00:00
|
|
|
#if 0 /* HW drivers need these, but not SW rasterizers */
|
2001-02-16 00:35:34 +00:00
|
|
|
ASSERT(ctx->Driver.CompressedTexImage1D);
|
|
|
|
ASSERT(ctx->Driver.CompressedTexImage2D);
|
|
|
|
ASSERT(ctx->Driver.CompressedTexImage3D);
|
|
|
|
ASSERT(ctx->Driver.CompressedTexSubImage1D);
|
|
|
|
ASSERT(ctx->Driver.CompressedTexSubImage2D);
|
|
|
|
ASSERT(ctx->Driver.CompressedTexSubImage3D);
|
2001-06-15 14:18:46 +00:00
|
|
|
#endif
|
2001-02-12 19:04:30 +00:00
|
|
|
}
|
2000-02-02 19:15:19 +00:00
|
|
|
}
|
2002-02-13 00:53:19 +00:00
|
|
|
|
|
|
|
/* Is this helpful?
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
_mesa_allow_light_in_model( GLcontext *ctx, GLboolean flag )
|
|
|
|
{
|
|
|
|
if (flag)
|
|
|
|
ctx->_NeedEyeCoords &= ~NEED_EYE_DRIVER;
|
|
|
|
else
|
|
|
|
ctx->_NeedEyeCoords |= NEED_EYE_DRIVER;
|
|
|
|
|
|
|
|
ctx->NewState |= _NEW_POINT; /* one of the bits from
|
|
|
|
* _MESA_NEW_NEED_EYE_COORDS.
|
|
|
|
*/
|
|
|
|
}
|