[Bf-blender-cvs] [64b87737d6a] tmp-worbench-rewrite2-optimizations: Allow disabling gpu logs when --gpu-debug is enabled (for profiling)
Miguel Pozo
noreply at git.blender.org
Sun Jan 1 15:39:55 CET 2023
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] = "";
More information about the Bf-blender-cvs
mailing list