iris: Fix TextureBarrier
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 8 Nov 2018 07:23:30 +0000 (23:23 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
I don't know how I came up with the old one, this is now what i965 does
Also we now do compute batches too

src/gallium/drivers/iris/iris_pipe_control.c

index 5b9935398d3d0c90745b85a1a95d95e5eadac920..3face134def69aab75ed571c16bcc4f24e41916d 100644 (file)
@@ -150,9 +150,21 @@ iris_texture_barrier(struct pipe_context *ctx, unsigned flags)
 {
    struct iris_context *ice = (void *) ctx;
 
-   // XXX: compute batch?
+   if (ice->render_batch.contains_draw) {
+      iris_emit_pipe_control_flush(&ice->render_batch,
+                                   PIPE_CONTROL_DEPTH_CACHE_FLUSH |
+                                   PIPE_CONTROL_RENDER_TARGET_FLUSH |
+                                   PIPE_CONTROL_CS_STALL);
+      iris_emit_pipe_control_flush(&ice->render_batch,
+                                   PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE);
+   }
 
-   iris_flush_depth_and_render_caches(&ice->render_batch);
+   if (ice->compute_batch.contains_draw) {
+      iris_emit_pipe_control_flush(&ice->compute_batch,
+                                   PIPE_CONTROL_CS_STALL);
+      iris_emit_pipe_control_flush(&ice->compute_batch,
+                                   PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE);
+   }
 }
 
 static void