swrast: remove gl_renderbuffer::DataType check in DrawPixels()
authorBrian Paul <brianp@vmware.com>
Mon, 16 Jan 2012 17:54:36 +0000 (10:54 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 24 Jan 2012 21:12:09 +0000 (14:12 -0700)
The field will be going away so update this code.

src/mesa/swrast/s_drawpix.c

index 4231bb4..5828a78 100644 (file)
@@ -429,11 +429,14 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
    span.arrayMask = SPAN_RGBA;
    span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
 
-   if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 &&
-       ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT &&
-       ctx->Color.ClampFragmentColor != GL_FALSE) {
-      /* need to clamp colors before applying fragment ops */
-      transferOps |= IMAGE_CLAMP_BIT;
+   if (ctx->DrawBuffer->_NumColorDrawBuffers > 0) {
+      GLenum datatype = _mesa_get_format_datatype(
+                 ctx->DrawBuffer->_ColorDrawBuffers[0]->Format);
+      if (datatype != GL_FLOAT &&
+          ctx->Color.ClampFragmentColor != GL_FALSE) {
+         /* need to clamp colors before applying fragment ops */
+         transferOps |= IMAGE_CLAMP_BIT;
+      }
    }
 
    /*