ilo_3d_own_render_ring(hw3d);
- /*
- * Without a better tracking mechanism, when the framebuffer changes, we
- * have to assume that the old framebuffer may be sampled from. If that
- * happens in the middle of a batch buffer, we need to insert manual
- * flushes.
- */
- need_flush = (!hw3d->new_batch && (ilo->dirty & ILO_DIRTY_FRAMEBUFFER));
+ if (!hw3d->new_batch) {
+ /*
+ * Without a better tracking mechanism, when the framebuffer changes, we
+ * have to assume that the old framebuffer may be sampled from. If that
+ * happens in the middle of a batch buffer, we need to insert manual
+ * flushes.
+ */
+ need_flush = (ilo->dirty & ILO_DIRTY_FRAMEBUFFER);
+
+ /* same to SO target changes */
+ need_flush |= (ilo->dirty & ILO_DIRTY_STREAM_OUTPUT_TARGETS);
+ }
/* make sure there is enough room first */
max_len = ilo_3d_pipeline_estimate_size(hw3d->pipeline,
gen6_pipeline_update_max_svbi(p, ilo, session);
/* 3DSTATE_SO_BUFFER */
- if (DIRTY(STREAM_OUTPUT_TARGETS) || dirty_sh) {
+ if ((DIRTY(STREAM_OUTPUT_TARGETS) || dirty_sh) &&
+ ilo->stream_output_targets.num_targets) {
int i;
for (i = 0; i < ilo->stream_output_targets.num_targets; i++) {
}
/* 3DSTATE_SO_DECL_LIST */
- if (dirty_sh)
+ if (dirty_sh && ilo->stream_output_targets.num_targets)
p->gen7_3DSTATE_SO_DECL_LIST(p->dev, so_info, sh, p->cp);
/* 3DSTATE_STREAMOUT */