[Mesa-dev] [PATCH 15/29] i965: Move state setup from brwCreateContext to brw_init_state().
Kenneth Graunke
kenneth at whitecape.org
Fri Sep 27 16:45:54 PDT 2013
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 at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_context.c | 8 --------
src/mesa/drivers/dri/i965/brw_state_upload.c | 8 ++++++++
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index cca7145..b846c3f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -463,14 +463,6 @@ brwCreateContext(int 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;
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 60c8b5e..0aca7dd 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -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));
}
--
1.8.3.4
More information about the mesa-dev
mailing list