summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-04-04 16:04:59 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-04-04 16:04:59 +0200
commitba14b043bc1ab87e8e5e46e6e909a8def9535028 (patch)
tree38d4c58fcee1af9f9c4857ff708826623c66c9e8 /src/mesa/state_tracker
parentb0ce91518646b62169594da661dd92ac899cbd6f (diff)
gallium: Add utility helper for packing combined depth/stencil values.
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);
}
}