if (sfence->gfx_unflushed.ctx && sfence->gfx_unflushed.ctx == sctx)
return;
- /* All unflushed commands will not start execution before
- * this fence dependency is signalled.
+ /* All unflushed commands will not start execution before this fence
+ * dependency is signalled. That's fine. Flushing is very expensive
+ * if we get fence_server_sync after every draw call. (which happens
+ * with Android/SurfaceFlinger)
*
- * Therefore we must flush before inserting the dependency
+ * In a nutshell, when CPU overhead is greater than GPU overhead,
+ * or when the time it takes to execute an IB on the GPU is less than
+ * the time it takes to create and submit that IB, flushing decreases
+ * performance. Therefore, DO NOT FLUSH.
*/
- si_flush_from_st(ctx, NULL, PIPE_FLUSH_ASYNC);
-
if (sfence->sdma)
si_add_fence_dependency(sctx, sfence->sdma);
if (sfence->gfx)