summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-09-26 03:05:10 -0700
committerKenneth Graunke <[email protected]>2014-11-29 02:18:40 -0800
commit4d67b6ab9aa11428eb998377805c0f94cac099ea (patch)
tree700339df72aa1a88a29dfb512bca7fcf6b97723f /src/mesa
parentf421db70ba5b987891458b98ae3b0d0ddc586315 (diff)
i965: Fold the gen7_cc_viewport_state_pointer atom into brw_cc_vp.
These always happen together; the extra atom just means another item to iterate through, flags to check, and a call through a function pointer. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_cc.c9
-rw-r--r--src/mesa/drivers/dri/i965/brw_state.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen7_viewport_state.c19
4 files changed, 8 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c
index da7299566e7..86ab503e2e2 100644
--- a/src/mesa/drivers/dri/i965/brw_cc.c
+++ b/src/mesa/drivers/dri/i965/brw_cc.c
@@ -62,7 +62,14 @@ brw_upload_cc_vp(struct brw_context *brw)
}
}
- brw->state.dirty.cache |= CACHE_NEW_CC_VP;
+ if (brw->gen >= 7) {
+ BEGIN_BATCH(2);
+ OUT_BATCH(_3DSTATE_VIEWPORT_STATE_POINTERS_CC << 16 | (2 - 2));
+ OUT_BATCH(brw->cc.vp_offset);
+ ADVANCE_BATCH();
+ } else {
+ brw->state.dirty.cache |= CACHE_NEW_CC_VP;
+ }
}
const struct brw_tracked_state brw_cc_vp = {
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index 209fab10c85..399347c15fe 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -117,7 +117,6 @@ extern const struct brw_tracked_state gen6_vs_state;
extern const struct brw_tracked_state gen6_wm_push_constants;
extern const struct brw_tracked_state gen6_wm_state;
extern const struct brw_tracked_state gen7_depthbuffer;
-extern const struct brw_tracked_state gen7_cc_viewport_state_pointer;
extern const struct brw_tracked_state gen7_clip_state;
extern const struct brw_tracked_state gen7_disable_stages;
extern const struct brw_tracked_state gen7_gs_push_constants;
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 1235d4993e1..6cc2770294d 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -190,7 +190,6 @@ static const struct brw_tracked_state *gen7_atoms[] =
&brw_state_base_address,
&brw_cc_vp,
- &gen7_cc_viewport_state_pointer, /* must do after brw_cc_vp */
&gen7_sf_clip_viewport,
&gen7_push_constant_space,
@@ -265,7 +264,6 @@ static const struct brw_tracked_state *gen8_atoms[] =
&gen8_state_base_address,
&brw_cc_vp,
- &gen7_cc_viewport_state_pointer, /* must do after brw_cc_vp */
&gen8_sf_clip_viewport,
&gen7_push_constant_space,
diff --git a/src/mesa/drivers/dri/i965/gen7_viewport_state.c b/src/mesa/drivers/dri/i965/gen7_viewport_state.c
index 193ead7853e..01af0440098 100644
--- a/src/mesa/drivers/dri/i965/gen7_viewport_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_viewport_state.c
@@ -99,22 +99,3 @@ const struct brw_tracked_state gen7_sf_clip_viewport = {
},
.emit = gen7_upload_sf_clip_viewport,
};
-
-/* ----------------------------------------------------- */
-
-static void upload_cc_viewport_state_pointer(struct brw_context *brw)
-{
- BEGIN_BATCH(2);
- OUT_BATCH(_3DSTATE_VIEWPORT_STATE_POINTERS_CC << 16 | (2 - 2));
- OUT_BATCH(brw->cc.vp_offset);
- ADVANCE_BATCH();
-}
-
-const struct brw_tracked_state gen7_cc_viewport_state_pointer = {
- .dirty = {
- .mesa = 0,
- .brw = BRW_NEW_BATCH,
- .cache = CACHE_NEW_CC_VP
- },
- .emit = upload_cc_viewport_state_pointer,
-};