summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/d3d/D3Dvbrender.c6
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c6
-rw-r--r--src/mesa/drivers/windows/wmesa.c8
-rw-r--r--src/mesa/drivers/windows/wmesa_stereo.c34
-rw-r--r--src/mesa/drivers/x11/xm_line.c6
-rw-r--r--src/mesa/drivers/x11/xm_tri.c4
-rw-r--r--src/mesa/main/attrib.c256
-rw-r--r--src/mesa/main/context.c3
-rw-r--r--src/mesa/main/state.c9
9 files changed, 181 insertions, 151 deletions
diff --git a/src/mesa/drivers/d3d/D3Dvbrender.c b/src/mesa/drivers/d3d/D3Dvbrender.c
index 6ed8037902..0ef32e26ce 100644
--- a/src/mesa/drivers/d3d/D3Dvbrender.c
+++ b/src/mesa/drivers/d3d/D3Dvbrender.c
@@ -1511,7 +1511,7 @@ static void SetRenderStates( GLcontext *ctx )
/*================================================*/
/* Check too see if there are new TEXTURE states. */
/*================================================*/
- if ( ctx->Texture.Enabled )
+ if ( ctx->Texture.ReallyEnabled )
{
switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode )
{
@@ -1871,9 +1871,9 @@ static void DebugRenderStates( GLcontext *ctx, BOOL bForce )
/*================================================*/
/* Check too see if there are new TEXTURE states. */
/*================================================*/
- if ( texture != ctx->Texture.Enabled )
+ if ( texture != ctx->Texture.ReallyEnabled )
{
- texture = ctx->Texture.Enabled;
+ texture = ctx->Texture.ReallyEnabled;
DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" ));
}
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 11336e5cd9..55fe26181e 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.21 2000/09/26 20:54:12 brianp Exp $ */
+/* $Id: osmesa.c,v 1.22 2000/09/28 22:44:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1395,7 +1395,7 @@ static line_func choose_line_function( GLcontext *ctx )
OSMesaContext osmesa = (OSMesaContext) ctx;
if (ctx->Line.SmoothFlag) return NULL;
- if (ctx->Texture.Enabled) return NULL;
+ if (ctx->Texture.ReallyEnabled) return NULL;
if (ctx->Light.ShadeModel!=GL_FLAT) return NULL;
if (ctx->Line.Width==1.0F
@@ -1581,7 +1581,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx )
if (ctx->Polygon.SmoothFlag) return NULL;
if (ctx->Polygon.StippleFlag) return NULL;
- if (ctx->Texture.Enabled) return NULL;
+ if (ctx->Texture.ReallyEnabled) return NULL;
if (ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c
index b372469288..6b2b02bc35 100644
--- a/src/mesa/drivers/windows/wmesa.c
+++ b/src/mesa/drivers/windows/wmesa.c
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.8 2000/09/26 20:54:13 brianp Exp $ */
+/* $Id: wmesa.c,v 1.9 2000/09/28 22:44:32 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
@@ -651,7 +651,7 @@ extern points_func choose_points_function( GLcontext* ctx )
{
STARTPROFILE
if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0
- && !ctx->Texture.Enabled && ctx->Visual->RGBAflag) {
+ && !ctx->Texture.ReallyEnabled && ctx->Visual->RGBAflag) {
ENDPROFILE(choose_points_function)
return fast_rgb_points;
}
@@ -709,7 +709,7 @@ static line_func choose_line_function( GLcontext* ctx )
STARTPROFILE
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag
&& ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0
- && !ctx->Texture.Enabled && Current->rgb_flag) {
+ && !ctx->Texture.ReallyEnabled && Current->rgb_flag) {
ENDPROFILE(choose_line_function)
return fast_flat_rgb_line;
}
@@ -2851,7 +2851,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx )
int depth = wmesa->cColorBits;
if (ctx->Polygon.SmoothFlag) return NULL;
- if (ctx->Texture.Enabled) return NULL;
+ if (ctx->Texture.ReallyEnabled) return NULL;
if (!wmesa->db_flag) return NULL;
/*if (wmesa->xm_buffer->buffer==XIMAGE)*/ {
if ( ctx->Light.ShadeModel==GL_SMOOTH
diff --git a/src/mesa/drivers/windows/wmesa_stereo.c b/src/mesa/drivers/windows/wmesa_stereo.c
index 3408fe943c..70251ae877 100644
--- a/src/mesa/drivers/windows/wmesa_stereo.c
+++ b/src/mesa/drivers/windows/wmesa_stereo.c
@@ -420,7 +420,7 @@ extern points_func choose_points_function( GLcontext* ctx )
{
STARTPROFILE
if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0
- && !ctx->Texture.Enabled && ctx->Visual->RGBAflag) {
+ && !ctx->Texture.ReallyEnabled && ctx->Visual->RGBAflag) {
ENDPROFILE(choose_points_function)
return fast_rgb_points;
}
@@ -478,7 +478,7 @@ static line_func choose_line_function( GLcontext* ctx )
STARTPROFILE
if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag
&& ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0
- && !ctx->Texture.Enabled && Current->rgb_flag) {
+ && !ctx->Texture.ReallyEnabled && Current->rgb_flag) {
ENDPROFILE(choose_line_function)
return fast_flat_rgb_line;
}
@@ -589,7 +589,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx )
{
if (ctx->Polygon.SmoothFlag) return NULL;
if (ctx->Polygon.StippleFlag) return NULL;
- if (ctx->Texture.Enabled) return NULL;
+ if (ctx->Texture.ReallyEnabled) return NULL;
if (ctx->RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
@@ -657,15 +657,15 @@ static void fast_flat_rgb_polygon( GLcontext* ctx, GLuint n, GLuint vlist[], GLu
/* Return pointer to accerated polygon function */
static polygon_func choose_polygon_function( GLcontext* ctx )
{
- STARTPROFILE
+ STARTPROFILE
if (!ctx->Polygon.SmoothFlag && !ctx->Polygon.StippleFlag
&& ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0
- && !ctx->Texture.Enabled && Current->rgb_flag==GL_TRUE) {
- ENDPROFILE(choose_polygon_function)
+ && !ctx->Texture.ReallyEnabled && Current->rgb_flag==GL_TRUE) {
+ ENDPROFILE(choose_polygon_function)
return fast_flat_rgb_polygon;
}
else {
- ENDPROFILE(choose_polygon_function)
+ ENDPROFILE(choose_polygon_function)
return NULL;
}
}
@@ -679,18 +679,18 @@ static polygon_func choose_polygon_function( GLcontext* ctx )
/* Write a horizontal span of color-index pixels with a boolean mask. */
static void write_index_span( GLcontext* ctx,
- GLuint n, GLint x, GLint y,
- const GLuint index[],
+ GLuint n, GLint x, GLint y,
+ const GLuint index[],
const GLubyte mask[] )
{
- STARTPROFILE
- GLuint i;
- char *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
- assert(Current->rgb_flag==GL_FALSE);
- for (i=0; i<n; i++)
- if (mask[i])
- Mem[i]=index[i];
- ENDPROFILE(write_index_span)
+ STARTPROFILE
+ GLuint i;
+ char *Mem=Current->ScreenMem+y*Current->ScanWidth+x;
+ assert(Current->rgb_flag==GL_FALSE);
+ for (i=0; i<n; i++)
+ if (mask[i])
+ Mem[i]=index[i];
+ ENDPROFILE(write_index_span)
}
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 03af57b3bf..7a51948212 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -1,4 +1,4 @@
-/* $Id: xm_line.c,v 1.3 2000/09/26 20:54:13 brianp Exp $ */
+/* $Id: xm_line.c,v 1.4 2000/09/28 22:44:32 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -98,7 +98,7 @@ points_func xmesa_get_points_func( GLcontext *ctx )
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
if (ctx->Point.Size==1.0F && !ctx->Point.SmoothFlag && ctx->RasterMask==0
- && !ctx->Texture.Enabled) {
+ && !ctx->Texture.ReallyEnabled) {
if (xmesa->xm_buffer->buffer==XIMAGE) {
return (points_func) NULL; /*draw_points_ximage;*/
}
@@ -674,7 +674,7 @@ line_func xmesa_get_line_func( GLcontext *ctx )
(void) kernel1; /* silence unused var warning */
if (ctx->Line.SmoothFlag) return (line_func)NULL;
- if (ctx->Texture.Enabled) return (line_func)NULL;
+ if (ctx->Texture.ReallyEnabled) return (line_func)NULL;
if (ctx->Light.ShadeModel!=GL_FLAT) return (line_func)NULL;
/* X line stippling doesn't match OpenGL stippling */
if (ctx->Line.StippleFlag==GL_TRUE) return (line_func)NULL;
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 29b97a03b0..5392c0f353 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.3 2000/09/26 20:54:13 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.4 2000/09/28 22:44:32 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1541,7 +1541,7 @@ triangle_func xmesa_get_triangle_func( GLcontext *ctx )
(void) kernel1;
if (ctx->Polygon.SmoothFlag) return (triangle_func)NULL;
- if (ctx->Texture.Enabled) return (triangle_func)NULL;
+ if (ctx->Texture.ReallyEnabled) return (triangle_func)NULL;
if (xmesa->xm_buffer->buffer==XIMAGE) {
if ( ctx->Light.ShadeModel==GL_SMOOTH
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index b3c3643513..9cf1d3c509 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.27 2000/09/26 20:53:53 brianp Exp $ */
+/* $Id: attrib.c,v 1.28 2000/09/28 22:44:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -213,8 +213,8 @@ _mesa_PushAttrib(GLbitfield mask)
attr->RescaleNormals = ctx->Transform.RescaleNormals;
attr->Scissor = ctx->Scissor.Enabled;
attr->Stencil = ctx->Stencil.Enabled;
- attr->Texture = ctx->Texture.Enabled;
for (i=0; i<MAX_TEXTURE_UNITS; i++) {
+ attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
}
newnode = new_attrib_node( GL_ENABLE_BIT );
@@ -393,6 +393,147 @@ _mesa_PushAttrib(GLbitfield mask)
+static void
+pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
+{
+ GLuint i;
+
+#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
+ if ((VALUE) != (NEWVALUE)) { \
+ _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
+ }
+
+ TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
+ TEST_AND_UPDATE(ctx->Transform.Normalize, enable->AutoNormal, GL_NORMALIZE);
+ TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND);
+
+ for (i=0;i<MAX_CLIP_PLANES;i++) {
+ if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i])
+ _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
+ enable->ClipPlane[i]);
+ }
+
+ TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
+ GL_COLOR_MATERIAL);
+ TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
+ TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
+ TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D,
+ GL_CONVOLUTION_1D);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D,
+ GL_CONVOLUTION_2D);
+ TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D,
+ GL_SEPARABLE_2D);
+ TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
+ TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
+ TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
+ TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple,
+ GL_LINE_STIPPLE);
+ TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp,
+ GL_INDEX_LOGIC_OP);
+ TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp,
+ GL_COLOR_LOGIC_OP);
+ TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4);
+ TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX);
+ TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1,
+ GL_MAP1_TEXTURE_COORD_1);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2,
+ GL_MAP1_TEXTURE_COORD_2);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3,
+ GL_MAP1_TEXTURE_COORD_3);
+ TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4,
+ GL_MAP1_TEXTURE_COORD_4);
+ TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3,
+ GL_MAP1_VERTEX_3);
+ TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4,
+ GL_MAP1_VERTEX_4);
+ TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4);
+ TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX);
+ TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1,
+ GL_MAP2_TEXTURE_COORD_1);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2,
+ GL_MAP2_TEXTURE_COORD_2);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3,
+ GL_MAP2_TEXTURE_COORD_3);
+ TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4,
+ GL_MAP2_TEXTURE_COORD_4);
+ TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3,
+ GL_MAP2_VERTEX_3);
+ TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4,
+ GL_MAP2_VERTEX_4);
+ TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
+ TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals,
+ GL_RESCALE_NORMAL_EXT);
+ TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture,
+ GL_POINT_SMOOTH);
+ TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
+ GL_POINT_SMOOTH);
+ TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint,
+ GL_POLYGON_OFFSET_POINT);
+ TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine,
+ GL_POLYGON_OFFSET_LINE);
+ TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill,
+ GL_POLYGON_OFFSET_FILL);
+ TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth,
+ GL_POLYGON_SMOOTH);
+ TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple,
+ GL_POLYGON_STIPPLE);
+ TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
+ TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
+#undef TEST_AND_UPDATE
+
+ /* texture unit enables */
+ for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ if (ctx->Texture.Unit[i].Enabled != enable->Texture[i]) {
+ ctx->Texture.Unit[i].Enabled = enable->Texture[i];
+ if (ctx->Driver.Enable) {
+ if (ctx->Driver.ActiveTexture) {
+ (*ctx->Driver.ActiveTexture)(ctx, i);
+ }
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D,
+ (GLboolean) (enable->Texture[i] & TEXTURE0_1D) );
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D,
+ (GLboolean) (enable->Texture[i] & TEXTURE0_2D) );
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D,
+ (GLboolean) (enable->Texture[i] & TEXTURE0_3D) );
+ }
+ }
+
+ if (ctx->Texture.Unit[i].TexGenEnabled != enable->TexGen[i]) {
+ ctx->Texture.Unit[i].TexGenEnabled = enable->TexGen[i];
+ if (ctx->Driver.Enable) {
+ if (ctx->Driver.ActiveTexture) {
+ (*ctx->Driver.ActiveTexture)(ctx, i);
+ }
+ if (enable->TexGen[i] & S_BIT)
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_TRUE);
+ else
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_FALSE);
+ if (enable->TexGen[i] & T_BIT)
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_TRUE);
+ else
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_FALSE);
+ if (enable->TexGen[i] & R_BIT)
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_TRUE);
+ else
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_FALSE);
+ if (enable->TexGen[i] & Q_BIT)
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_TRUE);
+ else
+ (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
+ }
+ }
+ }
+
+ if (ctx->Driver.ActiveTexture) {
+ (*ctx->Driver.ActiveTexture)(ctx, ctx->Texture.CurrentUnit);
+ }
+}
+
+
+
/*
* This function is kind of long just because we have to call a lot
* of device driver functions to update device driver state.
@@ -495,116 +636,7 @@ _mesa_PopAttrib(void)
{
const struct gl_enable_attrib *enable;
enable = (const struct gl_enable_attrib *) attr->data;
-
-#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \
- if ((VALUE) != (NEWVALUE)) { \
- _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \
- }
-
- TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST);
- TEST_AND_UPDATE(ctx->Transform.Normalize, enable->AutoNormal, GL_NORMALIZE);
- TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND);
- {
- GLuint i;
- for (i=0;i<MAX_CLIP_PLANES;i++) {
- if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i])
- _mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] );
- }
- }
- TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL);
- TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
- TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
- TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
- TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, GL_CONVOLUTION_1D);
- TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, GL_CONVOLUTION_2D);
- TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, GL_SEPARABLE_2D);
- TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
- TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
- TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
- TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple, GL_LINE_STIPPLE);
- TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp, GL_INDEX_LOGIC_OP);
- TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp, GL_COLOR_LOGIC_OP);
- TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4);
- TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX);
- TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1, GL_MAP1_TEXTURE_COORD_1);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2, GL_MAP1_TEXTURE_COORD_2);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3, GL_MAP1_TEXTURE_COORD_3);
- TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4, GL_MAP1_TEXTURE_COORD_4);
- TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3, GL_MAP1_VERTEX_3);
- TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4, GL_MAP1_VERTEX_4);
- TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4);
- TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX);
- TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1, GL_MAP2_TEXTURE_COORD_1);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2, GL_MAP2_TEXTURE_COORD_2);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3, GL_MAP2_TEXTURE_COORD_3);
- TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4, GL_MAP2_TEXTURE_COORD_4);
- TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3, GL_MAP2_VERTEX_3);
- TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4);
- TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE);
- TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, GL_RESCALE_NORMAL_EXT);
- TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture, GL_POINT_SMOOTH);
- TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH);
- TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT);
- TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE);
- TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill, GL_POLYGON_OFFSET_FILL);
- TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth, GL_POLYGON_SMOOTH);
- TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple, GL_POLYGON_STIPPLE);
- TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
- TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
- if (ctx->Texture.Enabled != enable->Texture) {
- ctx->Texture.Enabled = enable->Texture;
- if (ctx->Driver.Enable) {
- if (ctx->Driver.ActiveTexture)
- (*ctx->Driver.ActiveTexture)( ctx, 0 );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, (GLboolean) (enable->Texture & TEXTURE0_1D) );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, (GLboolean) (enable->Texture & TEXTURE0_2D) );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, (GLboolean) (enable->Texture & TEXTURE0_3D) );
- if (ctx->Driver.ActiveTexture)
- (*ctx->Driver.ActiveTexture)( ctx, 1 );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, (GLboolean) (enable->Texture & TEXTURE1_1D) );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, (GLboolean) (enable->Texture & TEXTURE1_2D) );
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, (GLboolean) (enable->Texture & TEXTURE1_3D) );
- if (ctx->Driver.ActiveTexture)
- (*ctx->Driver.ActiveTexture)( ctx, ctx->Texture.CurrentUnit );
- }
- }
-#undef TEST_AND_UPDATE
- {
- GLuint i;
- for (i=0; i<MAX_TEXTURE_UNITS; i++) {
- if (ctx->Texture.Unit[i].TexGenEnabled != enable->TexGen[i]) {
- ctx->Texture.Unit[i].TexGenEnabled = enable->TexGen[i];
-
- /* ctx->Enabled recalculated in state change
- processing */
-
- if (ctx->Driver.Enable) {
- if (ctx->Driver.ActiveTexture)
- (*ctx->Driver.ActiveTexture)( ctx, i );
- if (enable->TexGen[i] & S_BIT)
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_TRUE);
- else
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_FALSE);
- if (enable->TexGen[i] & T_BIT)
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_TRUE);
- else
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_FALSE);
- if (enable->TexGen[i] & R_BIT)
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_TRUE);
- else
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_FALSE);
- if (enable->TexGen[i] & Q_BIT)
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_TRUE);
- else
- (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
- }
- }
- }
- if (ctx->Driver.ActiveTexture)
- (*ctx->Driver.ActiveTexture)( ctx, ctx->Texture.CurrentUnit );
- }
+ pop_enable_group(ctx, enable);
}
break;
case GL_EVAL_BIT:
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index a66bb13972..018e709d90 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.90 2000/09/26 20:53:53 brianp Exp $ */
+/* $Id: context.c,v 1.91 2000/09/28 22:44:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1178,7 +1178,6 @@ init_attrib_groups( GLcontext *ctx )
/* Texture group */
ctx->Texture.CurrentUnit = 0; /* multitexture */
ctx->Texture.CurrentTransformUnit = 0; /* multitexture */
- ctx->Texture.Enabled = 0;
ctx->Texture.ReallyEnabled = 0;
for (i=0; i<MAX_TEXTURE_UNITS; i++)
init_texture_unit( ctx, i );
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 3578d28f89..f1cbf9814c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.28 2000/09/26 20:53:53 brianp Exp $ */
+/* $Id: state.c,v 1.29 2000/09/28 22:44:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -671,7 +671,7 @@ static void update_fog_mode( GLcontext *ctx )
int old_mode = ctx->FogMode;
if (ctx->Fog.Enabled) {
- if (ctx->Texture.Enabled)
+ if (ctx->Texture.ReallyEnabled)
ctx->FogMode = FOG_FRAGMENT;
else if (ctx->Hint.Fog == GL_NICEST)
ctx->FogMode = FOG_FRAGMENT;
@@ -818,7 +818,7 @@ void gl_update_state( GLcontext *ctx )
gl_update_client_state( ctx );
if ((ctx->NewState & NEW_TEXTURE_ENABLE) &&
- (ctx->Enabled & ENABLE_TEX_ANY) != ctx->Texture.Enabled)
+ (ctx->Enabled & ENABLE_TEX_ANY) != ctx->Texture.ReallyEnabled)
ctx->NewState |= NEW_TEXTURING | NEW_RASTER_OPS;
if (ctx->NewState & NEW_TEXTURE_ENV) {
@@ -872,7 +872,6 @@ void gl_update_state( GLcontext *ctx )
}
}
- ctx->Texture.Enabled = ctx->Enabled & ENABLE_TEX_ANY;
ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
}
@@ -1072,7 +1071,7 @@ void gl_update_state( GLcontext *ctx )
}
ctx->NeedEyeNormals = ctx->NeedEyeCoords;
}
- if (ctx->Texture.Enabled || ctx->RenderMode==GL_FEEDBACK) {
+ if (ctx->Texture.ReallyEnabled || ctx->RenderMode==GL_FEEDBACK) {
if (ctx->Texture.NeedEyeCoords) ctx->NeedEyeCoords = GL_TRUE;
if (ctx->Texture.NeedNormals)
ctx->NeedNormals = ctx->NeedEyeNormals = GL_TRUE;