Mesa (master): r300g: Make invariant state into an atom.

Corbin Simpson csimpson at kemper.freedesktop.org
Wed Jan 20 02:16:10 UTC 2010


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

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Tue Jan 19 17:56:12 2010 -0800

r300g: Make invariant state into an atom.

---

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

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 94a9ab3..67ddec1 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -129,6 +129,7 @@ static void r300_setup_atoms(struct r300_context* r300)
      * an upper bound on each atom, to keep the emission machinery from
      * underallocating space. */
     make_empty_list(&r300->atom_list);
+    R300_INIT_ATOM(invariant, 73);
     R300_INIT_ATOM(ztop, 2);
     R300_INIT_ATOM(blend, 8);
     R300_INIT_ATOM(blend_color, 3);
@@ -208,7 +209,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     r300_init_state_functions(r300);
 
-    r300_emit_invariant_state(r300);
+    r300->invariant_state.dirty = TRUE;
 
     r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300);
     r300->dirty_state = R300_NEW_KITCHEN_SINK;
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 5e33dc0..ec8940f 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -313,6 +313,9 @@ struct r300_context {
     /* ZTOP state. */
     struct r300_atom ztop_state;
 
+    /* Invariant state. This must be emitted to get the engine started. */
+    struct r300_atom invariant_state;
+
     /* Vertex buffers for Gallium. */
     struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
     int vertex_buffer_count;
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 59819cb..15e612d 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -53,7 +53,6 @@ static void r300_flush(struct pipe_context* pipe,
 
     if (r300->dirty_hw) {
         FLUSH_CS;
-        r300_emit_invariant_state(r300);
         r300->dirty_state = R300_NEW_KITCHEN_SINK;
         r300->dirty_hw = 0;
 
diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c
index 47d7e60..f31b2e3 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.c
+++ b/src/gallium/drivers/r300/r300_state_invariant.c
@@ -38,7 +38,7 @@ struct pipe_viewport_state r300_viewport_identity = {
  *
  * Note that eventually this should be empty, but it's useful for development
  * and general unduplication of code. */
-void r300_emit_invariant_state(struct r300_context* r300)
+void r300_emit_invariant_state(struct r300_context* r300, void* state)
 {
     struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
     CS_LOCALS(r300);
diff --git a/src/gallium/drivers/r300/r300_state_invariant.h b/src/gallium/drivers/r300/r300_state_invariant.h
index 05cff0d..5d1a963 100644
--- a/src/gallium/drivers/r300/r300_state_invariant.h
+++ b/src/gallium/drivers/r300/r300_state_invariant.h
@@ -25,6 +25,6 @@
 
 struct r300_context;
 
-void r300_emit_invariant_state(struct r300_context* r300);
+void r300_emit_invariant_state(struct r300_context* r300, void* state);
 
 #endif /* R300_STATE_INVARIANT_H */




More information about the mesa-commit mailing list