-/* $Id: state.c,v 1.6 2000/04/01 05:42:06 brianp Exp $ */
+/* $Id: state.c,v 1.12 2000/05/10 22:36:05 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "mmath.h"
#include "pipeline.h"
#include "pixel.h"
+#include "pixeltex.h"
#include "points.h"
#include "polygon.h"
#include "quads.h"
exec->TexImage3D = _mesa_TexImage3D;
exec->TexSubImage3D = _mesa_TexSubImage3D;
-
/* OpenGL 1.2 GL_ARB_imaging */
exec->BlendColor = _mesa_BlendColor;
exec->BlendEquation = _mesa_BlendEquation;
exec->ResetMinmax = _mesa_ResetMinmax;
exec->SeparableFilter2D = _mesa_SeparableFilter2D;
- /* GL_EXT_texture3d */
+ /* 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 */
#if 0
exec->CopyTexSubImage3DEXT = _mesa_CopyTexSubImage3D;
exec->TexImage3DEXT = _mesa_TexImage3DEXT;
exec->TexSubImage3DEXT = _mesa_TexSubImage3D;
#endif
- /* GL_EXT_paletted_texture */
+ /* 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;
+
+ /* ?. GL_SGIX_pixel_texture */
+ exec->PixelTexGenSGIX = _mesa_PixelTexGenSGIX;
+
+ /* 15. GL_SGIS_pixel_texture */
+ exec->PixelTexGenParameteriSGIS = _mesa_PixelTexGenParameteriSGIS;
+ exec->PixelTexGenParameterivSGIS = _mesa_PixelTexGenParameterivSGIS;
+ exec->PixelTexGenParameterfSGIS = _mesa_PixelTexGenParameterfSGIS;
+ exec->PixelTexGenParameterfvSGIS = _mesa_PixelTexGenParameterfvSGIS;
+ exec->GetPixelTexGenParameterivSGIS = _mesa_GetPixelTexGenParameterivSGIS;
+ exec->GetPixelTexGenParameterfvSGIS = _mesa_GetPixelTexGenParameterfvSGIS;
+
+ /* 37. GL_EXT_blend_minmax */
+#if 0
+ exec->BlendEquationEXT = _mesa_BlendEquationEXT;
+#endif
+
+ /* 54. GL_EXT_point_parameters */
+ exec->PointParameterfEXT = _mesa_PointParameterfEXT;
+ exec->PointParameterfvEXT = _mesa_PointParameterfvEXT;
+
+ /* 77. GL_PGI_misc_hints */
+ exec->HintPGI = _mesa_HintPGI;
+
+ /* 78. GL_EXT_paletted_texture */
#if 0
exec->ColorTableEXT = _mesa_ColorTableEXT;
exec->ColorSubTableEXT = _mesa_ColorSubTableEXT;
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
- /* GL_EXT_compiled_vertex_array */
+ /* 97. GL_EXT_compiled_vertex_array */
exec->LockArraysEXT = _mesa_LockArraysEXT;
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
- /* GL_EXT_point_parameters */
- exec->PointParameterfEXT = _mesa_PointParameterfEXT;
- exec->PointParameterfvEXT = _mesa_PointParameterfvEXT;
-
- /* GL_PGI_misc_hints */
- exec->HintPGI = _mesa_HintPGI;
-
- /* GL_EXT_polygon_offset */
- exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT;
+ /* 173. GL_INGR_blend_func_separate */
+ exec->BlendFuncSeparateEXT = _mesa_BlendFuncSeparateEXT;
- /* GL_EXT_blend_minmax */
-#if 0
- exec->BlendEquationEXT = _mesa_BlendEquationEXT;
-#endif
+ /* 196. GL_MESA_resize_buffers */
+ exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
- /* GL_EXT_blend_color */
-#if 0
- exec->BlendColorEXT = _mesa_BlendColorEXT;
-#endif
+ /* 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;
- /* GL_ARB_multitexture */
+ /* ARB 1. GL_ARB_multitexture */
exec->ActiveTextureARB = _mesa_ActiveTextureARB;
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB;
exec->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB;
exec->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB;
exec->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB;
- /* GL_INGR_blend_func_separate */
- exec->BlendFuncSeparateEXT = _mesa_BlendFuncSeparateEXT;
-
- /* 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;
-
- /* GL_MESA_resize_buffers */
- exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
-
- /* GL_ARB_transpose_matrix */
+ /* ARB 3. GL_ARB_transpose_matrix */
exec->LoadTransposeMatrixdARB = _mesa_LoadTransposeMatrixdARB;
exec->LoadTransposeMatrixfARB = _mesa_LoadTransposeMatrixfARB;
exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
if (ctx->Scissor.Enabled) ctx->RasterMask |= SCISSOR_BIT;
if (ctx->Stencil.Enabled) ctx->RasterMask |= STENCIL_BIT;
if (ctx->Color.SWmasking) ctx->RasterMask |= MASKING_BIT;
+ if (ctx->Texture.ReallyEnabled) ctx->RasterMask |= TEXTURE_BIT;
- if (ctx->Visual->SoftwareAlpha && ctx->Color.ColorMask[ACOMP]
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]
&& ctx->Color.DrawBuffer != GL_NONE)
ctx->RasterMask |= ALPHABUF_BIT;
ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
}
- if (ctx->NewState & (NEW_RASTER_OPS | NEW_LIGHTING | NEW_FOG)) {
+ if (ctx->NewState & (NEW_RASTER_OPS | NEW_LIGHTING | NEW_FOG | NEW_TEXTURE_ENABLE)) {
-
- if (ctx->NewState & NEW_RASTER_OPS) {
+ if (ctx->NewState & (NEW_RASTER_OPS | NEW_TEXTURE_ENABLE)) {
update_pixel_logic(ctx);
update_pixel_masking(ctx);
update_fog_mode(ctx);
(*ctx->Driver.Dither)( ctx, ctx->Color.DitherFlag );
}
- /* Check if incoming colors can be modified during rasterization */
- if (ctx->Fog.Enabled ||
- ctx->Texture.Enabled ||
- ctx->Color.BlendEnabled ||
- ctx->Color.SWmasking ||
- ctx->Color.SWLogicOpEnabled) {
- ctx->MutablePixels = GL_TRUE;
- }
- else {
- ctx->MutablePixels = GL_FALSE;
- }
-
/* update scissor region */
-
ctx->DrawBuffer->Xmin = 0;
ctx->DrawBuffer->Ymin = 0;
ctx->DrawBuffer->Xmax = ctx->DrawBuffer->Width-1;
ctx->ModelProjectWinMatrixUptodate = 0;
}
+ if (ctx->NewState & NEW_COLOR_MATRIX) {
+ gl_matrix_analyze( &ctx->ColorMatrix );
+ }
+
/* Figure out whether we can light in object space or not. If we
* can, find the current positions of the lights in object space
*/