uint32_t state_batch_offset;
enum brw_gpu_ring ring;
bool needs_sol_reset;
+ bool state_base_address_emitted;
struct {
uint32_t *map_next;
void
brw_upload_state_base_address(struct brw_context *brw)
{
+ if (brw->batch.state_base_address_emitted)
+ return;
+
/* FINISHME: According to section 3.6.1 "STATE_BASE_ADDRESS" of
* vol1a of the G45 PRM, MI_FLUSH with the ISC invalidate should be
* programmed prior to STATE_BASE_ADDRESS.
*/
brw->ctx.NewDriverState |= BRW_NEW_STATE_BASE_ADDRESS;
+ brw->batch.state_base_address_emitted = true;
}
-
-const struct brw_tracked_state brw_state_base_address = {
- .dirty = {
- .mesa = 0,
- .brw = BRW_NEW_BATCH |
- BRW_NEW_PROGRAM_CACHE,
- },
- .emit = brw_upload_state_base_address
-};
extern const struct brw_tracked_state brw_recalculate_urb_fence;
extern const struct brw_tracked_state brw_sf_unit;
extern const struct brw_tracked_state brw_sf_vp;
-extern const struct brw_tracked_state brw_state_base_address;
extern const struct brw_tracked_state brw_vs_samplers;
extern const struct brw_tracked_state brw_tcs_samplers;
extern const struct brw_tracked_state brw_tes_samplers;
void brw_upload_state_base_address(struct brw_context *brw);
-
/* gen8_depth_state.c */
void gen8_write_pma_stall_bits(struct brw_context *brw,
uint32_t pma_stall_bits);
* that depend on it (state base address on gen5+, or unit state before).
*/
brw->ctx.NewDriverState |= BRW_NEW_PROGRAM_CACHE;
+ brw->batch.state_base_address_emitted = false;
}
/**
/* Command packets:
*/
&brw_invariant_state,
- &brw_state_base_address,
&brw_binding_table_pointers,
&brw_blend_constant_color,
/* Command packets: */
- /* must do before binding table pointers, cc state ptrs */
- &brw_state_base_address,
-
&brw_cc_vp,
&gen6_viewport_state, /* must do after *_vp stages */
{
/* Command packets: */
- /* must do before binding table pointers, cc state ptrs */
- &brw_state_base_address,
-
&brw_cc_vp,
&gen7_sf_clip_viewport,
static const struct brw_tracked_state *gen7_compute_atoms[] =
{
- &brw_state_base_address,
&gen7_l3_state,
&brw_cs_image_surfaces,
&gen7_cs_push_constants,
static const struct brw_tracked_state *gen8_render_atoms[] =
{
- /* Command packets: */
- &brw_state_base_address,
-
&brw_cc_vp,
&gen8_sf_clip_viewport,
static const struct brw_tracked_state *gen8_compute_atoms[] =
{
- &brw_state_base_address,
&gen7_l3_state,
&brw_cs_image_surfaces,
&gen7_cs_push_constants,
brw_upload_programs(brw, pipeline);
merge_ctx_state(brw, &state);
+ brw_upload_state_base_address(brw);
+
const struct brw_tracked_state *atoms =
brw_get_pipeline_atoms(brw, pipeline);
const int num_atoms = brw->num_atoms[pipeline];
/* Emit workaround flushes when we switch from drawing to blorping. */
brw_emit_post_sync_nonzero_flush(brw);
- if (brw_state_base_address.dirty.brw & brw->ctx.NewDriverState)
- brw_upload_state_base_address(brw);
+ brw_upload_state_base_address(brw);
gen6_emit_3dstate_multisample(brw, params->dst.num_samples);
gen6_emit_3dstate_sample_mask(brw,
uint32_t wm_push_const_offset = 0;
uint32_t wm_bind_bo_offset = 0;
- if (brw_state_base_address.dirty.brw & brw->ctx.NewDriverState)
- brw_upload_state_base_address(brw);
+ brw_upload_state_base_address(brw);
gen6_emit_3dstate_multisample(brw, params->dst.num_samples);
gen6_emit_3dstate_sample_mask(brw,
{
uint32_t wm_bind_bo_offset = 0;
- if (brw_state_base_address.dirty.brw & brw->ctx.NewDriverState)
- brw_upload_state_base_address(brw);
+ brw_upload_state_base_address(brw);
gen7_blorp_emit_cc_viewport(brw);
gen7_l3_state.emit(brw);
brw->batch.reserved_space = BATCH_RESERVED;
brw->batch.state_batch_offset = brw->batch.bo->size;
brw->batch.needs_sol_reset = false;
+ brw->batch.state_base_address_emitted = false;
/* We don't know what ring the new batch will be sent to until we see the
* first BEGIN_BATCH or BEGIN_BATCH_BLT. Mark it as unknown.