iris: Flush the render cache in flush_and_dirty_for_history
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 23 Dec 2018 05:24:02 +0000 (21:24 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:11 +0000 (10:26 -0800)
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

index 0751b19267c1d130da712729b93c76a88bb0ac5d..48f348b643e0c62a49f8d1e18be0983108a5aefd 100644 (file)
@@ -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) {