diff options
author | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
commit | 4e1588b6805ee5c7cd34e733cd1eff098d063b95 (patch) | |
tree | 763d6761b0131ecd36be7b0d48d2e644b8a25c95 /mesalib/src/mesa/main/clear.c | |
parent | a69f20daead874a20fad57a4fadd99df393f28d6 (diff) | |
parent | aee5cfef9a419ee2845d66b0c31e476880bea663 (diff) | |
download | vcxsrv-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.c | 20 |
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);
}
}
|