mesa: remove the noClamp parameter to _mesa_pack_rgba_span_float()
authorBrian Paul <brianp@vmware.com>
Fri, 3 Apr 2009 23:28:35 +0000 (17:28 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 3 Apr 2009 23:28:35 +0000 (17:28 -0600)
It was only set to GL_TRUE in one place where it isn't really needed
(glGetTexImage(sRGB format)).

src/mesa/main/colortab.c
src/mesa/main/convolve.c
src/mesa/main/histogram.c
src/mesa/main/image.c
src/mesa/main/image.h
src/mesa/main/texstore.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/swrast/s_readpix.c

index b05c0513aa6cff2765084fb38ebb765d75f9d2a0..bd9cf438b4f5f9ed223462da5267a1187cadaff0 100644 (file)
@@ -718,7 +718,7 @@ _mesa_GetColorTable( GLenum target, GLenum format,
    }
 
    _mesa_pack_rgba_span_float(ctx, table->Size, rgba,
-                              format, type, data, &ctx->Pack, 0x0, GL_FALSE);
+                              format, type, data, &ctx->Pack, 0x0);
 
    if (ctx->Pack.BufferObj->Name) {
       ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT,
index 63b652bf7050b1c3e418548d19ceefbe6ddfa96b..814c6a0a5a6b13d24d8f7b4d7b58bf32cd589dee 100644 (file)
@@ -626,7 +626,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
                                           row, 0);
       GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4);
       _mesa_pack_rgba_span_float(ctx, filter->Width, src,
-                                 format, type, dst, &ctx->Pack, 0x0, GL_FALSE);
+                                 format, type, dst, &ctx->Pack, 0x0);
    }
 
    if (ctx->Pack.BufferObj->Name) {
@@ -836,7 +836,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
                                           format, type, 0);
       _mesa_pack_rgba_span_float(ctx, filter->Width,
                                  (GLfloat (*)[4]) filter->Filter,
-                                 format, type, dst, &ctx->Pack, 0x0, GL_FALSE);
+                                 format, type, dst, &ctx->Pack, 0x0);
    }
 
    /* Column filter */
@@ -845,7 +845,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
                                           format, type, 0);
       GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart);
       _mesa_pack_rgba_span_float(ctx, filter->Height, src,
-                                 format, type, dst, &ctx->Pack, 0x0, GL_FALSE);
+                                 format, type, dst, &ctx->Pack, 0x0);
    }
 
    (void) span;  /* unused at this time */
index febf8d99c456b745869ae6d58d11f2271aca050b..905c1ad830107f044a13e5360bfeec7d4d586424 100644 (file)
@@ -684,7 +684,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo
       minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F);
       minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F);
       _mesa_pack_rgba_span_float(ctx, 2, minmax,
-                                 format, type, values, &ctx->Pack, 0x0, GL_FALSE);
+                                 format, type, values, &ctx->Pack, 0x0);
    }
 
    if (ctx->Pack.BufferObj->Name) {
index 44972ae8e2cfab77a40174a7c4b0b986e5c95cd1..5cb110f3a5da70d1a71905776ba7779a4804a63d 100644 (file)
@@ -1677,7 +1677,6 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n,
  * Used to pack an array [][4] of RGBA float colors as specified
  * by the dstFormat, dstType and dstPacking.  Used by glReadPixels,
  * glGetConvolutionFilter(), etc.
- * Incoming colors will be clamped to [0,1] if needed.
  * Note: the rgba values will be modified by this function when any pixel
  * transfer ops are enabled.
  */
@@ -1686,13 +1685,17 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
                            GLenum dstFormat, GLenum dstType,
                            GLvoid *dstAddr,
                            const struct gl_pixelstore_attrib *dstPacking,
-                           GLbitfield transferOps, GLboolean noClamp)
+                           GLbitfield transferOps)
 {
    GLfloat luminance[MAX_WIDTH];
    const GLint comps = _mesa_components_in_format(dstFormat);
    GLuint i;
 
-   if ((!noClamp) && (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE)) {
+   /* XXX
+    * This test should probably go away.  Have the caller set/clear the
+    * IMAGE_CLAMP_BIT as needed.
+    */
+   if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
       /* need to clamp to [0, 1] */
       transferOps |= IMAGE_CLAMP_BIT;
    }
index fb7a5c0e9031a29f651bba3c954869e8beba7f07..b26c27e5a8ac7976781a076440e00b8ba66267cb 100644 (file)
@@ -178,7 +178,7 @@ extern void
 _mesa_pack_rgba_span_float( GLcontext *ctx, GLuint n, GLfloat rgba[][4],
                             GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
                             const struct gl_pixelstore_attrib *dstPacking,
-                            GLbitfield transferOps, GLboolean noClamp );
+                            GLbitfield transferOps );
 
 
 extern void
index 28e9d5c3ecbda43ffa80b624a805eb88a906ac07..bde69b11485a48447c814070b0e9b0440d773b43 100644 (file)
@@ -417,7 +417,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims,
                                           (GLfloat (*)[4]) src,
                                           logicalBaseFormat, GL_FLOAT,
                                           dst, &ctx->DefaultPacking,
-                                          postConvTransferOps, GL_FALSE);
+                                          postConvTransferOps);
                src += convWidth * 4;
                dst += convWidth * logComponents;
             }
@@ -4102,7 +4102,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
                }
                _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
                                           format, type, dest,
-                                          &ctx->Pack, transferOps, GL_TRUE);
+                                          &ctx->Pack, transferOps);
             }
 #endif /* FEATURE_EXT_texture_sRGB */
             else {
@@ -4146,7 +4146,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
                }
                _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
                                           format, type, dest,
-                                          &ctx->Pack, transferOps, GL_FALSE);
+                                          &ctx->Pack, transferOps);
             } /* format */
          } /* row */
       } /* img */
index c11973cdb3d33ae3223e3ac5ba633f8cfad7fa74..ce7a8cda4e86e7167b4149c89c190c740f90011d 100644 (file)
@@ -486,7 +486,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             df += dfStride;
             if (!dfStride) {
                _mesa_pack_rgba_span_float(ctx, width, temp, format, type, dst,
-                                          &clippedPacking, transferOps, GL_FALSE);
+                                          &clippedPacking, transferOps);
                dst += dstStride;
             }
          }
index 524ac4ee2193ce480a576a4036c82b4066368604..e901fc6b5dcdd2d66fc648f3beda019627ad6d98 100644 (file)
@@ -396,7 +396,7 @@ read_rgba_pixels( GLcontext *ctx,
                                       format, type, row, 0);
          _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src,
                                     format, type, dest, packing,
-                                    transferOps & IMAGE_POST_CONVOLUTION_BITS, GL_FALSE);
+                                    transferOps & IMAGE_POST_CONVOLUTION_BITS);
          src += width * 4;
       }
       _mesa_free(convImage);
@@ -441,7 +441,7 @@ read_rgba_pixels( GLcontext *ctx,
 
          /* pack the row of RGBA pixels into user's buffer */
          _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst,
-                                    packing, transferOps, GL_FALSE);
+                                    packing, transferOps);
 
          dst += dstStride;
       }