From: Kenneth Graunke Date: Sun, 23 Dec 2018 05:24:02 +0000 (-0800) Subject: iris: Flush the render cache in flush_and_dirty_for_history X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bacc722d1376e95003da9904be9afc979b2be332;p=mesa.git iris: Flush the render cache in flush_and_dirty_for_history BLORP uses the render engine to write to buffers, and we need to flush that data out to the actual surface (finishing the write). Then, the rest of this function invalidates any caches that might have stale data which needs to be refetched. --- diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 0751b19267c..48f348b643e 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -930,6 +930,13 @@ iris_flush_and_dirty_for_history(struct iris_context *ice, return; unsigned flush = PIPE_CONTROL_CS_STALL; + + /* We've likely used the rendering engine (i.e. BLORP) to write to this + * surface. Flush the render cache so the data actually lands. + */ + if (batch->name != IRIS_BATCH_COMPUTE) + flush |= PIPE_CONTROL_RENDER_TARGET_FLUSH; + uint64_t dirty = 0ull; if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER) {