From dcf4c17fb1624af47181c63af4c3ad29f919c17a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 31 Oct 2005 19:46:55 +0000 Subject: check swrast->_FogEnabled instead of ctx->Fog.Enabled --- src/mesa/swrast/s_bitmap.c | 4 ++-- src/mesa/swrast/s_context.c | 3 ++- src/mesa/swrast/s_copypix.c | 12 ++++++++---- src/mesa/swrast/s_drawpix.c | 11 +++++++---- src/mesa/swrast/s_lines.c | 6 +++--- src/mesa/swrast/s_span.c | 4 ++-- 6 files changed, 24 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 84f0864ae8..dd5008cf6b 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -98,7 +98,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); @@ -220,7 +220,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 05b1d8901e..7b24d3f1fc 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -54,12 +54,13 @@ static void _swrast_update_rasterflags( GLcontext *ctx ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); GLbitfield rasterMask = 0; if (ctx->Color.AlphaEnabled) rasterMask |= ALPHATEST_BIT; if (ctx->Color.BlendEnabled) rasterMask |= BLEND_BIT; if (ctx->Depth.Test) rasterMask |= DEPTH_BIT; - if (ctx->Fog.Enabled) rasterMask |= FOG_BIT; + if (swrast->_FogEnabled) rasterMask |= FOG_BIT; if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT; if (ctx->Stencil.Enabled) rasterMask |= STENCIL_BIT; if (ctx->Visual.rgbMode) { diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 15e78a5d2e..f93cb53685 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -129,6 +129,7 @@ static void copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_renderbuffer *drawRb = NULL; GLboolean quick_draw; GLint row; @@ -141,7 +142,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); @@ -251,6 +252,7 @@ static void copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_renderbuffer *drawRb; GLchan *tmpImage,*p; GLboolean quick_draw; @@ -296,7 +298,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 @@ -390,6 +392,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint *tmpImage,*p; GLint sy, dy, stepy; GLint j; @@ -429,7 +432,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (overlapping) { @@ -496,6 +499,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_framebuffer *fb = ctx->ReadBuffer; struct gl_renderbuffer *readRb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; const GLfloat depthMax = fb->_DepthMaxF; @@ -536,7 +540,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } _swrast_span_default_color(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (overlapping) { diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index ce398b2b7f..bdccd1cad1 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -67,7 +67,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); @@ -456,6 +456,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint imgX = x, imgY = y; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLint row, skipPixels; @@ -465,7 +466,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); /* @@ -561,6 +562,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; @@ -570,7 +572,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _swrast_span_default_color(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); @@ -675,6 +677,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint imgX = x, imgY = y; struct gl_renderbuffer *rb = NULL; /* only used for quickDraw path */ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; @@ -691,7 +694,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (ctx->Fog.Enabled) + if (swrast->_FogEnabled) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 56179bcc05..dccc92cbd2 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -310,7 +310,7 @@ _swrast_choose_line( GLcontext *ctx ) USE(textured_line); } } - else if (ctx->Depth.Test || ctx->Fog.Enabled || ctx->Line._Width != 1.0 + else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0 || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ if (rgbmode) diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 5e26064c64..fbff31b90e 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -868,7 +868,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } /* Interpolate the color indexes if needed */ - if (ctx->Fog.Enabled || + if (swrast->_FogEnabled || ctx->Color.IndexLogicOpEnabled || ctx->Color.IndexMask != 0xffffffff || (span->arrayMask & SPAN_COVERAGE)) { @@ -878,7 +878,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } /* Fog */ - if (ctx->Fog.Enabled) { + if (swrast->_FogEnabled) { _swrast_fog_ci_span(ctx, span); } -- cgit v1.2.3