i965: Remove the memcpy()ed atoms array now that everything is emit()-based.
authorEric Anholt <eric@anholt.net>
Sat, 22 Oct 2011 19:16:05 +0000 (12:16 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 29 Oct 2011 19:17:23 +0000 (12:17 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_state_upload.c

index 86bf94cbea5eb6437ea166f56f00e1f96f262038..ff0fafaa85db5484e38dc83dfce4c9f3fabef6e6 100644 (file)
@@ -876,8 +876,8 @@ struct brw_context
     */
    GLuint program_id;
 
-   int num_prepare_atoms, num_emit_atoms;
-   struct brw_tracked_state prepare_atoms[64], emit_atoms[64];
+   int num_atoms;
+   const struct brw_tracked_state **atoms;
 
    /* If (INTEL_DEBUG & DEBUG_BATCH) */
    struct {
index 66f27e256e6abb0f10c664731c6f3a4f0d5321ca..79d9188f32f2423d7719bb0365edf0898e9eeb8c 100644 (file)
@@ -254,17 +254,16 @@ void brw_init_state( struct brw_context *brw )
       num_atoms = ARRAY_SIZE(gen4_atoms);
    }
 
+   brw->atoms = atoms;
+   brw->num_atoms = num_atoms;
+
    while (num_atoms--) {
       assert((*atoms)->dirty.mesa |
             (*atoms)->dirty.brw |
             (*atoms)->dirty.cache);
-
-      assert(!(*atoms)->prepare);
       assert((*atoms)->emit);
-      brw->emit_atoms[brw->num_emit_atoms++] = **atoms;
       atoms++;
    }
-   assert(brw->num_emit_atoms <= ARRAY_SIZE(brw->emit_atoms));
 }
 
 
@@ -426,8 +425,6 @@ void brw_upload_state(struct brw_context *brw)
    struct gl_context *ctx = &brw->intel.ctx;
    struct intel_context *intel = &brw->intel;
    struct brw_state_flags *state = &brw->state.dirty;
-   const struct brw_tracked_state *atoms = brw->emit_atoms;
-   int num_atoms = brw->num_emit_atoms;
    int i;
    static int dirty_count = 0;
 
@@ -466,8 +463,8 @@ void brw_upload_state(struct brw_context *brw)
       memset(&examined, 0, sizeof(examined));
       prev = *state;
 
-      for (i = 0; i < num_atoms; i++) {
-        const struct brw_tracked_state *atom = &atoms[i];
+      for (i = 0; i < brw->num_atoms; i++) {
+        const struct brw_tracked_state *atom = brw->atoms[i];
         struct brw_state_flags generated;
 
         if (brw->intel.Fallback)
@@ -489,8 +486,8 @@ void brw_upload_state(struct brw_context *brw)
       }
    }
    else {
-      for (i = 0; i < num_atoms; i++) {
-        const struct brw_tracked_state *atom = &atoms[i];
+      for (i = 0; i < brw->num_atoms; i++) {
+        const struct brw_tracked_state *atom = brw->atoms[i];
 
         if (brw->intel.Fallback)
            break;