diff mbox

[3/3] i965: new state cache for SF scissor on gen6

Message ID 1297836461-31543-5-git-send-email-zhenyuw@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhenyu Wang Feb. 16, 2011, 6:07 a.m. UTC
None
diff mbox

Patch

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index ea74530..33d72d2 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -313,7 +313,8 @@  enum brw_cache_id {
    BRW_WM_UNIT,
    BRW_SF_PROG,
    BRW_SF_VP,
-   BRW_SF_UNIT, /* scissor state on gen6 */
+   BRW_SF_UNIT,
+   BRW_SF_SCISSOR_UNIT,
    BRW_VS_UNIT,
    BRW_VS_PROG,
    BRW_GS_UNIT,
@@ -387,6 +388,7 @@  struct brw_tracked_state {
 #define CACHE_NEW_SF_PROG                (1<<BRW_SF_PROG)
 #define CACHE_NEW_SF_VP                  (1<<BRW_SF_VP)
 #define CACHE_NEW_SF_UNIT                (1<<BRW_SF_UNIT)
+#define CACHE_NEW_SF_SCISSOR_UNIT        (1<<BRW_SF_SCISSOR_UNIT)
 #define CACHE_NEW_VS_UNIT                (1<<BRW_VS_UNIT)
 #define CACHE_NEW_VS_PROG                (1<<BRW_VS_PROG)
 #define CACHE_NEW_GS_UNIT                (1<<BRW_GS_UNIT)
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index 01eeb19..585b4c7 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -375,6 +375,8 @@  brw_init_non_surface_cache(struct brw_context *brw)
 
    brw_init_cache_id(cache, "SF_UNIT", BRW_SF_UNIT);
 
+   brw_init_cache_id(cache, "SF_SCISSOR_UNIT", BRW_SF_SCISSOR_UNIT);
+
    brw_init_cache_id(cache, "VS_UNIT", BRW_VS_UNIT);
 
    brw_init_cache_id(cache, "VS_PROG", BRW_VS_PROG);
diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
index 12b6582..baee3ea 100644
--- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c
@@ -74,7 +74,7 @@  prepare_scissor_state(struct brw_context *brw)
    }
 
    drm_intel_bo_unreference(brw->sf.state_bo);
-   brw->sf.state_bo = brw_cache_data(&brw->cache, BRW_SF_UNIT,
+   brw->sf.state_bo = brw_cache_data(&brw->cache, BRW_SF_SCISSOR_UNIT,
 				     &scissor, sizeof(scissor));
 }