gsk: Add specific debug type for shaders

So that we don't lose GskShaderBuilder debugging messages in the stream
of GskGLRenderer ones.
This commit is contained in:
Emmanuele Bassi 2016-07-08 16:22:33 +01:00
parent 46bb14e173
commit d3393d51ff
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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;