aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_clear.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-17 08:04:15 +0200
committermarha <marha@users.sourceforge.net>2012-10-17 08:04:15 +0200
commitded57b5a4131a213d57f5a20d50b819b7a8924df (patch)
tree5be4cc93cf5d77df72f8ae6e34953e026bde071f /mesalib/src/mesa/state_tracker/st_cb_clear.c
parent54db46582aba2252d544fa3956522f9ef06b49cb (diff)
downloadvcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.tar.gz
vcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.tar.bz2
vcxsrv-ded57b5a4131a213d57f5a20d50b819b7a8924df.zip
pixman mesa git update 17 oct 2012
pixman: 6e56098c0338ce74228187e4c96fed1a66cb0956 mesa: 0199ff7fe323cf527ffacfdef3258ab85799dd13
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_clear.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_clear.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c
index e731b6b5e..90eb0af4f 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_clear.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c
@@ -37,6 +37,7 @@
#include "main/accum.h"
#include "main/formats.h"
#include "main/macros.h"
+#include "main/glformats.h"
#include "program/prog_instruction.h"
#include "st_context.h"
#include "st_atom.h"
@@ -301,9 +302,13 @@ clear_with_quad(struct gl_context *ctx,
cso_set_geometry_shader_handle(st->cso_context, NULL);
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
- st_translate_color(ctx->Color.ClearColor.f,
- ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor.f);
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
+ GLboolean is_integer = _mesa_is_enum_format_integer(rb->InternalFormat);
+
+ st_translate_color(&ctx->Color.ClearColor,
+ &clearColor,
+ ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+ is_integer);
}
/* draw quad matching scissor rect */
@@ -540,9 +545,13 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
- st_translate_color(ctx->Color.ClearColor.f,
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
+ GLboolean is_integer = _mesa_is_enum_format_integer(rb->InternalFormat);
+
+ st_translate_color(&ctx->Color.ClearColor,
+ &clearColor,
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor.f);
+ is_integer);
}
st->pipe->clear(st->pipe, clear_buffers, &clearColor,