summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 10:54:36 -0700
committerIan Romanick <[email protected]>2012-01-27 17:43:21 -0800
commit573e1478eb789230efcad952b5fdbe902375d867 (patch)
treeeb6f8539212a050e47a76455208dc6a3268995cc /src/mesa/swrast
parent490057ae81e87823cb85cbd663087b7b4d1b12c9 (diff)
swrast: remove gl_renderbuffer::DataType check in DrawPixels()
The field will be going away so update this code. (cherry picked from commit ecb8594c184f5daa2f5a735e42ee24e7d110aa9f)
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_drawpix.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 4231bb4bdf0..5828a789ab9 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -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;
+ }
}
/*