[gtk/wip/chergert/glproto: 463/493] remove debug groups




commit 3702f44358bb97cfea6074623ec1d9f490c1bede
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 15 17:25:46 2021 -0800

    remove debug groups
    
    we dont use these anyway now with batch reordering. we might want to bring them
    back, at the cost of additional data within each batch for its current debug group.
    but at that point, they don't really make sense to be hierarchical.

 gsk/next/gskglcommandqueue.c        | 67 -------------------------------------
 gsk/next/gskglcommandqueueprivate.h | 18 ----------
 gsk/next/gskglrenderjob.c           | 11 ++----
 3 files changed, 2 insertions(+), 94 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 2db79e2b13..ea990a5076 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -585,51 +585,6 @@ gsk_gl_command_queue_clear (GskGLCommandQueue     *self,
   self->attachments->fbo.changed = FALSE;
 }
 
-void
-gsk_gl_command_queue_push_debug_group (GskGLCommandQueue *self,
-                                       const char        *debug_group)
-{
-#ifdef G_ENABLE_DEBUG
-  GskGLCommandBatch *batch;
-
-  g_assert (GSK_IS_GL_COMMAND_QUEUE (self));
-  g_assert (self->in_draw == FALSE);
-
-  if (self->batches.len == G_MAXINT16)
-    return;
-
-  batch = begin_next_batch (self);
-  batch->any.kind = GSK_GL_COMMAND_KIND_PUSH_DEBUG_GROUP;
-  batch->debug_group.debug_group = g_string_chunk_insert (self->debug_groups, debug_group);
-  batch->any.next_batch_index = -1;
-  batch->any.program = 0;
-
-  enqueue_batch (self);
-#endif
-}
-
-void
-gsk_gl_command_queue_pop_debug_group (GskGLCommandQueue *self)
-{
-#ifdef G_ENABLE_DEBUG
-  GskGLCommandBatch *batch;
-
-  g_assert (GSK_IS_GL_COMMAND_QUEUE (self));
-  g_assert (self->in_draw == FALSE);
-
-  if (self->batches.len == G_MAXINT16)
-    return;
-
-  batch = begin_next_batch (self);
-  batch->any.kind = GSK_GL_COMMAND_KIND_POP_DEBUG_GROUP;
-  batch->debug_group.debug_group = NULL;
-  batch->any.next_batch_index = -1;
-  batch->any.program = 0;
-
-  enqueue_batch (self);
-#endif
-}
-
 GdkGLContext *
 gsk_gl_command_queue_get_context (GskGLCommandQueue *self)
 {
@@ -890,10 +845,6 @@ gsk_gl_command_queue_sort_batches (GskGLCommandQueue *self)
 
       switch (batch->any.kind)
         {
-        case GSK_GL_COMMAND_KIND_POP_DEBUG_GROUP:
-        case GSK_GL_COMMAND_KIND_PUSH_DEBUG_GROUP:
-          break;
-
         case GSK_GL_COMMAND_KIND_DRAW:
           fbo = batch->draw.framebuffer;
           break;
@@ -988,13 +939,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
   for (guint i = 0; i < G_N_ELEMENTS (textures); i++)
     textures[i] = -1;
 
-#if 1
-  /* TODO: For batch sorting to work, we need to snapshot the whole uniform
-   * state with each batch so that we can re-apply all uniforms since what
-   * we captured may not reflect the current state.
-   */
   gsk_gl_command_queue_sort_batches (self);
-#endif
 
   gsk_gl_command_queue_make_current (self);
 
@@ -1074,18 +1019,6 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
           glClear (batch->clear.bits);
         break;
 
-        case GSK_GL_COMMAND_KIND_PUSH_DEBUG_GROUP:
-#ifdef G_ENABLE_DEBUG
-          //gdk_gl_context_push_debug_group (self->context, batch->debug_group.debug_group);
-#endif
-        break;
-
-        case GSK_GL_COMMAND_KIND_POP_DEBUG_GROUP:
-#ifdef G_ENABLE_DEBUG
-          //gdk_gl_context_pop_debug_group (self->context);
-#endif
-        break;
-
         case GSK_GL_COMMAND_KIND_DRAW:
           if (batch->any.program != program)
             {
diff --git a/gsk/next/gskglcommandqueueprivate.h b/gsk/next/gskglcommandqueueprivate.h
index 6402d878f6..63d48a8dbf 100644
--- a/gsk/next/gskglcommandqueueprivate.h
+++ b/gsk/next/gskglcommandqueueprivate.h
@@ -43,12 +43,6 @@ typedef enum _GskGLCommandKind
   /* The batch will perform a glClear() */
   GSK_GL_COMMAND_KIND_CLEAR,
 
-  /* THe batch represents a new debug group */
-  GSK_GL_COMMAND_KIND_PUSH_DEBUG_GROUP,
-
-  /* The batch represents the end of a debug group */
-  GSK_GL_COMMAND_KIND_POP_DEBUG_GROUP,
-
   /* The batch will perform a glDrawArrays() */
   GSK_GL_COMMAND_KIND_DRAW,
 } GskGLCommandKind;
@@ -147,14 +141,6 @@ typedef struct _GskGLCommandDraw
 
 G_STATIC_ASSERT (sizeof (GskGLCommandDraw) == 32);
 
-typedef struct _GskGLCommandDebug
-{
-  GskGLCommandBatchAny any;
-  const char *debug_group;
-} GskGLCommandDebug;
-
-G_STATIC_ASSERT (sizeof (GskGLCommandDebug) == 24);
-
 typedef struct _GskGLCommandClear
 {
   GskGLCommandBatchAny  any;
@@ -176,7 +162,6 @@ typedef union _GskGLCommandBatch
 {
   GskGLCommandBatchAny any;
   GskGLCommandDraw     draw;
-  GskGLCommandDebug    debug_group;
   GskGLCommandClear    clear;
 } GskGLCommandBatch;
 
@@ -318,9 +303,6 @@ void               gsk_gl_command_queue_delete_program       (GskGLCommandQueue
 void               gsk_gl_command_queue_clear                (GskGLCommandQueue        *self,
                                                               guint                     clear_bits,
                                                               const graphene_rect_t    *viewport);
-void               gsk_gl_command_queue_push_debug_group     (GskGLCommandQueue        *self,
-                                                              const char               *message);
-void               gsk_gl_command_queue_pop_debug_group      (GskGLCommandQueue        *self);
 void               gsk_gl_command_queue_begin_draw           (GskGLCommandQueue        *self,
                                                               GskGLUniformProgram      *program_info,
                                                               const graphene_rect_t    *viewport);
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index ea3cc382cc..831409fda0 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -3330,15 +3330,8 @@ gsk_gl_render_job_visit_node (GskGLRenderJob      *job,
     break;
 
     case GSK_DEBUG_NODE:
-      {
-        const char *message = gsk_debug_node_get_message (node);
-
-        if (message != NULL)
-          gsk_gl_command_queue_push_debug_group (job->command_queue, message);
-        gsk_gl_render_job_visit_node (job, gsk_debug_node_get_child (node));
-        if (message != NULL)
-          gsk_gl_command_queue_pop_debug_group (job->command_queue);
-      }
+      /* Debug nodes are ignored because draws get reordered anyway */
+      gsk_gl_render_job_visit_node (job, gsk_debug_node_get_child (node));
     break;
 
     case GSK_GL_SHADER_NODE:


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