Commit: 64b87737d6ad6eefddb35e458c6914aed5ad5c22
Author: Miguel Pozo
Date:   Fri Dec 30 19:12:37 2022 +0100
Branches: tmp-worbench-rewrite2-optimizations
https://developer.blender.org/rB64b87737d6ad6eefddb35e458c6914aed5ad5c22

Allow disabling gpu logs when --gpu-debug is enabled (for profiling)

===================================================================

M       source/blender/gpu/opengl/gl_debug.cc

===================================================================

diff --git a/source/blender/gpu/opengl/gl_debug.cc 
b/source/blender/gpu/opengl/gl_debug.cc
index 5c23286c166..ea9ca0ba115 100644
--- a/source/blender/gpu/opengl/gl_debug.cc
+++ b/source/blender/gpu/opengl/gl_debug.cc
@@ -80,7 +80,7 @@ static void APIENTRY debug_callback(GLenum /*source*/,
   const bool use_color = CLG_color_support_get(&LOG);
 
   if (ELEM(severity, GL_DEBUG_SEVERITY_LOW, GL_DEBUG_SEVERITY_NOTIFICATION)) {
-    if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level >= 
CLG_SEVERITY_INFO)) {
+    if ((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level <= 
CLG_SEVERITY_INFO)) {
       const char *format = use_color ? "\033[2m%s\033[0m" : "%s";
       CLG_logf(LOG.type, CLG_SEVERITY_INFO, "Notification", "", format, 
message);
     }
@@ -131,6 +131,10 @@ static void APIENTRY debug_callback(GLenum /*source*/,
 
 void init_gl_callbacks()
 {
+  if (G.log.level >= CLG_SEVERITY_LEN) {
+    return;
+  }
+
   CLOG_ENSURE(&LOG);
 
   char msg[256] = "";

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to