-static void
-clear_color_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
-{
- if (check_clear_color_with_quad( ctx, rb )) {
- /* masking or scissoring */
- clear_with_quad(ctx, GL_TRUE, GL_FALSE, GL_FALSE);
- }
- else {
- /* clear whole buffer w/out masking */
- struct st_renderbuffer *strb = st_renderbuffer(rb);
- uint clearValue;
- /* NOTE: we always pass the clear color as PIPE_FORMAT_A8R8G8B8_UNORM
- * at this time!
- */
- util_pack_color(ctx->Color.ClearColor, PIPE_FORMAT_A8R8G8B8_UNORM, &clearValue);
- ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue);
- }
-}
-
-
-static void
-clear_depth_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
-{
- if (check_clear_depth_with_quad(ctx, rb)) {
- /* scissoring or we have a combined depth/stencil buffer */
- clear_with_quad(ctx, GL_FALSE, GL_TRUE, GL_FALSE);
- }
- else {
- struct st_renderbuffer *strb = st_renderbuffer(rb);
-
- /* simple clear of whole buffer */
- uint clearValue = util_pack_z(strb->surface->format, ctx->Depth.Clear);
- ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue);
- }
-}
-
-
-static void
-clear_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
-{
- if (check_clear_stencil_with_quad(ctx, rb)) {
- /* masking or scissoring or combined depth/stencil buffer */
- clear_with_quad(ctx, GL_FALSE, GL_FALSE, GL_TRUE);
- }
- else {
- struct st_renderbuffer *strb = st_renderbuffer(rb);
-
- /* simple clear of whole buffer */
- GLuint clearValue = ctx->Stencil.Clear;
-
- switch (strb->surface->format) {
- case PIPE_FORMAT_S8Z24_UNORM:
- clearValue <<= 24;
- break;
- default:
- ; /* no-op, stencil value is in least significant bits */
- }
-
- ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue);
- }
-}
-
-
-static void
-clear_depth_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)