diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 9cd017a5cff..28c60c9edf5 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -505,9 +505,8 @@ vf_invalidate_for_vb_48bit_transitions(struct brw_context *brw) { #if GEN_GEN >= 8 bool need_invalidate = false; - unsigned i; - for (i = 0; i < brw->vb.nr_buffers; i++) { + for (unsigned i = 0; i < brw->vb.nr_buffers; i++) { uint16_t high_bits = pinned_bo_high_bits(brw->vb.buffers[i].bo); if (high_bits != brw->vb.last_bo_high_bits[i]) { @@ -516,9 +515,23 @@ vf_invalidate_for_vb_48bit_transitions(struct brw_context *brw) } } - /* Don't bother with draw parameter buffers - those are generated by - * the driver so we can select a consistent memory zone. - */ + if (brw->draw.draw_params_bo) { + uint16_t high_bits = pinned_bo_high_bits(brw->draw.draw_params_bo); + + if (brw->vb.last_bo_high_bits[brw->vb.nr_buffers] != high_bits) { + need_invalidate = true; + brw->vb.last_bo_high_bits[brw->vb.nr_buffers] = high_bits; + } + } + + if (brw->draw.derived_draw_params_bo) { + uint16_t high_bits = pinned_bo_high_bits(brw->draw.derived_draw_params_bo); + + if (brw->vb.last_bo_high_bits[brw->vb.nr_buffers + 1] != high_bits) { + need_invalidate = true; + brw->vb.last_bo_high_bits[brw->vb.nr_buffers + 1] = high_bits; + } + } if (need_invalidate) { brw_emit_pipe_control_flush(brw, PIPE_CONTROL_VF_CACHE_INVALIDATE);