Improves drawoverhead baseline scores by 1.17x.
#define IRIS_DIRTY_VF_SGVS (1ull << 52)
#define IRIS_DIRTY_VF (1ull << 53)
#define IRIS_DIRTY_VF_TOPOLOGY (1ull << 54)
+#define IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES (1ull << 55)
+#define IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES (1ull << 56)
#define IRIS_ALL_DIRTY_FOR_COMPUTE (IRIS_DIRTY_CS | \
IRIS_DIRTY_SAMPLER_STATES_CS | \
IRIS_DIRTY_UNCOMPILED_CS | \
IRIS_DIRTY_CONSTANTS_CS | \
- IRIS_DIRTY_BINDINGS_CS)
+ IRIS_DIRTY_BINDINGS_CS | \
+ IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES)
#define IRIS_ALL_DIRTY_FOR_RENDER ~IRIS_ALL_DIRTY_FOR_COMPUTE
iris_update_compiled_shaders(ice);
- bool draw_aux_buffer_disabled[BRW_MAX_DRAW_BUFFERS] = { };
- for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
- if (ice->shaders.prog[stage]) {
- iris_predraw_resolve_inputs(ice, batch, draw_aux_buffer_disabled,
- stage, true);
+ if (ice->state.dirty & IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES) {
+ bool draw_aux_buffer_disabled[BRW_MAX_DRAW_BUFFERS] = { };
+ for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
+ if (ice->shaders.prog[stage])
+ iris_predraw_resolve_inputs(ice, batch, draw_aux_buffer_disabled,
+ stage, true);
}
+ iris_predraw_resolve_framebuffer(ice, batch, draw_aux_buffer_disabled);
}
- iris_predraw_resolve_framebuffer(ice, batch, draw_aux_buffer_disabled);
iris_binder_reserve_3d(ice);
/* We can't do resolves on the compute engine, so awkwardly, we have to
* do them on the render batch...
*/
- iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER], NULL,
- MESA_SHADER_COMPUTE, false);
+ if (ice->state.dirty & IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES) {
+ iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER], NULL,
+ MESA_SHADER_COMPUTE, false);
+ }
iris_batch_maybe_flush(batch, 1500);
ice->state.dirty |= IRIS_DIRTY_PS_BLEND;
ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
+ ice->state.dirty |= IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES;
ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_BLEND];
}
if (cso_changed(alpha.func))
ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
+ if (cso_changed(depth_writes_enabled))
+ ice->state.dirty |= IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES;
+
ice->state.depth_writes_enabled = new_cso->depth_writes_enabled;
ice->state.stencil_writes_enabled = new_cso->stencil_writes_enabled;
}
}
ice->state.dirty |= IRIS_DIRTY_BINDINGS_VS << stage;
+ ice->state.dirty |=
+ stage == MESA_SHADER_COMPUTE ? IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES
+ : IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES;
/* Broadwell also needs brw_image_params re-uploaded */
if (GEN_GEN < 9) {
}
ice->state.dirty |= (IRIS_DIRTY_BINDINGS_VS << stage);
+ ice->state.dirty |=
+ stage == MESA_SHADER_COMPUTE ? IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES
+ : IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES;
}
/**
/* Render target change */
ice->state.dirty |= IRIS_DIRTY_BINDINGS_FS;
+ ice->state.dirty |= IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES;
+
ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_FRAMEBUFFER];
#if GEN_GEN == 11