[gtk+/wip/ebassi/gsk-renderer: 42/135] gsk: Add specific debug type for shaders



commit 5313aa28d6a410488a8c0028c77daeab2601c31b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jul 8 16:22:33 2016 +0100

    gsk: Add specific debug type for shaders
    
    So that we don't lose GskShaderBuilder debugging messages in the stream
    of GskGLRenderer ones.

 gsk/gskdebug.c         |    1 +
 gsk/gskdebugprivate.h  |    3 ++-
 gsk/gskshaderbuilder.c |    7 ++++---
 3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gskdebug.c b/gsk/gskdebug.c
index 4b315b0..c52c019 100644
--- a/gsk/gskdebug.c
+++ b/gsk/gskdebug.c
@@ -6,6 +6,7 @@ static const GDebugKey gsk_debug_keys[] = {
   { "renderer", GSK_DEBUG_RENDERER },
   { "cairo", GSK_DEBUG_CAIRO },
   { "opengl", GSK_DEBUG_OPENGL },
+  { "shaders", GSK_DEBUG_SHADERS },
 };
 #endif
 
diff --git a/gsk/gskdebugprivate.h b/gsk/gskdebugprivate.h
index 48b2f92..a62ce2d 100644
--- a/gsk/gskdebugprivate.h
+++ b/gsk/gskdebugprivate.h
@@ -9,7 +9,8 @@ typedef enum {
   GSK_DEBUG_RENDER_NODE = 1 << 0,
   GSK_DEBUG_RENDERER    = 1 << 1,
   GSK_DEBUG_CAIRO       = 1 << 2,
-  GSK_DEBUG_OPENGL      = 1 << 3
+  GSK_DEBUG_OPENGL      = 1 << 3,
+  GSK_DEBUG_SHADERS     = 1 << 4
 } GskDebugFlags;
 
 typedef enum {
diff --git a/gsk/gskshaderbuilder.c b/gsk/gskshaderbuilder.c
index 8e37294..c37a203 100644
--- a/gsk/gskshaderbuilder.c
+++ b/gsk/gskshaderbuilder.c
@@ -260,11 +260,12 @@ gsk_shader_builder_compile_shader (GskShaderBuilder *builder,
   glCompileShader (shader_id);
 
 #ifdef G_ENABLE_DEBUG
-  if (GSK_DEBUG_CHECK (OPENGL))
+  if (GSK_DEBUG_CHECK (SHADERS))
     {
-      g_print ("*** Compiling %s shader ***\n"
+      g_print ("*** Compiling %s shader from '%s' + '%s' ***\n"
                "%s\n",
                shader_type == GL_VERTEX_SHADER ? "vertex" : "fragment",
+               shader_preamble, shader_source,
                source);
     }
 #endif
@@ -395,7 +396,7 @@ gsk_shader_builder_create_program (GskShaderBuilder *builder,
   g_hash_table_insert (builder->programs, GINT_TO_POINTER (program_id), program);
 
 #ifdef G_ENABLE_DEBUG
-  if (GSK_DEBUG_CHECK (OPENGL))
+  if (GSK_DEBUG_CHECK (SHADERS))
     {
       GHashTableIter iter;
       gpointer name_p, location_p;


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