- if (0)
- fprintf(stderr, "%s\n", __FUNCTION__);
-
- /* Get SW clears out of the way: Anything without an intel_renderbuffer */
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (!(mask & (1 << i)))
- continue;
-
- irb = intel_get_renderbuffer(fb, i);
- if (unlikely(!irb)) {
- swrast_mask |= (1 << i);
- mask &= ~(1 << i);
- }
- }
- if (unlikely(swrast_mask)) {
- debug_mask("swrast", swrast_mask);
- _swrast_Clear(ctx, swrast_mask);
- }
-
- tri_mask |= (mask & BUFFER_BITS_COLOR);
-
- /* Make sure we have up to date buffers before we start looking at
- * the tiling bits to determine how to clear. */
- intel_prepare_render(intel);
-
- /* HW stencil */
- if (mask & BUFFER_BIT_STENCIL) {
- const struct intel_region *stencilRegion
- = intel_get_rb_region(fb, BUFFER_STENCIL);
- if (stencilRegion) {
- tri_mask |= BUFFER_BIT_STENCIL;
- }
- }
-
- /* HW depth */
- if (mask & BUFFER_BIT_DEPTH) {
- tri_mask |= BUFFER_BIT_DEPTH;
- }
-
- /* Anything left, just use tris */
- tri_mask |= mask;