Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57).
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
*/
brw->state.dirty.brw = ~0;
brw->state.dirty.cache = ~0;
+ brw->no_depth_or_stencil = false;
brw->ib.type = -1;
/* Flush the sampler cache so any texturing from the destination is
/* Whether a meta-operation is in progress. */
bool meta_in_progress;
+ /* Whether the last depth/stencil packets were both NULL. */
+ bool no_depth_or_stencil;
+
struct {
struct brw_vertex_element inputs[VERT_ATTRIB_MAX];
struct brw_vertex_buffer buffers[VERT_ATTRIB_MAX];
const struct intel_renderbuffer *irb = NULL;
const struct gl_renderbuffer *rb = NULL;
+ /* Skip repeated NULL depth/stencil emits (think 2D rendering). */
+ if (!mt && brw->no_depth_or_stencil) {
+ assert(brw->hw_ctx);
+ return;
+ }
+
intel_emit_depth_stall_flushes(brw);
irb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
OUT_BATCH(depth_mt ? depth_mt->depth_clear_value : 0);
OUT_BATCH(1);
ADVANCE_BATCH();
+
+ brw->no_depth_or_stencil = !mt;
}
/**
uint32_t lod,
uint32_t min_array_element)
{
+ /* Skip repeated NULL depth/stencil emits (think 2D rendering). */
+ if (!depth_mt && !stencil_mt && brw->no_depth_or_stencil) {
+ assert(brw->hw_ctx);
+ return;
+ }
+
intel_emit_depth_stall_flushes(brw);
/* _NEW_BUFFERS, _NEW_DEPTH, _NEW_STENCIL */
OUT_BATCH(depth_mt ? depth_mt->depth_clear_value : 0);
OUT_BATCH(1);
ADVANCE_BATCH();
+
+ brw->no_depth_or_stencil = !depth_mt && !stencil_mt;
}
/* Awful vtable-compatible function; should be cleaned up in the future. */