From 8caaf5a8b233f138f354028fdd6f8fd4e1014cf9 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 8 Aug 2010 14:09:26 +0100 Subject: [PATCH] material: Improve the dot file debugging code This improve the dot file output available when calling _cogl_debug_dump_materials_dot_file. The material graph now directly points into the layer graph and the layers now show the texture unit index. --- cogl/cogl-material.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c index 8abb9ef48..91d861e41 100644 --- a/cogl/cogl-material.c +++ b/cogl/cogl-material.c @@ -5147,30 +5147,38 @@ dump_layer_cb (CoglMaterialNode *node, void *user_data) gboolean changes = FALSE; if (state->parent_id >= 0) - g_string_append_printf (state->graph, "%*slayer%d -> layer%d;\n", + g_string_append_printf (state->graph, "%*slayer%p -> layer%p;\n", state->indent, "", - state->parent_id, - layer_id); + layer->_parent.parent, + layer); g_string_append_printf (state->graph, - "%*slayer%d [label=\"layer=0x%p\\n" + "%*slayer%p [label=\"layer=0x%p\\n" "ref count=%d\" " "color=\"blue\"];\n", state->indent, "", - layer_id, + layer, layer, COGL_OBJECT (layer)->ref_count); changes_label = g_string_new (""); g_string_append_printf (changes_label, - "%*slayer%d -> layer_state%d [weight=100];\n" + "%*slayer%p -> layer_state%d [weight=100];\n" "%*slayer_state%d [shape=box label=\"", state->indent, "", - layer_id, + layer, layer_id, state->indent, "", layer_id); + if (layer->differences & COGL_MATERIAL_LAYER_STATE_UNIT) + { + changes = TRUE; + g_string_append_printf (changes_label, + "\\lunit=%u\\n", + layer->unit_index); + } + if (layer->differences & COGL_MATERIAL_LAYER_STATE_TEXTURE) { changes = TRUE; @@ -5208,13 +5216,7 @@ dump_layer_ref_cb (CoglMaterialLayer *layer, void *data) int material_id = *state->node_id_ptr; g_string_append_printf (state->graph, - "%*smaterial_state%d -> layer_ref%d [weight=200];\n", - state->indent, "", - material_id, - material_id); - g_string_append_printf (state->graph, - "%*slayer_ref%d [label=\"addr=0x%p\" " - "shape=box color=blue];\n", + "%*smaterial_state%d -> layer%p;\n", state->indent, "", material_id, layer);