From bacc722d1376e95003da9904be9afc979b2be332 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 22 Dec 2018 21:24:02 -0800 Subject: [PATCH] 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. --- src/gallium/drivers/iris/iris_resource.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.30.2