i965: Fold the gen7_cc_viewport_state_pointer atom into brw_cc_vp.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Sep 2014 10:05:10 +0000 (03:05 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Nov 2014 10:18:40 +0000 (02:18 -0800)
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 <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_cc.c
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/gen7_viewport_state.c

index da7299566e7dccd99b6a43ba9086904da00260e3..86ab503e2e2ef165c1dfae987706d90331819871 100644 (file)
@@ -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 = {
index 209fab10c85a992ef6a7a4fd558613b8da25dedf..399347c15fe6cf910767d8e63dc147a79bf9c8d8 100644 (file)
@@ -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;
index 1235d4993e14338265f690d3d7d9c4aca38907ad..6cc2770294dd8f8bc9b4553531e97e0c3238ac3a 100644 (file)
@@ -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,
index 193ead7853e1064bad7431d4182d105ca055bd3c..01af0440098abc2921c52ea45314078b9c3a9ae0 100644 (file)
@@ -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,
-};