From fca741c06e58af27cea55fae9c1ba09968c3a45b Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Mon, 23 Jun 2014 16:33:50 -0600 Subject: [PATCH] Experimental hack to help isolate flickering shadows --- src/mesa/drivers/dri/i965/intel_buffer_objects.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c index 96dacde..8895b7b 100644 --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c @@ -240,6 +240,10 @@ intel_bufferobj_subdata(struct gl_context * ctx, assert(intel_obj); + // DO NOT COMMIT! + // This is just an interesting hack that circumvents the real problem + bool isUniformBufferUpdate = (ctx->UniformBuffer == obj); + /* See if we can unsynchronized write the data into the user's BO. This * avoids GPU stalls in unfortunately common user patterns (uploading * sequentially into a BO, with draw calls in between each upload). @@ -289,6 +293,12 @@ intel_bufferobj_subdata(struct gl_context * ctx, size); drm_intel_bo_unreference(temp_bo); + + // DO NOT COMMIT! + // This is just an interesting hack that circumvents the real problem + if (isUniformBufferUpdate) + intel_batchbuffer_flush(brw); + return; } else { perf_debug("Stalling on glBufferSubData(%ld, %ld) (%ldkb) to a busy " @@ -303,6 +313,11 @@ intel_bufferobj_subdata(struct gl_context * ctx, drm_intel_bo_subdata(intel_obj->buffer, offset, size, data); intel_bufferobj_mark_inactive(intel_obj); + + // DO NOT COMMIT! + // This is just an interesting hack that circumvents the real problem + if (isUniformBufferUpdate) + intel_batchbuffer_flush(brw); } -- 1.8.3.2