BRW_NEW_PS_BINDING_TABLE |
BRW_NEW_STATE_BASE_ADDRESS |
BRW_NEW_VS_BINDING_TABLE,
- .cache = 0,
},
.emit = gen4_upload_binding_table_pointers,
};
BRW_NEW_PS_BINDING_TABLE |
BRW_NEW_STATE_BASE_ADDRESS |
BRW_NEW_VS_BINDING_TABLE,
- .cache = 0,
},
.emit = gen6_upload_binding_table_pointers,
};
* rendering tracks for GL.
*/
brw->state.dirty.brw = ~0ull;
- brw->state.dirty.cache = ~0;
brw->no_depth_or_stencil = false;
brw->ib.type = -1;
.mesa = _NEW_TRANSFORM |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0
},
.emit = brw_upload_cc_vp
};
.brw = BRW_NEW_BATCH |
BRW_NEW_CC_VP |
BRW_NEW_STATS_WM,
- .cache = 0
},
.emit = upload_cc_unit,
};
.dirty = {
.mesa = _NEW_COLOR,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_blend_constant_color
};
* State update flags signalled as the result of brw_tracked_state updates
*/
uint64_t brw;
- /**
- * State update flags that used to be signalled by brw_state_cache.c
- * searches.
- *
- * Now almost all of that state is just streamed out on demand, but the
- * flags for those state blobs updating have stayed in the same bitfield.
- * brw_state_cache.c still flags BRW_NEW_*_PROG_DATA.
- */
- GLuint cache;
};
/** Subclass of Mesa vertex program */
struct brw_cache_item {
/**
* Effectively part of the key, cache_id identifies what kind of state
- * buffer is involved, and also which brw->state.dirty.cache flag should
- * be set when this cache item is chosen.
+ * buffer is involved, and also which dirty flag should set.
*/
enum brw_cache_id cache_id;
/** 32-bit hash of the key data */
.dirty = {
.mesa = 0,
.brw = BRW_NEW_INDICES,
- .cache = 0,
},
.emit = brw_upload_indices,
};
.mesa = 0,
.brw = BRW_NEW_BATCH |
BRW_NEW_INDEX_BUFFER,
- .cache = 0,
},
.emit = brw_emit_index_buffer,
};
.dirty = {
.mesa = _NEW_BUFFERS,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_drawing_rect
};
.dirty = {
.mesa = _NEW_BUFFERS,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = brw_emit_depthbuffer,
};
.mesa = _NEW_POLYGON |
_NEW_POLYGONSTIPPLE,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_polygon_stipple
};
.mesa = _NEW_BUFFERS |
_NEW_POLYGON,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_polygon_stipple_offset
};
.dirty = {
.mesa = _NEW_LINE,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_aa_line_parameters
};
.dirty = {
.mesa = _NEW_LINE,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = upload_line_stipple
};
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT,
- .cache = 0
},
.emit = brw_upload_invariant_state
};
.mesa = 0,
.brw = BRW_NEW_BATCH |
BRW_NEW_PROGRAM_CACHE,
- .cache = 0,
},
.emit = upload_state_base_address
};
.dirty = {
.mesa = _NEW_TRANSFORM,
.brw = BRW_NEW_INDEX_BUFFER,
- .cache = 0,
},
.emit = haswell_upload_cut_index,
};
.mesa = _NEW_TEXTURE,
.brw = BRW_NEW_BATCH |
BRW_NEW_FRAGMENT_PROGRAM,
- .cache = 0
},
.emit = brw_upload_fs_samplers,
};
.mesa = _NEW_TEXTURE,
.brw = BRW_NEW_BATCH |
BRW_NEW_VERTEX_PROGRAM,
- .cache = 0
},
.emit = brw_upload_vs_samplers,
};
.mesa = _NEW_TEXTURE,
.brw = BRW_NEW_BATCH |
BRW_NEW_GEOMETRY_PROGRAM,
- .cache = 0
},
.emit = brw_upload_gs_samplers,
};
_NEW_SCISSOR |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0
},
.emit = upload_sf_vp
};
*/
brw->state.dirty.mesa |= ~0;
brw->state.dirty.brw |= ~0ull;
- brw->state.dirty.cache |= ~0;
intel_batchbuffer_flush(brw);
}
brw->num_atoms = num_atoms;
while (num_atoms--) {
- assert((*atoms)->dirty.mesa |
- (*atoms)->dirty.brw |
- (*atoms)->dirty.cache);
+ assert((*atoms)->dirty.mesa | (*atoms)->dirty.brw);
assert((*atoms)->emit);
atoms++;
}
static bool
check_state(const struct brw_state_flags *a, const struct brw_state_flags *b)
{
- return ((a->mesa & b->mesa) |
- (a->brw & b->brw) |
- (a->cache & b->cache)) != 0;
+ return ((a->mesa & b->mesa) | (a->brw & b->brw)) != 0;
}
static void accumulate_state( struct brw_state_flags *a,
{
a->mesa |= b->mesa;
a->brw |= b->brw;
- a->cache |= b->cache;
}
{
result->mesa = a->mesa ^ b->mesa;
result->brw = a->brw ^ b->brw;
- result->cache = a->cache ^ b->cache;
}
struct dirty_bit_map {
{0, 0, 0}
};
-static struct dirty_bit_map cache_bits[] = {
- {0, 0, 0}
-};
-
-
static void
brw_update_dirty_count(struct dirty_bit_map *bit_map, uint64_t bits)
{
/* Always re-emit all state. */
state->mesa |= ~0;
state->brw |= ~0ull;
- state->cache |= ~0;
}
if (brw->fragment_program != ctx->FragmentProgram._Current) {
brw->state.dirty.brw |= BRW_NEW_NUM_SAMPLES;
}
- if ((state->mesa | state->cache | state->brw) == 0)
+ if ((state->mesa | state->brw) == 0)
return;
if (unlikely(INTEL_DEBUG)) {
brw_update_dirty_count(mesa_bits, state->mesa);
brw_update_dirty_count(brw_bits, state->brw);
- brw_update_dirty_count(cache_bits, state->cache);
if (dirty_count++ % 1000 == 0) {
brw_print_dirty_count(mesa_bits);
brw_print_dirty_count(brw_bits);
- brw_print_dirty_count(cache_bits);
fprintf(stderr, "\n");
}
}
_NEW_TRANSFORM,
.brw = BRW_NEW_VERTEX_PROGRAM |
BRW_NEW_VERTICES,
- .cache = 0
},
.emit = brw_upload_vs_prog
};
.mesa = _NEW_BUFFERS |
_NEW_COLOR,
.brw = BRW_NEW_BATCH,
- .cache = 0
},
.emit = brw_update_renderbuffer_surfaces,
};
.dirty = {
.mesa = _NEW_BUFFERS,
.brw = BRW_NEW_BATCH,
- .cache = 0
},
.emit = brw_update_renderbuffer_surfaces,
};
BRW_NEW_GEOMETRY_PROGRAM |
BRW_NEW_TEXTURE_BUFFER |
BRW_NEW_VERTEX_PROGRAM,
- .cache = 0
},
.emit = brw_update_texture_surfaces,
};
_NEW_MULTISAMPLE,
.brw = BRW_NEW_BATCH |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = gen6_upload_blend_state,
};
_NEW_STENCIL,
.brw = BRW_NEW_BATCH |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = gen6_upload_color_calc_state,
};
_NEW_STENCIL,
.brw = BRW_NEW_BATCH |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = gen6_upload_depth_stencil_state,
};
.mesa = _NEW_MULTISAMPLE,
.brw = BRW_NEW_CONTEXT |
BRW_NEW_NUM_SAMPLES,
- .cache = 0
},
.emit = upload_multisample_state
};
.brw = BRW_NEW_BATCH |
BRW_NEW_SAMPLER_STATE_TABLE |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = upload_sampler_state_pointers,
};
_NEW_SCISSOR |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = gen6_upload_scissor_state,
};
BRW_NEW_GEOMETRY_PROGRAM |
BRW_NEW_VERTEX_PROGRAM |
BRW_NEW_TRANSFORM_FEEDBACK,
- .cache = 0
},
.emit = gen6_update_sol_surfaces,
};
BRW_NEW_GEOMETRY_PROGRAM |
BRW_NEW_VERTEX_PROGRAM |
BRW_NEW_SURFACES,
- .cache = 0
},
.emit = brw_gs_upload_binding_table,
};
.dirty = {
.mesa = _NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = gen6_upload_clip_vp,
};
.mesa = _NEW_BUFFERS |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = gen6_upload_sf_vp,
};
BRW_NEW_CLIP_VP |
BRW_NEW_SF_VP |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = upload_viewport_state_pointers,
};
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = disable_stages,
};
_NEW_DEPTH |
_NEW_STENCIL,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = brw_emit_depthbuffer,
};
_NEW_PROGRAM |
_NEW_SCISSOR,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = upload_sf_state,
};
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT | BRW_NEW_GEOMETRY_PROGRAM,
- .cache = 0,
},
.emit = gen7_allocate_push_constants,
};
.mesa = _NEW_BUFFERS |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = gen7_upload_sf_clip_viewport,
};
_NEW_MULTISAMPLE,
.brw = BRW_NEW_BATCH |
BRW_NEW_STATE_BASE_ADDRESS,
- .cache = 0,
},
.emit = gen8_upload_blend_state,
};
_NEW_MULTISAMPLE,
.brw = BRW_NEW_CONTEXT |
BRW_NEW_FRAGMENT_PROGRAM,
- .cache = 0,
},
.emit = gen8_upload_ps_blend
};
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = disable_stages,
};
.mesa = 0,
.brw = BRW_NEW_BATCH |
BRW_NEW_INDEX_BUFFER,
- .cache = 0,
},
.emit = gen8_emit_index_buffer,
};
.dirty = {
.mesa = 0,
.brw = BRW_NEW_PRIMITIVE,
- .cache = 0,
},
.emit = gen8_emit_vf_topology,
};
.mesa = 0,
.brw = BRW_NEW_BATCH |
BRW_NEW_PROGRAM_CACHE,
- .cache = 0,
},
.emit = upload_state_base_address
};
.mesa = _NEW_MULTISAMPLE,
.brw = BRW_NEW_CONTEXT |
BRW_NEW_NUM_SAMPLES,
- .cache = 0
},
.emit = upload_multisample_state
};
_NEW_MULTISAMPLE |
_NEW_POINT,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = upload_sf,
};
_NEW_SCISSOR |
_NEW_TRANSFORM,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = upload_raster,
};
.brw = BRW_NEW_BATCH |
BRW_NEW_TRANSFORM_FEEDBACK |
BRW_NEW_VUE_MAP_GEOM_OUT,
- .cache = 0,
},
.emit = upload_sol_state,
};
.mesa = _NEW_BUFFERS |
_NEW_VIEWPORT,
.brw = BRW_NEW_BATCH,
- .cache = 0,
},
.emit = gen8_upload_sf_clip_viewport,
};
_NEW_DEPTH |
_NEW_STENCIL,
.brw = BRW_NEW_CONTEXT,
- .cache = 0,
},
.emit = gen8_upload_wm_depth_stencil,
};