Our understanding is that the 3D engine is supposed to be faster
anyway. We used to have more overhead in our tri clear path than we
do today, which would have led to this choice. But given that we
almost always see a depth clear along with a color clear, the path was
hardly exercised anyway.
Also, the color mask logic was broken in the presence of
GL_EXT_draw_buffers2's per-buffer colormask.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
intelClear(struct gl_context *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context(ctx);
intelClear(struct gl_context *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context(ctx);
- const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask[0]);
- GLbitfield blit_mask = 0;
GLbitfield swrast_mask = 0;
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct intel_renderbuffer *irb;
GLbitfield swrast_mask = 0;
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct intel_renderbuffer *irb;
_swrast_Clear(ctx, swrast_mask);
}
_swrast_Clear(ctx, swrast_mask);
}
- /* HW color buffers (front, back, aux, generic FBO, etc) */
- if (intel->gen < 6 && colorMask == ~0) {
- /* clear all R,G,B,A */
- blit_mask |= (mask & BUFFER_BITS_COLOR);
- }
- else {
- /* glColorMask in effect */
- tri_mask |= (mask & BUFFER_BITS_COLOR);
- }
+ 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. */
/* Make sure we have up to date buffers before we start looking at
* the tiling bits to determine how to clear. */
tri_mask |= BUFFER_BIT_DEPTH;
}
tri_mask |= BUFFER_BIT_DEPTH;
}
- /* If we're doing a tri pass for depth/stencil, include a likely color
- * buffer with it.
- */
- if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) {
- int color_bit = ffs(mask & BUFFER_BITS_COLOR);
- if (color_bit != 0) {
- tri_mask |= blit_mask & (1 << (color_bit - 1));
- blit_mask &= ~(1 << (color_bit - 1));
- }
- }
-
/* Anything left, just use tris */
/* Anything left, just use tris */
- tri_mask |= mask & ~blit_mask;
-
- if (blit_mask) {
- debug_mask("blit", blit_mask);
- tri_mask |= intelClearWithBlit(ctx, blit_mask);
- }
if (tri_mask) {
debug_mask("tri", tri_mask);
if (tri_mask) {
debug_mask("tri", tri_mask);