zink: document end-of-frame hack
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Jul 2019 14:33:27 +0000 (16:33 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:46 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c

index 23971d22762b96c89ab4f2c0e6229b6344e8edf0..ca69b1dcdab7cedc809e14930a82088b2b92be9a 100644 (file)
@@ -1133,6 +1133,14 @@ zink_flush(struct pipe_context *pctx,
                            (struct zink_fence **)pfence,
                            batch->fence);
 
+   /* HACK:
+    * For some strange reason, we need to finish before presenting, or else
+    * we start rendering on top of the back-buffer for the next frame. This
+    * seems like a bug in the DRI-driver to me, because we really should
+    * be properly protected by fences here, and the back-buffer should
+    * either be swapped with the front-buffer, or blitted from. But for
+    * some strange reason, neither of these things happen.
+    */
    if (flags & PIPE_FLUSH_END_OF_FRAME)
       pctx->screen->fence_finish(pctx->screen, pctx,
                                  (struct pipe_fence_handle *)batch->fence,