aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_clear.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_clear.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_clear.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c
index a4799e3cc..83802a5ea 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_clear.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c
@@ -136,7 +136,7 @@ set_vertex_shader(struct st_context *st)
static void
draw_quad(struct st_context *st,
float x0, float y0, float x1, float y1, GLfloat z,
- const GLfloat color[4])
+ const union pipe_color_union *color)
{
struct pipe_context *pipe = st->pipe;
@@ -182,10 +182,10 @@ draw_quad(struct st_context *st,
for (i = 0; i < 4; i++) {
st->clear.vertices[i][0][2] = z;
st->clear.vertices[i][0][3] = 1.0;
- st->clear.vertices[i][1][0] = color[0];
- st->clear.vertices[i][1][1] = color[1];
- st->clear.vertices[i][1][2] = color[2];
- st->clear.vertices[i][1][3] = color[3];
+ st->clear.vertices[i][1][0] = color->f[0];
+ st->clear.vertices[i][1][1] = color->f[1];
+ st->clear.vertices[i][1][2] = color->f[2];
+ st->clear.vertices[i][1][3] = color->f[3];
}
/* put vertex data into vbuf */
@@ -227,7 +227,7 @@ clear_with_quad(struct gl_context *ctx,
const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f;
const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f;
const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 1.0f;
- float clearColor[4];
+ union pipe_color_union clearColor;
/*
printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__,
@@ -325,11 +325,11 @@ clear_with_quad(struct gl_context *ctx,
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
st_translate_color(ctx->Color.ClearColor.f,
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor);
+ clearColor.f);
}
/* draw quad matching scissor rect */
- draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
+ draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, &clearColor);
/* Restore pipe state */
cso_restore_blend(st->cso_context);
@@ -572,7 +572,7 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
* required from the visual. Hence fix this up to avoid potential
* read-modify-write in the driver.
*/
- float clearColor[4];
+ union pipe_color_union clearColor;
if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != PIPE_CLEAR_DEPTHSTENCIL) &&
@@ -584,10 +584,10 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
st_translate_color(ctx->Color.ClearColor.f,
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
- clearColor);
+ clearColor.f);
}
- st->pipe->clear(st->pipe, clear_buffers, clearColor,
+ st->pipe->clear(st->pipe, clear_buffers, &clearColor,
ctx->Depth.Clear, ctx->Stencil.Clear);
}
if (mask & BUFFER_BIT_ACCUM)