Mesa (master): intel: If we're doing a depth clear with tris, do color with it.

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 30 22:07:14 UTC 2009


Module: Mesa
Branch: master
Commit: 67ee22c89f42146e7befb2fdd39bdd68a5258c30
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=67ee22c89f42146e7befb2fdd39bdd68a5258c30

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jan 30 11:24:04 2009 -0800

intel: If we're doing a depth clear with tris, do color with it.

This is a 10% win on the ever-important glxgears not-a-benchmark.

---

 src/mesa/drivers/dri/intel/intel_clear.c |    8 ++++++++
 src/mesa/drivers/dri/intel/intel_pixel.c |    6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c
index 921ec2d..98f7292 100644
--- a/src/mesa/drivers/dri/intel/intel_clear.c
+++ b/src/mesa/drivers/dri/intel/intel_clear.c
@@ -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;
 
diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c
index 5e32288..f440a77 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel.c
@@ -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);*/
 }
 
 /**




More information about the mesa-commit mailing list