check swrast->_FogEnabled instead of ctx->Fog.Enabled
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 31 Oct 2005 19:46:55 +0000 (19:46 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 31 Oct 2005 19:46:55 +0000 (19:46 +0000)
src/mesa/swrast/s_bitmap.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_copypix.c
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_lines.c
src/mesa/swrast/s_span.c

index 84f0864ae8e6587fdffec62ac868964f5a09197e..dd5008cf6b92e70f9e5178347544625cbf9b6d12 100644 (file)
@@ -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);
index 05b1d8901e213db7cb1d9ff73df43d2add93a772..7b24d3f1fc8cc77fe516842a7475425a89181eca 100644 (file)
 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) {
index 15e78a5d2e3ff82a9ccf81b0777b3d8aa894ac32..f93cb536851637736fd15236ca4010f80136af4a 100644 (file)
@@ -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) {
index ce398b2b7f73cb1fc3936cd7247f76378dcebe2c..bdccd1cad1957810564eaabce41c5e30c86a6e40 100644 (file)
@@ -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);
index 56179bcc05a79ee27a6034839ec7038ddc17f2e0..dccc92cbd284b387ecea4426b84d011616758c0e 100644 (file)
@@ -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)
index 5e26064c64c413900fdba1213fee3244777991ca..fbff31b90e3a0cdf0cd859935c641fecb1401504 100644 (file)
@@ -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);
    }