i965: Move CACHE_NEW_*_VP flags to BRW_NEW_*_VP.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Sep 2014 17:26:09 +0000 (10:26 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Nov 2014 10:18:42 +0000 (02:18 -0800)
We've been streaming these out for ages, so they basically have nothing
to do with brw_state_cache.c.

Saves 6 * sizeof(void *) bytes per context, as we won't have useless
aux_compare/aux_free functions for them.

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_context.h
src/mesa/drivers/dri/i965/brw_sf_state.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/gen6_viewport_state.c

index 86ab503e2e2ef165c1dfae987706d90331819871..01974e1ab6d7f1b92396e1cae7af302215e11577 100644 (file)
@@ -68,7 +68,7 @@ brw_upload_cc_vp(struct brw_context *brw)
       OUT_BATCH(brw->cc.vp_offset);
       ADVANCE_BATCH();
    } else {
-      brw->state.dirty.cache |= CACHE_NEW_CC_VP;
+      brw->state.dirty.brw |= BRW_NEW_CC_VP;
    }
 }
 
@@ -227,7 +227,7 @@ static void upload_cc_unit(struct brw_context *brw)
    if (brw->stats_wm || unlikely(INTEL_DEBUG & DEBUG_STATS))
       cc->cc5.statistics_enable = 1;
 
-   /* CACHE_NEW_CC_VP */
+   /* BRW_NEW_CC_VP */
    cc->cc4.cc_viewport_state_offset = (brw->batch.bo->offset64 +
                                       brw->cc.vp_offset) >> 5; /* reloc */
 
@@ -248,8 +248,9 @@ const struct brw_tracked_state brw_cc_unit = {
               _NEW_DEPTH |
               _NEW_STENCIL,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_CC_VP |
              BRW_NEW_STATS_WM,
-      .cache = CACHE_NEW_CC_VP
+      .cache = 0
    },
    .emit = upload_cc_unit,
 };
index f7418480c36e10041b8ef7ebdf1e20c71b2bafbd..cd1daee606413f41513b3d66ac3dca8582192bd1 100644 (file)
@@ -184,6 +184,9 @@ enum brw_state_id {
    BRW_STATE_NUM_SAMPLES,
    BRW_STATE_TEXTURE_BUFFER,
    BRW_STATE_GEN4_UNIT_STATE,
+   BRW_STATE_CC_VP,
+   BRW_STATE_SF_VP,
+   BRW_STATE_CLIP_VP,
    BRW_NUM_STATE_BITS
 };
 
@@ -226,6 +229,9 @@ enum brw_state_id {
 #define BRW_NEW_NUM_SAMPLES             (1ull << BRW_STATE_NUM_SAMPLES)
 #define BRW_NEW_TEXTURE_BUFFER          (1ull << BRW_STATE_TEXTURE_BUFFER)
 #define BRW_NEW_GEN4_UNIT_STATE         (1ull << BRW_STATE_GEN4_UNIT_STATE)
+#define BRW_NEW_CC_VP                   (1ull << BRW_STATE_CC_VP)
+#define BRW_NEW_SF_VP                   (1ull << BRW_STATE_SF_VP)
+#define BRW_NEW_CLIP_VP                 (1ull << BRW_STATE_CLIP_VP)
 
 struct brw_state_flags {
    /** State update flags signalled by mesa internals */
@@ -685,16 +691,13 @@ struct brw_gs_prog_data
 #define SHADER_TIME_STRIDE 64
 
 enum brw_cache_id {
-   BRW_CC_VP,
    BRW_WM_PROG,
    BRW_BLORP_BLIT_PROG,
    BRW_SAMPLER,
    BRW_SF_PROG,
-   BRW_SF_VP,
    BRW_VS_PROG,
    BRW_FF_GS_PROG,
    BRW_GS_PROG,
-   BRW_CLIP_VP,
    BRW_CLIP_PROG,
 
    BRW_MAX_CACHE
@@ -773,16 +776,13 @@ enum shader_time_shader_type {
 
 /* Flags for brw->state.cache.
  */
-#define CACHE_NEW_CC_VP                  (1<<BRW_CC_VP)
 #define CACHE_NEW_WM_PROG                (1<<BRW_WM_PROG)
 #define CACHE_NEW_BLORP_BLIT_PROG        (1<<BRW_BLORP_BLIT_PROG)
 #define CACHE_NEW_SAMPLER                (1<<BRW_SAMPLER)
 #define CACHE_NEW_SF_PROG                (1<<BRW_SF_PROG)
-#define CACHE_NEW_SF_VP                  (1<<BRW_SF_VP)
 #define CACHE_NEW_VS_PROG                (1<<BRW_VS_PROG)
 #define CACHE_NEW_FF_GS_PROG             (1<<BRW_FF_GS_PROG)
 #define CACHE_NEW_GS_PROG                (1<<BRW_GS_PROG)
-#define CACHE_NEW_CLIP_VP                (1<<BRW_CLIP_VP)
 #define CACHE_NEW_CLIP_PROG              (1<<BRW_CLIP_PROG)
 
 struct brw_vertex_buffer {
index 0316a6b7fb16ab37ad56f79062f2d9cf84e34c11..1b79cc0022b318c304d893b56ae16fb4277039cc 100644 (file)
@@ -109,7 +109,7 @@ static void upload_sf_vp(struct brw_context *brw)
       sfv->scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1;
    }
 
-   brw->state.dirty.cache |= CACHE_NEW_SF_VP;
+   brw->state.dirty.brw |= BRW_NEW_SF_VP;
 }
 
 const struct brw_tracked_state brw_sf_vp = {
@@ -172,7 +172,7 @@ static void upload_sf_unit( struct brw_context *brw )
    if (unlikely(INTEL_DEBUG & DEBUG_STATS))
       sf->thread4.stats_enable = 1;
 
-   /* CACHE_NEW_SF_VP */
+   /* BRW_NEW_SF_VP */
    sf->sf5.sf_viewport_state_offset = (brw->batch.bo->offset64 +
                                       brw->sf.vp_offset) >> 5; /* reloc */
 
@@ -306,9 +306,9 @@ const struct brw_tracked_state brw_sf_unit = {
                _NEW_SCISSOR,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_PROGRAM_CACHE |
+               BRW_NEW_SF_VP |
                BRW_NEW_URB_FENCE,
-      .cache = CACHE_NEW_SF_PROG |
-               CACHE_NEW_SF_VP,
+      .cache = CACHE_NEW_SF_PROG,
    },
    .emit = upload_sf_unit,
 };
index 6cc2770294dd8f8bc9b4553531e97e0c3238ac3a..db0119cde22a459ce11760cd3d00ff2768ac05de 100644 (file)
@@ -520,20 +520,20 @@ static struct dirty_bit_map brw_bits[] = {
    DEFINE_BIT(BRW_NEW_NUM_SAMPLES),
    DEFINE_BIT(BRW_NEW_TEXTURE_BUFFER),
    DEFINE_BIT(BRW_NEW_GEN4_UNIT_STATE),
+   DEFINE_BIT(BRW_NEW_CC_VP),
+   DEFINE_BIT(BRW_NEW_SF_VP),
+   DEFINE_BIT(BRW_NEW_CLIP_VP),
    {0, 0, 0}
 };
 
 static struct dirty_bit_map cache_bits[] = {
-   DEFINE_BIT(CACHE_NEW_CC_VP),
    DEFINE_BIT(CACHE_NEW_WM_PROG),
    DEFINE_BIT(CACHE_NEW_BLORP_BLIT_PROG),
    DEFINE_BIT(CACHE_NEW_SAMPLER),
    DEFINE_BIT(CACHE_NEW_SF_PROG),
-   DEFINE_BIT(CACHE_NEW_SF_VP),
    DEFINE_BIT(CACHE_NEW_VS_PROG),
    DEFINE_BIT(CACHE_NEW_FF_GS_PROG),
    DEFINE_BIT(CACHE_NEW_GS_PROG),
-   DEFINE_BIT(CACHE_NEW_CLIP_VP),
    DEFINE_BIT(CACHE_NEW_CLIP_PROG),
    {0, 0, 0}
 };
index 0d5284d704f68a31425bc2872265ab93b23040f8..4c8fe4c322f317696a62eb6c64f3375ee71da225 100644 (file)
@@ -63,7 +63,7 @@ gen6_upload_clip_vp(struct brw_context *brw)
    vp->ymin = -gby;
    vp->ymax = gby;
 
-   brw->state.dirty.cache |= CACHE_NEW_CLIP_VP;
+   brw->state.dirty.brw |= BRW_NEW_CLIP_VP;
 }
 
 const struct brw_tracked_state gen6_clip_vp = {
@@ -106,7 +106,7 @@ gen6_upload_sf_vp(struct brw_context *brw)
    sfv->viewport.m31 = v[MAT_TY] * y_scale + y_bias;
    sfv->viewport.m32 = v[MAT_TZ] * depth_scale;
 
-   brw->state.dirty.cache |= CACHE_NEW_SF_VP;
+   brw->state.dirty.brw |= BRW_NEW_SF_VP;
 }
 
 const struct brw_tracked_state gen6_sf_vp = {
@@ -136,10 +136,11 @@ const struct brw_tracked_state gen6_viewport_state = {
    .dirty = {
       .mesa = 0,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_CC_VP |
+             BRW_NEW_CLIP_VP |
+             BRW_NEW_SF_VP |
              BRW_NEW_STATE_BASE_ADDRESS,
-      .cache = CACHE_NEW_CC_VP |
-               CACHE_NEW_CLIP_VP |
-               CACHE_NEW_SF_VP,
+      .cache = 0,
    },
    .emit = upload_viewport_state_pointers,
 };