i965: Move state setup from brwCreateContext to brw_init_state().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 26 Sep 2013 19:06:32 +0000 (12:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 13 Oct 2013 07:10:44 +0000 (00:10 -0700)
This seems like a better place for it, and helps clean up
brwCreateContext (which is full of a lot of random stuff).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_state_upload.c

index 3ddc1814e3bcf7917eabbae810dc89f547c7ed60..d6d40ad8b19c1af79fece628a979869420352f2e 100644 (file)
@@ -467,14 +467,6 @@ brwCreateContext(gl_api api,
       brw->curbe.next_buf = calloc(1, 4096);
    }
 
-   brw->state.dirty.mesa = ~0;
-   brw->state.dirty.brw = ~0;
-
-   /* Make sure that brw->state.dirty.brw has enough bits to hold all possible
-    * dirty flags.
-    */
-   STATIC_ASSERT(BRW_NUM_STATE_BITS <= 8 * sizeof(brw->state.dirty.brw));
-
    brw->batch.need_workaround_flush = true;
 
    ctx->VertexProgram._MaintainTnlProgram = true;
index 60c8b5e2b87fe2f98fe1e19179d452d67ecf6069..0aca7ddbbba5e3c5bf3d674f88cdbc4e07e32bc7 100644 (file)
@@ -291,6 +291,14 @@ void brw_init_state( struct brw_context *brw )
    }
 
    brw_upload_initial_gpu_state(brw);
+
+   brw->state.dirty.mesa = ~0;
+   brw->state.dirty.brw = ~0;
+
+   /* Make sure that brw->state.dirty.brw has enough bits to hold all possible
+    * dirty flags.
+    */
+   STATIC_ASSERT(BRW_NUM_STATE_BITS <= 8 * sizeof(brw->state.dirty.brw));
 }