summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-03-29 21:16:25 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-03-29 21:16:25 +0000
commited39a43b8cb2e1cf69b097fc89365cde470ebf51 (patch)
treee886defa720e33ec795c7ffb7941fcab5c5b8e1d /src/mesa/main
parent2780ed4b978b32a08be6eecb0e923250e7b907ee (diff)
Remove ENABLE_* flags, ctx->_Enabled.
Replace with ctx->Texture._TexMatEnabled, ctx->Texture._TexGenEnabled.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/debug.c30
-rw-r--r--src/mesa/main/enable.c10
-rw-r--r--src/mesa/main/mtypes.h48
-rw-r--r--src/mesa/main/points.c3
-rw-r--r--src/mesa/main/state.c14
5 files changed, 23 insertions, 82 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index ee52963d34..7a3a88edf2 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -1,4 +1,4 @@
-/* $Id: debug.c,v 1.11 2001/03/29 17:08:26 keithw Exp $ */
+/* $Id: debug.c,v 1.12 2001/03/29 21:16:25 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -60,34 +60,6 @@ void _mesa_print_state( const char *msg, GLuint state )
}
-void _mesa_print_enable_flags( const char *msg, GLuint flags )
-{
- fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
- msg,
- flags,
- (flags & ENABLE_LIGHT) ? "light, " : "",
- (flags & ENABLE_FOG) ? "fog, " : "",
- (flags & ENABLE_USERCLIP) ? "userclip, " : "",
- (flags & ENABLE_TEXGEN0) ? "tex-gen-0, " : "",
- (flags & ENABLE_TEXGEN1) ? "tex-gen-1, " : "",
- (flags & ENABLE_TEXGEN2) ? "tex-gen-2, " : "",
- (flags & ENABLE_TEXGEN3) ? "tex-gen-3, " : "",
- (flags & ENABLE_TEXGEN4) ? "tex-gen-4, " : "",
- (flags & ENABLE_TEXGEN5) ? "tex-gen-5, " : "",
- (flags & ENABLE_TEXGEN6) ? "tex-gen-6, " : "",
- (flags & ENABLE_TEXGEN7) ? "tex-gen-7, " : "",
- (flags & ENABLE_TEXMAT0) ? "tex-mat-0, " : "",
- (flags & ENABLE_TEXMAT1) ? "tex-mat-1, " : "",
- (flags & ENABLE_TEXMAT2) ? "tex-mat-2, " : "",
- (flags & ENABLE_TEXMAT3) ? "tex-mat-3, " : "",
- (flags & ENABLE_TEXMAT4) ? "tex-mat-4, " : "",
- (flags & ENABLE_TEXMAT5) ? "tex-mat-5, " : "",
- (flags & ENABLE_TEXMAT6) ? "tex-mat-6, " : "",
- (flags & ENABLE_TEXMAT7) ? "tex-mat-7, " : "",
- (flags & ENABLE_NORMALIZE) ? "normalize, " : "",
- (flags & ENABLE_RESCALE) ? "rescale, " : "");
-}
void _mesa_print_tri_caps( const char *name, GLuint flags )
{
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 4eff8043bc..173b4b0f22 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.47 2001/03/29 17:08:26 keithw Exp $ */
+/* $Id: enable.c,v 1.48 2001/03/29 21:16:25 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -175,7 +175,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Transform.ClipEnabled[p] = state;
if (state) {
- ctx->_Enabled |= ENABLE_USERCLIP;
ctx->Transform._AnyClip++;
if (ctx->ProjectionMatrix.flags & MAT_DIRTY) {
@@ -189,9 +188,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
_mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],
ctx->ProjectionMatrix.inv );
- } else {
- if (--ctx->Transform._AnyClip == 0)
- ctx->_Enabled &= ~ENABLE_USERCLIP;
}
}
break;
@@ -235,7 +231,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Enabled = state;
- ctx->_Enabled ^= ENABLE_FOG;
break;
case GL_HISTOGRAM:
if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) {
@@ -272,7 +267,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Enabled = state;
- ctx->_Enabled ^= ENABLE_LIGHT;
if ((ctx->Light.Enabled &&
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
@@ -427,7 +421,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
ctx->Transform.Normalize = state;
- ctx->_Enabled ^= ENABLE_NORMALIZE;
break;
case GL_POINT_SMOOTH:
if (ctx->Point.SmoothFlag==state)
@@ -474,7 +467,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
ctx->Transform.RescaleNormals = state;
- ctx->_Enabled ^= ENABLE_RESCALE;
break;
case GL_SCISSOR_TEST:
if (ctx->Scissor.Enabled==state)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 66290fd7fa..8113a243d4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.37 2001/03/29 17:08:26 keithw Exp $ */
+/* $Id: mtypes.h,v 1.38 2001/03/29 21:16:25 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -703,16 +703,9 @@ struct gl_stencil_attrib {
#define TEXGEN_REFLECTION_MAP_NV 0x8
#define TEXGEN_NORMAL_MAP_NV 0x10
-#define TEXGEN_NEED_M (TEXGEN_SPHERE_MAP)
-#define TEXGEN_NEED_F (TEXGEN_SPHERE_MAP | \
- TEXGEN_REFLECTION_MAP_NV)
#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
TEXGEN_REFLECTION_MAP_NV | \
TEXGEN_NORMAL_MAP_NV)
-#define TEXGEN_NEED_VERTICES (TEXGEN_OBJ_LINEAR | \
- TEXGEN_EYE_LINEAR | \
- TEXGEN_REFLECTION_MAP_NV | \
- TEXGEN_SPHERE_MAP )
#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
TEXGEN_REFLECTION_MAP_NV | \
TEXGEN_NORMAL_MAP_NV | \
@@ -730,36 +723,19 @@ struct gl_stencil_attrib {
#define ENABLE_TEXGEN5 0x20
#define ENABLE_TEXGEN6 0x40
#define ENABLE_TEXGEN7 0x80
-#define ENABLE_TEXMAT0 0x100 /* Ie. not the identity matrix */
-#define ENABLE_TEXMAT1 0x200
-#define ENABLE_TEXMAT2 0x400
-#define ENABLE_TEXMAT3 0x800
-#define ENABLE_TEXMAT4 0x1000
-#define ENABLE_TEXMAT5 0x2000
-#define ENABLE_TEXMAT6 0x4000
-#define ENABLE_TEXMAT7 0x8000
-#define ENABLE_LIGHT 0x10000
-#define ENABLE_FOG 0x20000
-#define ENABLE_USERCLIP 0x40000
-#define ENABLE_NORMALIZE 0x100000
-#define ENABLE_RESCALE 0x200000
-#define ENABLE_POINT_ATTEN 0x400000
-
-
-#define ENABLE_TEXGEN_ANY (ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | \
- ENABLE_TEXGEN2 | ENABLE_TEXGEN3 | \
- ENABLE_TEXGEN4 | ENABLE_TEXGEN5 | \
- ENABLE_TEXGEN6 | ENABLE_TEXGEN7)
-
-#define ENABLE_TEXMAT_ANY (ENABLE_TEXMAT0 | ENABLE_TEXMAT1 | \
- ENABLE_TEXMAT2 | ENABLE_TEXMAT3 | \
- ENABLE_TEXMAT4 | ENABLE_TEXMAT5 | \
- ENABLE_TEXMAT6 | ENABLE_TEXMAT7)
+
+#define ENABLE_TEXMAT0 0x1 /* Ie. not the identity matrix */
+#define ENABLE_TEXMAT1 0x2
+#define ENABLE_TEXMAT2 0x4
+#define ENABLE_TEXMAT3 0x8
+#define ENABLE_TEXMAT4 0x10
+#define ENABLE_TEXMAT5 0x20
+#define ENABLE_TEXMAT6 0x40
+#define ENABLE_TEXMAT7 0x80
#define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i))
#define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i))
-
/*
* If teximage is color-index, texelOut returns GLchan[1].
* If teximage is depth, texelOut returns GLfloat[1].
@@ -931,7 +907,10 @@ struct gl_texture_attrib {
/* = (Unit[0]._ReallyEnabled << 0) | */
/* (Unit[1]._ReallyEnabled << 4) | */
/* (Unit[2]._ReallyEnabled << 8) | etc... */
+
GLuint _GenFlags; /* for texgen */
+ GLuint _TexGenEnabled;
+ GLuint _TexMatEnabled;
struct gl_texture_unit Unit[MAX_TEXTURE_UNITS];
@@ -1536,7 +1515,6 @@ struct __GLcontextRec {
GLuint NewState; /* bitwise-or of _NEW_* flags */
/* Derived */
- GLuint _Enabled; /* bitwise-or of ENABLE_* flags */
GLuint _TriangleCaps; /* bitwise-or of DD_* flags */
GLuint _ImageTransferState;/* bitwise-or of IMAGE_*_BIT flags */
GLfloat _EyeZDir[3];
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 493a96c0e9..54583c7b4e 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -1,4 +1,4 @@
-/* $Id: points.c,v 1.30 2001/03/12 00:48:38 gareth Exp $ */
+/* $Id: points.c,v 1.31 2001/03/29 21:16:25 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -102,7 +102,6 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
params[2] != 0.0);
if (tmp != ctx->Point._Attenuated) {
- ctx->_Enabled ^= ENABLE_POINT_ATTEN;
ctx->_TriangleCaps ^= DD_POINT_ATTEN;
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
}
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 4ba7776f4a..5586f7e4bd 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.63 2001/03/29 17:08:26 keithw Exp $ */
+/* $Id: state.c,v 1.64 2001/03/29 21:16:25 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -712,7 +712,7 @@ update_texture_matrices( GLcontext *ctx )
{
GLuint i;
- ctx->_Enabled &= ~ENABLE_TEXMAT_ANY;
+ ctx->Texture._TexMatEnabled = 0;
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
if (ctx->TextureMatrix[i].flags & MAT_DIRTY) {
@@ -723,7 +723,7 @@ update_texture_matrices( GLcontext *ctx )
if (ctx->Texture.Unit[i]._ReallyEnabled &&
ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
- ctx->_Enabled |= ENABLE_TEXMAT0 << i;
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
}
}
}
@@ -746,8 +746,8 @@ update_texture_state( GLcontext *ctx )
ctx->Texture._GenFlags = 0;
ctx->_NeedNormals &= ~NEED_NORMALS_TEXGEN;
ctx->_NeedEyeCoords &= ~NEED_EYE_TEXGEN;
- ctx->_Enabled &= ~(ENABLE_TEXGEN_ANY |
- ENABLE_TEXMAT_ANY);
+ ctx->Texture._TexMatEnabled = 0;
+ ctx->Texture._TexGenEnabled = 0;
/* Update texture unit state.
*/
@@ -831,12 +831,12 @@ update_texture_state( GLcontext *ctx )
texUnit->_GenFlags |= texUnit->_GenBitR;
}
- ctx->_Enabled |= ENABLE_TEXGEN0 << i;
+ ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(i);
ctx->Texture._GenFlags |= texUnit->_GenFlags;
}
if (ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
- ctx->_Enabled |= ENABLE_TEXMAT0 << i;
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
}
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS) {