[gtk/wip/chergert/glproto: 558/920] reset arrays on end frame




commit 964b3ecdaea5f0d0cdd376d719db7c5d1965db46
Author: Christian Hergert <chergert redhat com>
Date:   Wed Dec 23 16:34:40 2020 -0800

    reset arrays on end frame

 gsk/next/gskglcommandqueue.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index f7286dcbd9..e815bbba21 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -838,6 +838,7 @@ void
 gsk_gl_command_queue_begin_frame (GskGLCommandQueue *self)
 {
   g_return_if_fail (GSK_IS_GL_COMMAND_QUEUE (self));
+  g_return_if_fail (self->batches->len == 0);
 
   self->tail_batch_index = -1;
 
@@ -869,11 +870,10 @@ void
 gsk_gl_command_queue_end_frame (GskGLCommandQueue *self)
 {
   g_return_if_fail (GSK_IS_GL_COMMAND_QUEUE (self));
+  g_return_if_fail (self->saved_state->len == 0);
 
   gsk_gl_uniform_state_end_frame (self->uniforms);
 
-  self->batches->len = 0;
-
   /* Release autoreleased framebuffers */
   if (self->autorelease_framebuffers->len > 0)
     glDeleteFramebuffers (self->autorelease_framebuffers->len,
@@ -885,6 +885,13 @@ gsk_gl_command_queue_end_frame (GskGLCommandQueue *self)
                       (GLuint *)(gpointer)self->autorelease_textures->data);
 
   g_string_chunk_clear (self->debug_groups);
+
+  self->batches->len = 0;
+  self->batch_draws->len = 0;
+  self->batch_uniforms->len = 0;
+  self->batch_binds->len = 0;
+  self->autorelease_framebuffers->len = 0;
+  self->autorelease_textures->len = 0;
 }
 
 void


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