[gtk/wip/chergert/glproto] Revert "remove simple batch merging"



commit 9b248be4c8664d38b3df6fd44ebd235343e7680e
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 16 17:24:56 2021 -0800

    Revert "remove simple batch merging"
    
    This reverts commit 39bec235ad1ac977d1b4795e4f98ab7f830e5cbc.

 gsk/next/gskglcommandqueue.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 921e87835f..0d029006a7 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -485,7 +485,29 @@ gsk_gl_command_queue_end_draw (GskGLCommandQueue *self)
   else
     last_batch = NULL;
 
-  enqueue_batch (self);
+  /* Do simple chaining of draw to last batch. */
+  /* TODO: Use merging capabilities for out-or-order batching */
+#if 0
+  if (batch->draw.uniform_count == 0 &&
+      batch->draw.bind_count == 0 &&
+      last_batch != NULL &&
+      last_batch->any.kind == GSK_GL_COMMAND_KIND_DRAW &&
+      last_batch->any.program == batch->any.program &&
+      last_batch->any.viewport.width == batch->any.viewport.width &&
+      last_batch->any.viewport.height == batch->any.viewport.height &&
+      last_batch->draw.framebuffer == batch->draw.framebuffer &&
+      last_batch->draw.vbo_offset + last_batch->draw.vbo_count == batch->draw.vbo_offset)
+    {
+      last_batch->draw.vbo_count += batch->draw.vbo_count;
+      discard_batch (self);
+    }
+  else
+    {
+      enqueue_batch (self);
+    }
+#else
+      enqueue_batch (self);
+#endif
 
   self->in_draw = FALSE;
   self->program_info = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]