[Mesa-dev] [PATCH 03/11] i965: Add missing BRW_NEW_BATCH dirty bit to Gen6+ SF/SBE state atoms.

Kenneth Graunke kenneth at whitecape.org
Sun Jan 8 14:43:52 PST 2012


Without MI_SET_CONTEXT, there's no guarantee that another program hasn't
reprogram the GPU's SF state since our last batch.  We need to submit
it every time.

Found by inspection.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/gen6_sf_state.c |    1 +
 src/mesa/drivers/dri/i965/gen7_sf_state.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index 4c4ff30..d8b4052 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -345,6 +345,7 @@ const struct brw_tracked_state gen6_sf_state = {
 		_NEW_POINT |
 		_NEW_TRANSFORM),
       .brw   = (BRW_NEW_CONTEXT |
+		BRW_NEW_BATCH |
 		BRW_NEW_FRAGMENT_PROGRAM |
 		BRW_NEW_HIZ),
       .cache = CACHE_NEW_VS_PROG
diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c
index 8876722..11b2480 100644
--- a/src/mesa/drivers/dri/i965/gen7_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c
@@ -135,6 +135,7 @@ const struct brw_tracked_state gen7_sbe_state = {
 		_NEW_POINT |
 		_NEW_TRANSFORM),
       .brw   = (BRW_NEW_CONTEXT |
+		BRW_NEW_BATCH |
 		BRW_NEW_FRAGMENT_PROGRAM),
       .cache = CACHE_NEW_VS_PROG
    },
@@ -285,7 +286,7 @@ const struct brw_tracked_state gen7_sf_state = {
 		_NEW_SCISSOR |
 		_NEW_BUFFERS |
 		_NEW_POINT),
-      .brw   = (BRW_NEW_CONTEXT),
+      .brw   = BRW_NEW_CONTEXT | BRW_NEW_BATCH,
       .cache = CACHE_NEW_VS_PROG
    },
    .emit = upload_sf_state,
-- 
1.7.7.5



More information about the mesa-dev mailing list