[gegl] gegl-init: Read debug flags before initializing opencl



commit c14bef8498ae7ef32684f97352031a5e9f582fe6
Author: Tom Stellard <thomas stellard amd com>
Date:   Mon Sep 10 16:26:58 2012 +0000

    gegl-init: Read debug flags before initializing opencl
    
    Setting the use-opencl property on the gegl_config object ends up calling
    gegl_cl_init(), which initializes the gegl opencl state.  Since the
    opencl initialization was happening before the initialization of
    gegl_debug_flags, none of the opencl debug statements were being printed.

 gegl/gegl-init.c |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index f75bad8..aa1f63c 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -471,6 +471,21 @@ gegl_post_parse_hook (GOptionContext *context,
   babl_init ();
   gegl_instrument ("gegl", "gegl_init", 0);
 
+#ifdef GEGL_ENABLE_DEBUG
+  {
+    const char *env_string;
+    env_string = g_getenv ("GEGL_DEBUG");
+    if (env_string != NULL)
+      {
+        gegl_debug_flags =
+          g_parse_debug_string (env_string,
+                                gegl_debug_keys,
+                                G_N_ELEMENTS (gegl_debug_keys));
+        env_string = NULL;
+      }
+  }
+#endif /* GEGL_ENABLE_DEBUG */
+
   config = (void*)gegl_config ();
 
   if (cmd_gegl_swap)
@@ -499,20 +514,6 @@ gegl_post_parse_hook (GOptionContext *context,
   if (cmd_gegl_queue_limit)
     g_object_set (config, "queue-limit", cmd_gegl_queue_limit, NULL);
 
-#ifdef GEGL_ENABLE_DEBUG
-  {
-    const char *env_string;
-    env_string = g_getenv ("GEGL_DEBUG");
-    if (env_string != NULL)
-      {
-        gegl_debug_flags =
-          g_parse_debug_string (env_string,
-                                gegl_debug_keys,
-                                G_N_ELEMENTS (gegl_debug_keys));
-        env_string = NULL;
-      }
-  }
-#endif /* GEGL_ENABLE_DEBUG */
 
   time = gegl_ticks ();
 



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