[gimp/wip/schumaml/gimp-cmdline-disable-opencl] app: add a --no-gpu-accel command line parameter to disable GPU acceleration



commit 5f7577075b4eda3cb90c9749f0210833a67d8754
Author: Michael Schumacher <schumaml gmx de>
Date:   Sat Dec 21 19:44:01 2019 +0100

    app: add a --no-gpu-accel command line parameter to disable GPU acceleration
    
    The purpose of this parameter is to be able to start GIMP even if e.g. OpenCL bugs cause crashes 
otherwise.
    
    The parameter if not functional yet and does not disable anything yet.

 app/app.c       | 2 ++
 app/app.h       | 1 +
 app/core/gimp.c | 1 +
 app/core/gimp.h | 2 ++
 app/main.c      | 7 +++++++
 app/tests.c     | 4 ++--
 6 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/app/app.c b/app/app.c
index 81e6bdc503..d05824d7cb 100644
--- a/app/app.c
+++ b/app/app.c
@@ -173,6 +173,7 @@ app_run (const gchar         *full_prog_name,
          gboolean             be_verbose,
          gboolean             use_shm,
          gboolean             use_cpu_accel,
+         gboolean             use_gpu_accel,
          gboolean             console_messages,
          gboolean             use_debug_handler,
          gboolean             show_playground,
@@ -244,6 +245,7 @@ app_run (const gchar         *full_prog_name,
                    no_interface,
                    use_shm,
                    use_cpu_accel,
+                   use_gpu_accel,
                    console_messages,
                    show_playground,
                    show_debug_menu,
diff --git a/app/app.h b/app/app.h
index 1ec9447210..87deed9afe 100644
--- a/app/app.h
+++ b/app/app.h
@@ -45,6 +45,7 @@ void  app_run       (const gchar         *full_prog_name,
                      gboolean             be_verbose,
                      gboolean             use_shm,
                      gboolean             use_cpu_accel,
+                     gboolean             use_gpu_accel,
                      gboolean             console_messages,
                      gboolean             use_debug_handler,
                      gboolean             show_playground,
diff --git a/app/core/gimp.c b/app/core/gimp.c
index 6192f6fea5..3ad134383c 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -567,6 +567,7 @@ gimp_new (const gchar       *name,
           gboolean           no_interface,
           gboolean           use_shm,
           gboolean           use_cpu_accel,
+          gboolean           use_gpu_accel,
           gboolean           console_messages,
           gboolean           show_playground,
           gboolean           show_debug_menu,
diff --git a/app/core/gimp.h b/app/core/gimp.h
index bbf5a9ee6d..16f52c796d 100644
--- a/app/core/gimp.h
+++ b/app/core/gimp.h
@@ -50,6 +50,7 @@ struct _Gimp
   gboolean                show_gui;
   gboolean                use_shm;
   gboolean                use_cpu_accel;
+  gboolean                use_gpu_accel;
   GimpMessageHandlerType  message_handler;
   gboolean                console_messages;
   gboolean                show_playground;
@@ -159,6 +160,7 @@ Gimp         * gimp_new                    (const gchar         *name,
                                             gboolean             no_interface,
                                             gboolean             use_shm,
                                             gboolean             use_cpu_accel,
+                                            gboolean             use_gpu_accel,
                                             gboolean             console_messages,
                                             gboolean             show_playground,
                                             gboolean             show_debug_menu,
diff --git a/app/main.c b/app/main.c
index 0d4e257b07..d3734a9584 100644
--- a/app/main.c
+++ b/app/main.c
@@ -141,6 +141,7 @@ static gboolean            use_shm           = TRUE;
 static gboolean            use_shm           = FALSE;
 #endif
 static gboolean            use_cpu_accel     = TRUE;
+static gboolean            use_gpu_accel     = TRUE;
 static gboolean            console_messages  = FALSE;
 static gboolean            use_debug_handler = FALSE;
 
@@ -213,6 +214,11 @@ static const GOptionEntry main_entries[] =
     G_OPTION_ARG_NONE, &use_cpu_accel,
     N_("Do not use special CPU acceleration functions"), NULL
   },
+  {
+    "no-gpu-accel", 0, G_OPTION_FLAG_REVERSE,
+    G_OPTION_ARG_NONE, &use_gpu_accel,
+    N_("Do not use special GPU acceleration functions"), NULL
+  },
   {
     "session", 0, 0,
     G_OPTION_ARG_FILENAME, &session_name,
@@ -648,6 +654,7 @@ main (int    argc,
            be_verbose,
            use_shm,
            use_cpu_accel,
+           use_gpu_accel,
            console_messages,
            use_debug_handler,
            show_playground,
diff --git a/app/tests.c b/app/tests.c
index f3329f0878..79c9b8aa01 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -69,7 +69,7 @@ gimp_init_for_testing (void)
   gegl_init (NULL, NULL);
 
   gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, TRUE,
-                   FALSE, FALSE, TRUE, FALSE, FALSE,
+                   FALSE, FALSE, TRUE, TRUE, FALSE, FALSE,
                    GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
 
   gimp_load_config (gimp, NULL, NULL);
@@ -131,7 +131,7 @@ gimp_init_for_gui_testing_internal (gboolean  show_gui,
 
   /* from app_run() */
   gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, !show_gui,
-                   FALSE, FALSE, TRUE, FALSE, FALSE,
+                   FALSE, FALSE, TRUE, TRUE, FALSE, FALSE,
                    GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_OFF);
 
   gimp_set_show_gui (gimp, show_gui);


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