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

Author: Pauli Nieminen <suok...@gmail.com>
Date:   Fri Feb  5 15:21:55 2010 +0200

r200: Optimize polygon stipple emit.

Only emit polygon stipple when the state is enabled.

---

 src/mesa/drivers/dri/r200/r200_state_init.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c 
b/src/mesa/drivers/dri/r200/r200_state_init.c
index 4e8075e..51e8ac5 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -347,6 +347,15 @@ static int check_rrb(GLcontext *ctx, struct 
radeon_state_atom *atom)
    return atom->cmd_size;
 }
 
+static int check_polygon_stipple(GLcontext *ctx,
+               struct radeon_state_atom *atom)
+{
+   r200ContextPtr r200 = R200_CONTEXT(ctx);
+   if (r200->hw.set.cmd[SET_RE_CNTL] & R200_STIPPLE_ENABLE)
+          return atom->cmd_size;
+   return 0;
+}
+
 static void mtl_emit(GLcontext *ctx, struct radeon_state_atom *atom)
 {
    r200ContextPtr r200 = R200_CONTEXT(ctx);
@@ -885,7 +894,7 @@ void r200InitState( r200ContextPtr rmesa )
       }
    }
 
-   ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 );
+   ALLOC_STATE( stp, polygon_stipple, STP_STATE_SIZE, "STP/stp", 0 );
 
    for (i = 0; i < 6; i++)
       if (rmesa->radeon.radeonScreen->kernel_mm)

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to