summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 020684b4e1..bec32db050 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -460,19 +460,9 @@ clear_depth_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
}
else {
/* clear whole buffer w/out masking */
- GLuint clearValue = util_pack_z(strb->surface->format, ctx->Depth.Clear);
-
- switch (strb->surface->format) {
- case PIPE_FORMAT_S8Z24_UNORM:
- clearValue |= ctx->Stencil.Clear << 24;
- break;
- case PIPE_FORMAT_Z24S8_UNORM:
- clearValue |= ctx->Stencil.Clear;
- break;
- default:
- assert(0);
- }
-
+ GLuint clearValue = util_pack_z_stencil(strb->surface->format,
+ ctx->Depth.Clear,
+ ctx->Stencil.Clear);
ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue);
}
}