Mesa (master): r300g: only emit scissor when needed

Corbin Simpson csimpson at kemper.freedesktop.org
Wed Jan 13 02:09:25 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Jan 12 23:55:37 2010 +0100

r300g: only emit scissor when needed

Reverting some bits from ce1c493ff8fad4b62e2b66f06636ac6560a6e0ad.

Given the latest fixes, it's not needed to always emit scissor, really.

---

 src/gallium/drivers/r300/r300_context.c |    2 --
 src/gallium/drivers/r300/r300_state.c   |    4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index be83c3e..98a5bb8 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -127,8 +127,6 @@ static void r300_setup_atoms(struct r300_context* r300)
     R300_INIT_ATOM(rs);
     R300_INIT_ATOM(scissor);
     R300_INIT_ATOM(viewport);
-
-    r300->scissor_state.always_dirty = TRUE;
 }
 
 struct pipe_context* r300_create_context(struct pipe_screen* screen,
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index a08aa34..00f1b23 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -491,6 +491,7 @@ static void
 
     r300->blend_state.dirty = TRUE;
     r300->dsa_state.dirty = TRUE;
+    r300->scissor_state.dirty = TRUE;
 }
 
 /* Create fragment shader state. */
@@ -692,6 +693,8 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
 
     r300->rs_state.state = rs;
     r300->rs_state.dirty = TRUE;
+    /* XXX Why is this still needed, dammit!? */
+    r300->scissor_state.dirty = TRUE;
     r300->viewport_state.dirty = TRUE;
 
     /* XXX Clean these up when we move to atom emits */
@@ -836,6 +839,7 @@ static void r300_set_scissor_state(struct pipe_context* pipe,
 
     memcpy(r300->scissor_state.state, state,
         sizeof(struct pipe_scissor_state));
+    r300->scissor_state.dirty = TRUE;
 }
 
 static void r300_set_viewport_state(struct pipe_context* pipe,




More information about the mesa-commit mailing list