aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/clear.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-30 07:22:44 +0000
committermarha <marha@users.sourceforge.net>2011-03-30 07:22:44 +0000
commit4e1588b6805ee5c7cd34e733cd1eff098d063b95 (patch)
tree763d6761b0131ecd36be7b0d48d2e644b8a25c95 /mesalib/src/mesa/main/clear.c
parenta69f20daead874a20fad57a4fadd99df393f28d6 (diff)
parentaee5cfef9a419ee2845d66b0c31e476880bea663 (diff)
downloadvcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.gz
vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.bz2
vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/clear.c')
-rw-r--r--mesalib/src/mesa/main/clear.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c
index ca831476b..449a8d6ec 100644
--- a/mesalib/src/mesa/main/clear.c
+++ b/mesalib/src/mesa/main/clear.c
@@ -78,19 +78,27 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- tmp[0] = CLAMP(red, 0.0F, 1.0F);
- tmp[1] = CLAMP(green, 0.0F, 1.0F);
- tmp[2] = CLAMP(blue, 0.0F, 1.0F);
- tmp[3] = CLAMP(alpha, 0.0F, 1.0F);
+ tmp[0] = red;
+ tmp[1] = green;
+ tmp[2] = blue;
+ tmp[3] = alpha;
- if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
+ if (TEST_EQ_4V(tmp, ctx->Color.ClearColorUnclamped))
return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
- COPY_4V(ctx->Color.ClearColor, tmp);
+ COPY_4V(ctx->Color.ClearColorUnclamped, tmp);
+
+ ctx->Color.ClearColor[0] = CLAMP(tmp[0], 0.0F, 1.0F);
+ ctx->Color.ClearColor[1] = CLAMP(tmp[1], 0.0F, 1.0F);
+ ctx->Color.ClearColor[2] = CLAMP(tmp[2], 0.0F, 1.0F);
+ ctx->Color.ClearColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
if (ctx->Driver.ClearColor) {
/* it's OK to call glClearColor in CI mode but it should be a NOP */
+ /* we pass the clamped color, since all drivers that need this don't
+ * support GL_ARB_color_buffer_float
+ */
(*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor);
}
}