intel: If we're doing a depth clear with tris, do color with it.
authorEric Anholt <eric@anholt.net>
Fri, 30 Jan 2009 19:24:04 +0000 (11:24 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 30 Jan 2009 21:46:37 +0000 (13:46 -0800)
This is a 10% win on the ever-important glxgears not-a-benchmark.

src/mesa/drivers/dri/intel/intel_clear.c
src/mesa/drivers/dri/intel/intel_pixel.c

index 921ec2dc33089a80697e2d9dfd3e4bccd989e80d..98f7292f597175fa0d28e973f76c4a2601b3f9e7 100644 (file)
@@ -201,6 +201,14 @@ intelClear(GLcontext *ctx, GLbitfield mask)
          blit_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)) {
+      tri_mask |= blit_mask & BUFFER_BIT_BACK_LEFT;
+      blit_mask &= ~BUFFER_BIT_BACK_LEFT;
+   }
+
    /* SW fallback clearing */
    swrast_mask = mask & ~tri_mask & ~blit_mask;
 
index 5e32288844c48b0eb664866d5391f45d260aaf42..f440a7716cfbb9e0d8857ffdd7851f6680079bc7 100644 (file)
@@ -183,7 +183,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel)
    intel->meta.saved_vp_height = ctx->Viewport.Height;
    intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode;
 
-   _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);
+   /*   _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);*/
 
    _mesa_MatrixMode(GL_PROJECTION);
    _mesa_PushMatrix();
@@ -205,8 +205,8 @@ intel_meta_restore_transform(struct intel_context *intel)
 
    _mesa_MatrixMode(intel->meta.saved_matrix_mode);
 
-   _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y,
-                 intel->meta.saved_vp_width, intel->meta.saved_vp_height);
+   /*   _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y,
+       intel->meta.saved_vp_width, intel->meta.saved_vp_height);*/
 }
 
 /**