r300g: Make invariant state into an atom.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 20 Jan 2010 01:56:12 +0000 (17:56 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 20 Jan 2010 02:15:17 +0000 (18:15 -0800)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_state_invariant.c
src/gallium/drivers/r300/r300_state_invariant.h

index 94a9ab3ef3f36f0f1829217f653583f8357b12de..67ddec140a8371cb534a5ff720f3e1949c4cba91 100644 (file)
@@ -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;
index 5e33dc042ac6121387f46644d3f4f4e1085ee0fb..ec8940f420d44e0cc588181127c5d6babf8ce965 100644 (file)
@@ -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;
index 59819cb1061a6cea9e5f7be11bc0658d8609c27b..15e612d8a6bd34ff97492cde002b7f12dd86056d 100644 (file)
@@ -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;
 
index 47d7e60a40d98c310be3465174d68c01b4f80836..f31b2e30df675bb9c904f07812d699e03d9ee1c0 100644 (file)
@@ -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);
index 05cff0d6dfeb4254d10cc34acaf47b02c90c086e..5d1a96365451439df0f56b0b83a2f180a3d83f11 100644 (file)
@@ -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 */