From: Kenneth Graunke Date: Tue, 25 Nov 2014 07:57:48 +0000 (-0800) Subject: i965: Move BRW_NEW_*_PROG_DATA flags to .brw (not .cache). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f24c168c87e9938f35f5ec135062408148be373;p=mesa.git i965: Move BRW_NEW_*_PROG_DATA flags to .brw (not .cache). 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 Reviewed-by: Kristian Høgsberg Reviewed-by: Matt Turner --- diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c index 2e843d5006b..7ffd7b2e5d1 100644 --- a/src/mesa/drivers/dri/i965/brw_binding_tables.c +++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index 0e1aa5860a9..09a2523d8a0 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index a671ce16861..e678bde4599 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -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; diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 15105a52e12..c3d3b9d2131 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index ca70fd35b48..4ff5815295c 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_ff_gs.c b/src/mesa/drivers/dri/i965/brw_ff_gs.c index f2e9663c002..653c4b6deb3 100644 --- a/src/mesa/drivers/dri/i965/brw_ff_gs.c +++ b/src/mesa/drivers/dri/i965/brw_ff_gs.c @@ -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 }; diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c index cc646de7370..cb46ace0261 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c index 267880baec1..00fcc316ed0 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 16b4db6b042..d4b6e7c8c26 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index c653e3b1842..3306fb5781a 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 29b1597168e..94086a941b5 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -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 diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 5ad06682f9f..875f434c14d 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -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); diff --git a/src/mesa/drivers/dri/i965/brw_urb.c b/src/mesa/drivers/dri/i965/brw_urb.c index 09a906514e7..e76db6af976 100644 --- a/src/mesa/drivers/dri/i965/brw_urb.c +++ b/src/mesa/drivers/dri/i965/brw_urb.c @@ -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 }; diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index 09ecd3a102e..998a22588c1 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 263f391f66d..288aeb72e27 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 51f48b4e101..12cbc72f41a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index f74c320ac7d..8169ef8ef51 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index defceba6855..e8c16ca62c9 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 4ac591cffff..35f5be787bd 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 591890d9958..ccb6b302474 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index 7fb24e49c2c..107a4f24fa6 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 100f567c696..fc0fd1d2ff5 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index d83d4c8d2b0..4ac91afa241 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen7_gs_state.c b/src/mesa/drivers/dri/i965/gen7_gs_state.c index 820c496baf2..0f491393e41 100644 --- a/src/mesa/drivers/dri/i965/gen7_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_gs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c index ae6bf13d6cd..c260bbab6b3 100644 --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c b/src/mesa/drivers/dri/i965/gen7_urb.c index bcf20ff904c..d90e48c802e 100644 --- a/src/mesa/drivers/dri/i965/gen7_urb.c +++ b/src/mesa/drivers/dri/i965/gen7_urb.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen7_vs_state.c b/src/mesa/drivers/dri/i965/gen7_vs_state.c index 1d3ac88d61c..3b0126dd145 100644 --- a/src/mesa/drivers/dri/i965/gen7_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen7_vs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c index 83a5152c67a..575eaf56de9 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen8_depth_state.c b/src/mesa/drivers/dri/i965/gen8_depth_state.c index 9a862c51f92..fc0e3fda59d 100644 --- a/src/mesa/drivers/dri/i965/gen8_depth_state.c +++ b/src/mesa/drivers/dri/i965/gen8_depth_state.c @@ -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 }; diff --git a/src/mesa/drivers/dri/i965/gen8_draw_upload.c b/src/mesa/drivers/dri/i965/gen8_draw_upload.c index a189c19052e..9e8e24b4630 100644 --- a/src/mesa/drivers/dri/i965/gen8_draw_upload.c +++ b/src/mesa/drivers/dri/i965/gen8_draw_upload.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen8_gs_state.c b/src/mesa/drivers/dri/i965/gen8_gs_state.c index 2901538afea..526a8267e4a 100644 --- a/src/mesa/drivers/dri/i965/gen8_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen8_gs_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen8_ps_state.c b/src/mesa/drivers/dri/i965/gen8_ps_state.c index 24e19d411a4..4267bf26958 100644 --- a/src/mesa/drivers/dri/i965/gen8_ps_state.c +++ b/src/mesa/drivers/dri/i965/gen8_ps_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen8_sf_state.c b/src/mesa/drivers/dri/i965/gen8_sf_state.c index edeab1e6d75..91d58011599 100644 --- a/src/mesa/drivers/dri/i965/gen8_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen8_sf_state.c @@ -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, }; diff --git a/src/mesa/drivers/dri/i965/gen8_vs_state.c b/src/mesa/drivers/dri/i965/gen8_vs_state.c index cc13fc6d128..00f27314ca9 100644 --- a/src/mesa/drivers/dri/i965/gen8_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen8_vs_state.c @@ -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, };