Mesa (master): r300g: fix emission of some non-CSO atoms at the beginning of CS

Marek Olšák mareko at kemper.freedesktop.org
Sat May 15 19:55:29 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat May 15 21:22:23 2010 +0200

r300g: fix emission of some non-CSO atoms at the beginning of CS

---

 src/gallium/drivers/r300/r300_context.c |    7 +++++++
 src/gallium/drivers/r300/r300_context.h |    2 ++
 src/gallium/drivers/r300/r300_flush.c   |    2 +-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 0444fda..775173b 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -151,6 +151,13 @@ static void r300_setup_atoms(struct r300_context* r300)
     r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state);
     r300->fs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
     r300->vs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
+
+    /* Some non-CSO atoms don't use the state pointer. */
+    r300->invariant_state.allow_null_state = TRUE;
+    r300->fs_rc_constant_state.allow_null_state = TRUE;
+    r300->pvs_flush.allow_null_state = TRUE;
+    r300->query_start.allow_null_state = TRUE;
+    r300->texture_cache_inval.allow_null_state = TRUE;
 }
 
 struct pipe_context* r300_create_context(struct pipe_screen* screen,
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 4a59c6a..d2c8f56 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -55,6 +55,8 @@ struct r300_atom {
     unsigned size;
     /* Whether this atom should be emitted. */
     boolean dirty;
+    /* Whether this atom may be emitted with state == NULL. */
+    boolean allow_null_state;
 };
 
 struct r300_blend_state {
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index ad7cae7..3d22027 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -56,7 +56,7 @@ static void r300_flush(struct pipe_context* pipe,
 
         /* New kitchen sink, baby. */
         foreach(atom, &r300->atom_list) {
-            if (atom->state) {
+            if (atom->state || atom->allow_null_state) {
                 atom->dirty = TRUE;
             }
         }




More information about the mesa-commit mailing list