From 3acef3ff100b8a8ee3cdaa8f3400d1993e8a9fb1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 18 Oct 2017 10:31:28 +0100 Subject: [PATCH] only-stage-for-inbatch --- src/mesa/drivers/dri/i965/intel_buffer_objects.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c index 425c5e1372..6c8d778925 100644 --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c @@ -259,7 +259,7 @@ brw_buffer_subdata(struct gl_context *ctx, { struct brw_context *brw = brw_context(ctx); struct intel_buffer_object *intel_obj = intel_buffer_object(obj); - bool busy; + bool in_batch; if (size == 0) return; @@ -290,18 +290,15 @@ brw_buffer_subdata(struct gl_context *ctx, return; } - busy = - brw_bo_busy(intel_obj->buffer) || - brw_batch_references(&brw->batch, intel_obj->buffer); - - if (busy) { + in_batch = brw_batch_references(&brw->batch, intel_obj->buffer); + if (in_batch || brw_bo_busy(intel_obj->buffer)) { if (size == intel_obj->Base.Size || (intel_obj->valid_data_start >= offset && intel_obj->valid_data_end <= offset + size)) { /* Replace the current busy bo so the subdata doesn't stall. */ brw_bo_unreference(intel_obj->buffer); alloc_buffer_object(brw, intel_obj); - } else if (!intel_obj->prefer_stall_to_blit) { + } else if (in_batch) { perf_debug("Using a blit copy to avoid stalling on " "glBufferSubData(%ld, %ld) (%ldkb) to a busy " "(%d-%d) / valid (%d-%d) buffer object.\n", @@ -331,7 +328,6 @@ brw_buffer_subdata(struct gl_context *ctx, (long)offset, (long)offset + size, (long)(size/1024), intel_obj->gpu_active_start, intel_obj->gpu_active_end); - intel_batchbuffer_flush(brw); } } -- 2.15.0.rc1