mesa: Branch 'master'

Brian Paul brianp at kemper.freedesktop.org
Wed Mar 21 15:44:11 UTC 2007


 src/mesa/swrast/s_copypix.c |    7 ++++++-
 src/mesa/swrast/s_drawpix.c |    5 +++++
 src/mesa/swrast/s_readpix.c |    4 ++++
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
diff-tree 249b451d2068c781d29a6527e152b39d08b1c877 (from c5fe807e426988fc0ef931b417b5b3f621250595)
Author: Brian <brian at yutani.localnet.net>
Date:   Wed Mar 21 09:44:03 2007 -0600

    1D convolution (and post-conv scale/bias) were inadvertantly applied to 2D image transfers.

diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 7e8ebb4..b318777 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -199,7 +199,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint s
    GLint sy, dy, stepy, row;
    const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
    GLint overlapping;
-   const GLuint transferOps = ctx->_ImageTransferState;
+   GLuint transferOps = ctx->_ImageTransferState;
    SWspan span;
 
    if (!ctx->ReadBuffer->_ColorReadBuffer) {
@@ -211,6 +211,11 @@ copy_rgba_pixels(GLcontext *ctx, GLint s
       copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty);
       return;
    }
+   else if (ctx->Pixel.Convolution1DEnabled) {
+      /* make sure we don't apply 1D convolution */
+      transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+                       IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+   }
 
    /* Determine if copy should be done bottom-to-top or top-to-bottom */
    if (srcy < desty) {
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index d97d53e..99ad711 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -619,6 +619,11 @@ draw_rgba_pixels( GLcontext *ctx, GLint 
       type = GL_FLOAT;
       transferOps &= IMAGE_POST_CONVOLUTION_BITS;
    }
+   else if (ctx->Pixel.Convolution1DEnabled) {
+      /* we only want to apply 1D convolution to glTexImage1D */
+      transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+                       IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+   }
 
    if (ctx->DrawBuffer->_NumColorDrawBuffers[0] > 0 &&
        ctx->DrawBuffer->_ColorDrawBuffers[0][0]->DataType != GL_FLOAT &&
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index c5524c0..7dc48ae 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -410,6 +410,10 @@ read_rgba_pixels( GLcontext *ctx,
          = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
                                              format, type, 0, 0);
 
+      /* make sure we don't apply 1D convolution */
+      transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+                       IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+
       for (row = 0; row < height; row++, y++) {
 
          /* Get float rgba pixels */



More information about the mesa-commit mailing list