i965: Move BRW_NEW_*_PROG_DATA flags to .brw (not .cache).
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 25 Nov 2014 07:57:48 +0000 (23:57 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Dec 2014 01:00:26 +0000 (17:00 -0800)
I put the BRW_NEW_*_PROG_DATA flags at the beginning so that
brw_state_cache.c can still continue using 1 << brw_cache_id.

I also added a comment explaining the difference between
BRW_NEW_*_PROG_DATA and BRW_NEW_*_PROGRAM, as it took me a long time
to remember it.

Non-mechanical changes:
- brw_state_cache.c and brw_ff_gs.c now signal .brw, not .cache.
- brw_state_upload.c - INTEL_DEBUG=state changes.
- brw_context.h - bit definition merging.

v2: Correct the explanation of BRW_NEW_*_PROG_DATA to mention
    state-based recompiles, and nix the "proper subset" claim,
    as it's false. (Caught by Kristian Høgsberg).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
34 files changed:
src/mesa/drivers/dri/i965/brw_binding_tables.c
src/mesa/drivers/dri/i965/brw_clip_state.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_curbe.c
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/brw_ff_gs.c
src/mesa/drivers/dri/i965/brw_gs_state.c
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_misc_state.c
src/mesa/drivers/dri/i965/brw_sf_state.c
src/mesa/drivers/dri/i965/brw_state_cache.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_urb.c
src/mesa/drivers/dri/i965/brw_vs_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_clip_state.c
src/mesa/drivers/dri/i965/gen6_gs_state.c
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen6_urb.c
src/mesa/drivers/dri/i965/gen6_vs_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c
src/mesa/drivers/dri/i965/gen7_gs_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c
src/mesa/drivers/dri/i965/gen7_urb.c
src/mesa/drivers/dri/i965/gen7_vs_state.c
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/drivers/dri/i965/gen8_depth_state.c
src/mesa/drivers/dri/i965/gen8_draw_upload.c
src/mesa/drivers/dri/i965/gen8_gs_state.c
src/mesa/drivers/dri/i965/gen8_ps_state.c
src/mesa/drivers/dri/i965/gen8_sf_state.c
src/mesa/drivers/dri/i965/gen8_vs_state.c

index 2e843d5006b3970fabcd1123a0c767e3ba14d129..7ffd7b2e5d191c868952b407d36542c46aa68ac6 100644 (file)
@@ -111,8 +111,8 @@ const struct brw_tracked_state brw_vs_binding_table = {
       .mesa = 0,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_VS_CONSTBUF |
+             BRW_NEW_VS_PROG_DATA |
              BRW_NEW_SURFACES,
-      .cache = BRW_NEW_VS_PROG_DATA
    },
    .emit = brw_vs_upload_binding_table,
 };
@@ -131,8 +131,8 @@ const struct brw_tracked_state brw_wm_binding_table = {
    .dirty = {
       .mesa = 0,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_FS_PROG_DATA |
              BRW_NEW_SURFACES,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = brw_upload_wm_binding_table,
 };
@@ -155,8 +155,8 @@ const struct brw_tracked_state brw_gs_binding_table = {
       .mesa = 0,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_GS_CONSTBUF |
+             BRW_NEW_GS_PROG_DATA |
              BRW_NEW_SURFACES,
-      .cache = BRW_NEW_GS_PROG_DATA
    },
    .emit = brw_gs_upload_binding_table,
 };
index 0e1aa5860a98982cba66bdaacd15377bd0914ed2..09a2523d8a03a309d1933c766678ad1f83995cc8 100644 (file)
@@ -167,10 +167,10 @@ const struct brw_tracked_state brw_clip_unit = {
                _NEW_TRANSFORM |
                _NEW_VIEWPORT,
       .brw   = BRW_NEW_BATCH |
+               BRW_NEW_CLIP_PROG_DATA |
                BRW_NEW_CURBE_OFFSETS |
                BRW_NEW_PROGRAM_CACHE |
                BRW_NEW_URB_FENCE,
-      .cache = BRW_NEW_CLIP_PROG_DATA
    },
    .emit = brw_upload_clip_unit,
 };
index a671ce168618bfbe498d0fa77a3496c02429f01f..e678bde4599932c462d1315d884193fa9ae3f5f5 100644 (file)
@@ -149,8 +149,21 @@ struct brw_vec4_prog_key;
 struct brw_wm_prog_key;
 struct brw_wm_prog_data;
 
+enum brw_cache_id {
+   BRW_CACHE_FS_PROG,
+   BRW_CACHE_BLORP_BLIT_PROG,
+   BRW_CACHE_SF_PROG,
+   BRW_CACHE_VS_PROG,
+   BRW_CACHE_FF_GS_PROG,
+   BRW_CACHE_GS_PROG,
+   BRW_CACHE_CLIP_PROG,
+
+   BRW_MAX_CACHE
+};
+
 enum brw_state_id {
-   BRW_STATE_URB_FENCE,
+   /* brw_cache_ids must come first - see brw_state_cache.c */
+   BRW_STATE_URB_FENCE = BRW_MAX_CACHE,
    BRW_STATE_FRAGMENT_PROGRAM,
    BRW_STATE_GEOMETRY_PROGRAM,
    BRW_STATE_VERTEX_PROGRAM,
@@ -191,6 +204,38 @@ enum brw_state_id {
    BRW_NUM_STATE_BITS
 };
 
+/**
+ * BRW_NEW_*_PROG_DATA and BRW_NEW_*_PROGRAM are similar, but distinct.
+ *
+ * BRW_NEW_*_PROGRAM relates to the gl_shader_program/gl_program structures.
+ * When the currently bound shader program differs from the previous draw
+ * call, these will be flagged.  They cover brw->{stage}_program and
+ * ctx->{Stage}Program->_Current.
+ *
+ * BRW_NEW_*_PROG_DATA is flagged when the effective shaders change, from a
+ * driver perspective.  Even if the same shader is bound at the API level,
+ * we may need to switch between multiple versions of that shader to handle
+ * changes in non-orthagonal state.
+ *
+ * Additionally, multiple shader programs may have identical vertex shaders
+ * (for example), or compile down to the same code in the backend.  We combine
+ * those into a single program cache entry.
+ *
+ * BRW_NEW_*_PROG_DATA occurs when switching program cache entries, which
+ * covers the brw_*_prog_data structures, and brw->*.prog_offset.
+ */
+#define BRW_NEW_FS_PROG_DATA            (1ull << BRW_CACHE_FS_PROG)
+/* XXX: The BRW_NEW_BLORP_BLIT_PROG_DATA dirty bit is unused (as BLORP doesn't
+ * use the normal state upload paths), but the cache is still used.  To avoid
+ * polluting the brw_state_cache code with special cases, we retain the dirty
+ * bit for now.  It should eventually be removed.
+ */
+#define BRW_NEW_BLORP_BLIT_PROG_DATA    (1ull << BRW_CACHE_BLORP_BLIT_PROG)
+#define BRW_NEW_SF_PROG_DATA            (1ull << BRW_CACHE_SF_PROG)
+#define BRW_NEW_VS_PROG_DATA            (1ull << BRW_CACHE_VS_PROG)
+#define BRW_NEW_FF_GS_PROG_DATA         (1ull << BRW_CACHE_FF_GS_PROG)
+#define BRW_NEW_GS_PROG_DATA            (1ull << BRW_CACHE_GS_PROG)
+#define BRW_NEW_CLIP_PROG_DATA          (1ull << BRW_CACHE_CLIP_PROG)
 #define BRW_NEW_URB_FENCE               (1ull << BRW_STATE_URB_FENCE)
 #define BRW_NEW_FRAGMENT_PROGRAM        (1ull << BRW_STATE_FRAGMENT_PROGRAM)
 #define BRW_NEW_GEOMETRY_PROGRAM        (1ull << BRW_STATE_GEOMETRY_PROGRAM)
@@ -692,18 +737,6 @@ struct brw_gs_prog_data
  */
 #define SHADER_TIME_STRIDE 64
 
-enum brw_cache_id {
-   BRW_CACHE_FS_PROG,
-   BRW_CACHE_BLORP_BLIT_PROG,
-   BRW_CACHE_SF_PROG,
-   BRW_CACHE_VS_PROG,
-   BRW_CACHE_FF_GS_PROG,
-   BRW_CACHE_GS_PROG,
-   BRW_CACHE_CLIP_PROG,
-
-   BRW_MAX_CACHE
-};
-
 struct brw_cache_item {
    /**
     * Effectively part of the key, cache_id identifies what kind of state
@@ -775,16 +808,6 @@ enum shader_time_shader_type {
    ST_FS16_RESET,
 };
 
-/* Flags for brw->state.cache.
- */
-#define BRW_NEW_FS_PROG_DATA                (1 << BRW_CACHE_FS_PROG)
-#define BRW_NEW_BLORP_BLIT_PROG_DATA        (1 << BRW_CACHE_BLORP_BLIT_PROG)
-#define BRW_NEW_SF_PROG_DATA                (1 << BRW_CACHE_SF_PROG)
-#define BRW_NEW_VS_PROG_DATA                (1 << BRW_CACHE_VS_PROG)
-#define BRW_NEW_FF_GS_PROG_DATA             (1 << BRW_CACHE_FF_GS_PROG)
-#define BRW_NEW_GS_PROG_DATA                (1 << BRW_CACHE_GS_PROG)
-#define BRW_NEW_CLIP_PROG_DATA              (1 << BRW_CACHE_CLIP_PROG)
-
 struct brw_vertex_buffer {
    /** Buffer object containing the uploaded vertex data */
    drm_intel_bo *bo;
index 15105a52e12f743808cab85fa4c658852d592d2a..c3d3b9d21310b1bfeeee8bf93faf2cd5b7a2dee1 100644 (file)
@@ -142,9 +142,9 @@ static void calculate_curbe_offsets( struct brw_context *brw )
 const struct brw_tracked_state brw_curbe_offsets = {
    .dirty = {
       .mesa = _NEW_TRANSFORM,
-      .brw  = BRW_NEW_CONTEXT,
-      .cache = BRW_NEW_VS_PROG_DATA |
-               BRW_NEW_FS_PROG_DATA
+      .brw  = BRW_NEW_CONTEXT |
+              BRW_NEW_FS_PROG_DATA |
+              BRW_NEW_VS_PROG_DATA,
    },
    .emit = calculate_curbe_offsets
 };
@@ -311,10 +311,10 @@ const struct brw_tracked_state brw_constant_buffer = {
       .mesa = _NEW_PROGRAM_CONSTANTS,
       .brw  = BRW_NEW_BATCH |
               BRW_NEW_CURBE_OFFSETS |
+              BRW_NEW_FS_PROG_DATA |
               BRW_NEW_PSP | /* Implicit - hardware requires this, not used above */
-              BRW_NEW_URB_FENCE,
-      .cache = BRW_NEW_VS_PROG_DATA |
-               BRW_NEW_FS_PROG_DATA
+              BRW_NEW_URB_FENCE |
+              BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_constant_buffer,
 };
index ca70fd35b48a41e44d54d4f47f238fc0843955da..4ff5815295c6b7950c1cb89a00d6c4ad3ce94325 100644 (file)
@@ -870,8 +870,8 @@ const struct brw_tracked_state brw_vertices = {
    .dirty = {
       .mesa = _NEW_POLYGON,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_VERTICES,
-      .cache = BRW_NEW_VS_PROG_DATA,
+             BRW_NEW_VERTICES |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_emit_vertices,
 };
index f2e9663c002890fd56c088823c1f0371e7272edd..653c4b6deb3957f37babfa554e8c167ae63df28c 100644 (file)
@@ -230,7 +230,7 @@ brw_upload_ff_gs_prog(struct brw_context *brw)
    populate_key(brw, &key);
 
    if (brw->ff_gs.prog_active != key.need_gs_prog) {
-      brw->state.dirty.cache |= BRW_NEW_FF_GS_PROG_DATA;
+      brw->state.dirty.brw |= BRW_NEW_FF_GS_PROG_DATA;
       brw->ff_gs.prog_active = key.need_gs_prog;
    }
 
@@ -252,8 +252,8 @@ const struct brw_tracked_state brw_ff_gs_prog = {
    .dirty = {
       .mesa  = _NEW_LIGHT,
       .brw   = BRW_NEW_PRIMITIVE |
-               BRW_NEW_TRANSFORM_FEEDBACK,
-      .cache = BRW_NEW_VS_PROG_DATA
+               BRW_NEW_TRANSFORM_FEEDBACK |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_ff_gs_prog
 };
index cc646de7370a976149e4f9616542b33dbf736b77..cb46ace0261deacf2586e76f54180227db9477f9 100644 (file)
@@ -93,9 +93,9 @@ const struct brw_tracked_state brw_gs_unit = {
       .mesa  = 0,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CURBE_OFFSETS |
+               BRW_NEW_FF_GS_PROG_DATA |
                BRW_NEW_PROGRAM_CACHE |
                BRW_NEW_URB_FENCE,
-      .cache = BRW_NEW_FF_GS_PROG_DATA
    },
    .emit = brw_upload_gs_unit,
 };
index 267880baec1f93af36f83e02bf5de8a2d00e5b89..00fcc316ed0a96da0c9867f9ce881f94a9f8827d 100644 (file)
@@ -58,8 +58,8 @@ const struct brw_tracked_state brw_gs_pull_constants = {
    .dirty = {
       .mesa = _NEW_PROGRAM_CONSTANTS,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_GEOMETRY_PROGRAM,
-      .cache = BRW_NEW_GS_PROG_DATA,
+             BRW_NEW_GEOMETRY_PROGRAM |
+             BRW_NEW_GS_PROG_DATA,
    },
    .emit = brw_upload_gs_pull_constants,
 };
@@ -85,8 +85,8 @@ const struct brw_tracked_state brw_gs_ubo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_GS_PROG_DATA |
              BRW_NEW_UNIFORM_BUFFER,
-      .cache = BRW_NEW_GS_PROG_DATA,
    },
    .emit = brw_upload_gs_ubo_surfaces,
 };
@@ -110,8 +110,8 @@ const struct brw_tracked_state brw_gs_abo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_ATOMIC_BUFFER |
-             BRW_NEW_BATCH,
-      .cache = BRW_NEW_GS_PROG_DATA,
+             BRW_NEW_BATCH |
+             BRW_NEW_GS_PROG_DATA,
    },
    .emit = brw_upload_gs_abo_surfaces,
 };
index 16b4db6b042c98a1187b3aa9fc86af0d4d6ce10d..d4b6e7c8c26303c2742a9f8fcc20506229da58bc 100644 (file)
@@ -117,10 +117,10 @@ const struct brw_tracked_state brw_psp_urb_cbs = {
    .dirty = {
       .mesa = 0,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_FF_GS_PROG_DATA |
              BRW_NEW_GEN4_UNIT_STATE |
              BRW_NEW_STATE_BASE_ADDRESS |
              BRW_NEW_URB_FENCE,
-      .cache = BRW_NEW_FF_GS_PROG_DATA,
    },
    .emit = upload_psp_urb_cbs,
 };
index c653e3b18429cd514ee49d3139f929ca5abe1be0..3306fb5781a66cad4f618ebeee44928845ab3245 100644 (file)
@@ -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_PROG_DATA |
                BRW_NEW_SF_VP |
                BRW_NEW_URB_FENCE,
-      .cache = BRW_NEW_SF_PROG_DATA,
    },
    .emit = upload_sf_unit,
 };
index 29b1597168e31b3c5b1b2daf1ea4d4230f91bce9..94086a941b54691d8df91149ca4bc336a1c29a98 100644 (file)
@@ -157,7 +157,7 @@ brw_search_cache(struct brw_cache *cache,
    *(void **)out_aux = ((char *)item->key + item->key_size);
 
    if (item->offset != *inout_offset) {
-      brw->state.dirty.cache |= (1 << cache_id);
+      brw->state.dirty.brw |= (1 << cache_id);
       *inout_offset = item->offset;
    }
 
@@ -339,7 +339,7 @@ brw_upload_cache(struct brw_cache *cache,
 
    *out_offset = item->offset;
    *(void **)out_aux = (void *)((char *)item->key + item->key_size);
-   cache->brw->state.dirty.cache |= 1 << cache_id;
+   cache->brw->state.dirty.brw |= 1 << cache_id;
 }
 
 void
index 5ad06682f9f112b2b570e327ef282b51b1282be0..875f434c14dcfee79a9c4e293fba9c2656526ced 100644 (file)
@@ -486,6 +486,13 @@ static struct dirty_bit_map mesa_bits[] = {
 };
 
 static struct dirty_bit_map brw_bits[] = {
+   DEFINE_BIT(BRW_NEW_FS_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_BLORP_BLIT_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_SF_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_VS_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_FF_GS_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_GS_PROG_DATA),
+   DEFINE_BIT(BRW_NEW_CLIP_PROG_DATA),
    DEFINE_BIT(BRW_NEW_URB_FENCE),
    DEFINE_BIT(BRW_NEW_FRAGMENT_PROGRAM),
    DEFINE_BIT(BRW_NEW_GEOMETRY_PROGRAM),
@@ -528,13 +535,6 @@ static struct dirty_bit_map brw_bits[] = {
 };
 
 static struct dirty_bit_map cache_bits[] = {
-   DEFINE_BIT(BRW_NEW_FS_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_BLORP_BLIT_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_SF_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_VS_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_FF_GS_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_GS_PROG_DATA),
-   DEFINE_BIT(BRW_NEW_CLIP_PROG_DATA),
    {0, 0, 0}
 };
 
@@ -648,7 +648,6 @@ void brw_upload_state(struct brw_context *brw)
 
    if (unlikely(INTEL_DEBUG & DEBUG_STATE)) {
       STATIC_ASSERT(ARRAY_SIZE(brw_bits) == BRW_NUM_STATE_BITS + 1);
-      STATIC_ASSERT(ARRAY_SIZE(cache_bits) == BRW_MAX_CACHE + 1);
 
       brw_update_dirty_count(mesa_bits, state->mesa);
       brw_update_dirty_count(brw_bits, state->brw);
index 09a906514e78f3d6349b84eee7a87cb863b1071a..e76db6af976f9246431ef9188d19285a9756e293 100644 (file)
@@ -212,9 +212,9 @@ done:
 const struct brw_tracked_state brw_recalculate_urb_fence = {
    .dirty = {
       .mesa = 0,
-      .brw = BRW_NEW_CURBE_OFFSETS,
-      .cache = BRW_NEW_SF_PROG_DATA |
-               BRW_NEW_VS_PROG_DATA,
+      .brw = BRW_NEW_CURBE_OFFSETS |
+             BRW_NEW_SF_PROG_DATA |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = recalculate_urb_fence
 };
index 09ecd3a102e1182522fbc4a4edc8179e6aec2de4..998a22588c1d80f93aa7a52aedf23e10ae819c85 100644 (file)
@@ -192,8 +192,8 @@ const struct brw_tracked_state brw_vs_unit = {
                BRW_NEW_PROGRAM_CACHE |
                BRW_NEW_SAMPLER_STATE_TABLE |
                BRW_NEW_URB_FENCE |
-               BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA,
+               BRW_NEW_VERTEX_PROGRAM |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_vs_unit,
 };
index 263f391f66d66d40213ce7e31ce98dc0b5e07a5a..288aeb72e274a7bede2bb541edfc516017a8e484 100644 (file)
@@ -129,8 +129,8 @@ const struct brw_tracked_state brw_vs_pull_constants = {
    .dirty = {
       .mesa = _NEW_PROGRAM_CONSTANTS,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA,
+             BRW_NEW_VERTEX_PROGRAM |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_vs_pull_constants,
 };
@@ -155,8 +155,8 @@ const struct brw_tracked_state brw_vs_ubo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_UNIFORM_BUFFER,
-      .cache = BRW_NEW_VS_PROG_DATA,
+             BRW_NEW_UNIFORM_BUFFER |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_vs_ubo_surfaces,
 };
@@ -180,8 +180,8 @@ const struct brw_tracked_state brw_vs_abo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_ATOMIC_BUFFER |
-             BRW_NEW_BATCH,
-      .cache = BRW_NEW_VS_PROG_DATA,
+             BRW_NEW_BATCH |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = brw_upload_vs_abo_surfaces,
 };
index 51f48b4e101afc954d07834f21b380e9d7e42fe2..12cbc72f41a123079de7ded86a2a331cd88efbc0 100644 (file)
@@ -255,10 +255,10 @@ const struct brw_tracked_state brw_wm_unit = {
       .brw = BRW_NEW_BATCH |
              BRW_NEW_CURBE_OFFSETS |
              BRW_NEW_FRAGMENT_PROGRAM |
+             BRW_NEW_FS_PROG_DATA |
              BRW_NEW_PROGRAM_CACHE |
              BRW_NEW_SAMPLER_STATE_TABLE |
              BRW_NEW_STATS_WM,
-      .cache = BRW_NEW_FS_PROG_DATA,
    },
    .emit = brw_upload_wm_unit,
 };
index f74c320ac7de78221244b1bef7268cc14e2243ce..8169ef8ef51729036af25d59f8cf25e6ef1af212 100644 (file)
@@ -495,8 +495,8 @@ const struct brw_tracked_state brw_wm_pull_constants = {
    .dirty = {
       .mesa = _NEW_PROGRAM_CONSTANTS,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_FRAGMENT_PROGRAM,
-      .cache = BRW_NEW_FS_PROG_DATA,
+             BRW_NEW_FRAGMENT_PROGRAM |
+             BRW_NEW_FS_PROG_DATA,
    },
    .emit = brw_upload_wm_pull_constants,
 };
@@ -892,8 +892,8 @@ const struct brw_tracked_state brw_wm_ubo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_BATCH |
+             BRW_NEW_FS_PROG_DATA |
              BRW_NEW_UNIFORM_BUFFER,
-      .cache = BRW_NEW_FS_PROG_DATA,
    },
    .emit = brw_upload_wm_ubo_surfaces,
 };
@@ -943,8 +943,8 @@ const struct brw_tracked_state brw_wm_abo_surfaces = {
    .dirty = {
       .mesa = _NEW_PROGRAM,
       .brw = BRW_NEW_ATOMIC_BUFFER |
-             BRW_NEW_BATCH,
-      .cache = BRW_NEW_FS_PROG_DATA,
+             BRW_NEW_BATCH |
+             BRW_NEW_FS_PROG_DATA,
    },
    .emit = brw_upload_wm_abo_surfaces,
 };
index defceba6855c9d77eb4d09d5ab19d1b4758c67af..e8c16ca62c9bbbb526b42f7783247d62906286cb 100644 (file)
@@ -187,9 +187,9 @@ const struct brw_tracked_state gen6_clip_state = {
                _NEW_LIGHT |
                _NEW_TRANSFORM,
       .brw   = BRW_NEW_CONTEXT |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_META_IN_PROGRESS |
                BRW_NEW_RASTERIZER_DISCARD,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = upload_clip_state,
 };
@@ -201,9 +201,9 @@ const struct brw_tracked_state gen7_clip_state = {
                _NEW_POLYGON |
                _NEW_TRANSFORM,
       .brw   = BRW_NEW_CONTEXT |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_META_IN_PROGRESS |
                BRW_NEW_RASTERIZER_DISCARD,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = upload_clip_state,
 };
index 4ac591cffffb2a4a9132db0d02665bb0cf88d844..35f5be787bdcbcd826b396d4527a99a72418f492 100644 (file)
@@ -57,8 +57,8 @@ const struct brw_tracked_state gen6_gs_push_constants = {
                _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION,
-      .cache = BRW_NEW_GS_PROG_DATA,
    },
    .emit = gen6_upload_gs_push_constants,
 };
@@ -200,10 +200,10 @@ const struct brw_tracked_state gen6_gs_state = {
                _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
+               BRW_NEW_FF_GS_PROG_DATA |
                BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION,
-      .cache = BRW_NEW_FF_GS_PROG_DATA |
-               BRW_NEW_GS_PROG_DATA,
    },
    .emit = upload_gs_state,
 };
index 591890d995808e98f417bdbb607aed497664aee5..ccb6b302474f4bb8001df836feb697e37deef5c6 100644 (file)
@@ -444,10 +444,10 @@ const struct brw_tracked_state gen6_sf_state = {
                _NEW_SCISSOR,
       .brw   = BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_GEOMETRY_PROGRAM |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_VUE_MAP_GEOM_OUT,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = upload_sf_state,
 };
index 7fb24e49c2cb9d9a9f919b73911eee09c267f395..107a4f24fa638139280c5b7ff3ac7e2cf7302102 100644 (file)
@@ -128,10 +128,10 @@ const struct brw_tracked_state gen6_urb = {
    .dirty = {
       .mesa = 0,
       .brw = BRW_NEW_CONTEXT |
-             BRW_NEW_GEOMETRY_PROGRAM,
-      .cache = BRW_NEW_GS_PROG_DATA |
-               BRW_NEW_VS_PROG_DATA |
-               BRW_NEW_FF_GS_PROG_DATA,
+             BRW_NEW_FF_GS_PROG_DATA |
+             BRW_NEW_GEOMETRY_PROGRAM |
+             BRW_NEW_GS_PROG_DATA |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = gen6_upload_urb,
 };
index 100f567c6960d5c6920df56475c0e5a386fe7646..fc0fd1d2ff54d71b819a86b71e3d4017fe62c1eb 100644 (file)
@@ -151,8 +151,8 @@ const struct brw_tracked_state gen6_vs_push_constants = {
                _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION |
-               BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA,
+               BRW_NEW_VERTEX_PROGRAM |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = gen6_upload_vs_push_constants,
 };
@@ -265,8 +265,8 @@ const struct brw_tracked_state gen6_vs_state = {
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION |
-               BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA
+               BRW_NEW_VERTEX_PROGRAM |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = upload_vs_state,
 };
index d83d4c8d2b03ba945b366795d0ebca042bd8d9c0..4ac91afa24138e6cd1e1c923b9c1268ff4b577af 100644 (file)
@@ -59,8 +59,8 @@ const struct brw_tracked_state gen6_wm_push_constants = {
       .mesa  = _NEW_PROGRAM_CONSTANTS,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION,
-      .cache = BRW_NEW_FS_PROG_DATA,
    },
    .emit = gen6_upload_wm_push_constants,
 };
@@ -305,8 +305,8 @@ const struct brw_tracked_state gen6_wm_state = {
                _NEW_PROGRAM_CONSTANTS,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_PUSH_CONSTANT_ALLOCATION,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = upload_wm_state,
 };
index 820c496baf2d455470727fe3a27b70be1611aafa..0f491393e41fd51884fa0f0cf6b196eed313d500 100644 (file)
@@ -156,8 +156,8 @@ const struct brw_tracked_state gen7_gs_state = {
       .mesa  = _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
-               BRW_NEW_GEOMETRY_PROGRAM,
-      .cache = BRW_NEW_GS_PROG_DATA
+               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA,
    },
    .emit = upload_gs_state,
 };
index ae6bf13d6cdeece1c7719de397eda65a2d9de829..c260bbab6b3094e82d6f6bbe2945bf5031b5957b 100644 (file)
@@ -93,10 +93,10 @@ const struct brw_tracked_state gen7_sbe_state = {
                _NEW_PROGRAM,
       .brw   = BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_GEOMETRY_PROGRAM |
                BRW_NEW_PRIMITIVE |
                BRW_NEW_VUE_MAP_GEOM_OUT,
-      .cache = BRW_NEW_FS_PROG_DATA
    },
    .emit = upload_sbe_state,
 };
index bcf20ff904c940a19e636ce49cbe84eeca1b09c8..d90e48c802e2d19517dcea3cb75677dbf45419ee 100644 (file)
@@ -315,9 +315,9 @@ const struct brw_tracked_state gen7_urb = {
    .dirty = {
       .mesa = 0,
       .brw = BRW_NEW_CONTEXT |
-             BRW_NEW_GEOMETRY_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA |
-               BRW_NEW_GS_PROG_DATA,
+             BRW_NEW_GEOMETRY_PROGRAM |
+             BRW_NEW_GS_PROG_DATA |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = gen7_upload_urb,
 };
index 1d3ac88d61c5b02e63e9765d9ac02c57ecdad38e..3b0126dd1455dfbdfc096047c42f48622714be43 100644 (file)
@@ -114,8 +114,8 @@ const struct brw_tracked_state gen7_vs_state = {
       .mesa  = _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
-               BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA
+               BRW_NEW_VERTEX_PROGRAM |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = upload_vs_state,
 };
index 83a5152c67ac84828435330a3bfe8130d3586fc8..575eaf56de9acf9be8085fbb3762757dcba8e8fb 100644 (file)
@@ -132,8 +132,8 @@ const struct brw_tracked_state gen7_wm_state = {
                _NEW_MULTISAMPLE |
                _NEW_POLYGON,
       .brw   = BRW_NEW_BATCH |
-               BRW_NEW_FRAGMENT_PROGRAM,
-      .cache = BRW_NEW_FS_PROG_DATA,
+               BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_wm_state,
 };
@@ -276,8 +276,8 @@ const struct brw_tracked_state gen7_ps_state = {
                _NEW_COLOR |
                _NEW_MULTISAMPLE,
       .brw   = BRW_NEW_BATCH |
-               BRW_NEW_FRAGMENT_PROGRAM,
-      .cache = BRW_NEW_FS_PROG_DATA
+               BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_ps_state,
 };
index 9a862c51f923c72645160ac926f8624afba896ec..fc0e3fda59d3e1cb6933dad56a21ea22934c088b 100644 (file)
@@ -372,8 +372,8 @@ const struct brw_tracked_state gen8_pma_fix = {
               _NEW_DEPTH |
               _NEW_MULTISAMPLE |
               _NEW_STENCIL,
-      .brw = BRW_NEW_FRAGMENT_PROGRAM,
-      .cache = BRW_NEW_FS_PROG_DATA,
+      .brw = BRW_NEW_FRAGMENT_PROGRAM |
+             BRW_NEW_FS_PROG_DATA,
    },
    .emit = gen8_emit_pma_stall_workaround
 };
index a189c19052ed25b74315ec01d2ad0388832fdec1..9e8e24b4630473e62389ba7c2bd3166c9b02e838 100644 (file)
@@ -234,8 +234,8 @@ const struct brw_tracked_state gen8_vertices = {
    .dirty = {
       .mesa = _NEW_POLYGON,
       .brw = BRW_NEW_BATCH |
-             BRW_NEW_VERTICES,
-      .cache = BRW_NEW_VS_PROG_DATA,
+             BRW_NEW_VERTICES |
+             BRW_NEW_VS_PROG_DATA,
    },
    .emit = gen8_emit_vertices,
 };
index 2901538afea67628319ecedb20edc9a0d8344d9a..526a8267e4a518296f55265b688251a7c9ff808a 100644 (file)
@@ -122,8 +122,8 @@ const struct brw_tracked_state gen8_gs_state = {
       .mesa  = _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
-               BRW_NEW_GEOMETRY_PROGRAM,
-      .cache = BRW_NEW_GS_PROG_DATA
+               BRW_NEW_GEOMETRY_PROGRAM |
+               BRW_NEW_GS_PROG_DATA,
    },
    .emit = gen8_upload_gs_state,
 };
index 24e19d411a4cfbb42c820236d5e91be5b6ddc3b5..4267bf269587197fe98ca51b01fb7bbe8637c699 100644 (file)
@@ -89,8 +89,8 @@ const struct brw_tracked_state gen8_ps_extra = {
       .mesa  = _NEW_MULTISAMPLE,
       .brw   = BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_NUM_SAMPLES,
-      .cache = BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_ps_extra,
 };
@@ -128,8 +128,8 @@ const struct brw_tracked_state gen8_wm_state = {
    .dirty = {
       .mesa  = _NEW_LINE |
                _NEW_POLYGON,
-      .brw   = BRW_NEW_CONTEXT,
-      .cache = BRW_NEW_FS_PROG_DATA,
+      .brw   = BRW_NEW_CONTEXT |
+               BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_wm_state,
 };
@@ -252,8 +252,8 @@ const struct brw_tracked_state gen8_ps_state = {
    .dirty = {
       .mesa  = _NEW_MULTISAMPLE,
       .brw   = BRW_NEW_BATCH |
-               BRW_NEW_FRAGMENT_PROGRAM,
-      .cache = BRW_NEW_FS_PROG_DATA
+               BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_ps_state,
 };
index edeab1e6d752709898d57798c11ceb546fad98f0..91d580115995331f42a54658aae38e8307db5e82 100644 (file)
@@ -133,8 +133,8 @@ const struct brw_tracked_state gen8_sbe_state = {
                _NEW_PROGRAM,
       .brw   = BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM |
+               BRW_NEW_FS_PROG_DATA |
                BRW_NEW_VUE_MAP_GEOM_OUT,
-      .cache = BRW_NEW_FS_PROG_DATA,
    },
    .emit = upload_sbe,
 };
index cc13fc6d1284e996607047ff31472564e77f0a65..00f27314ca9475d6242e7f7d02e565a81346d4aa 100644 (file)
@@ -84,8 +84,8 @@ const struct brw_tracked_state gen8_vs_state = {
       .mesa  = _NEW_TRANSFORM,
       .brw   = BRW_NEW_BATCH |
                BRW_NEW_CONTEXT |
-               BRW_NEW_VERTEX_PROGRAM,
-      .cache = BRW_NEW_VS_PROG_DATA
+               BRW_NEW_VERTEX_PROGRAM |
+               BRW_NEW_VS_PROG_DATA,
    },
    .emit = upload_vs_state,
 };