iris: Perform compute predraw flushes from compute batch.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 6 Feb 2020 02:27:46 +0000 (18:27 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 23:12:22 +0000 (23:12 +0000)
Whenever iris_predraw_resolve_inputs() ends up doing a flush or
invalidate, we really want it to be on the same batch which is going
to consume the result.  Any resolves should still be performed from
the render batch thanks to the previous patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3875>

src/gallium/drivers/iris/iris_draw.c

index c0d749e89270e249d273a7c919dffd1786e7f6d2..c9f4da99912cdd78c2b09a7af935c91e9d2eadfd 100644 (file)
@@ -351,13 +351,8 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid)
       ice->state.stage_dirty |= IRIS_ALL_STAGE_DIRTY_FOR_COMPUTE;
    }
 
-   /* We can't do resolves on the compute engine, so awkwardly, we have to
-    * do them on the render batch...
-    */
-   if (ice->state.dirty & IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES) {
-      iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER], NULL,
-                                  MESA_SHADER_COMPUTE, false);
-   }
+   if (ice->state.dirty & IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES)
+      iris_predraw_resolve_inputs(ice, batch, NULL, MESA_SHADER_COMPUTE, false);
 
    iris_batch_maybe_flush(batch, 1500);