Mesa (master): r300g: do not emit ZTOP every draw call

Marek Olšák mareko at kemper.freedesktop.org
Mon Jun 21 21:58:44 PDT 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Jun 22 05:01:58 2010 +0200

r300g: do not emit ZTOP every draw call

---

 src/gallium/drivers/r300/r300_hyperz.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c
index 6358d98..e5c7658 100644
--- a/src/gallium/drivers/r300/r300_hyperz.c
+++ b/src/gallium/drivers/r300/r300_hyperz.c
@@ -70,6 +70,7 @@ static void r300_update_ztop(struct r300_context* r300)
 {
     struct r300_ztop_state* ztop_state =
         (struct r300_ztop_state*)r300->ztop_state.state;
+    uint32_t old_ztop = ztop_state->z_buffer_top;
 
     /* This is important enough that I felt it warranted a comment.
      *
@@ -111,7 +112,8 @@ static void r300_update_ztop(struct r300_context* r300)
         ztop_state->z_buffer_top = R300_ZTOP_ENABLE;
     }
 
-    r300->ztop_state.dirty = TRUE;
+    if (ztop_state->z_buffer_top != old_ztop)
+        r300->ztop_state.dirty = TRUE;
 }
 
 void r300_update_hyperz_state(struct r300_context* r300)



More information about the mesa-commit mailing list