libobs-opengl: Don't display unimportant messages
The glDebugMessageCallback function will set a callback that will relay all messages coming from the driver (on supported drivers at least). For nvidia, sometimes there are a lot of irrelevant messages, which is nice depending on the type of application you're writing. I actually at first thought these messages were important, but it turns out that they're almost always irrelevant and not actually warnings. Most of the messages at a certain type/severity are mostly for debugging purposes or minor hints about how to maximize performance, so unfortunately there ends up being a lot of pointless spam in the debug output. The particular performance messages are related to optimizations you can get via multithreading, and are optimizations you would expect for games more than for this type of application. They don't really apply for our use cases most of the time. High severity messages however are not omitted regardless of message type. These messages can be enabled again by simply defining the SHOW_ALL_GL_MESSAGES macro.
This commit is contained in:
parent
ca8a9fb5a7
commit
e88632ed73
@ -23,6 +23,8 @@
|
||||
#undef far
|
||||
#undef near
|
||||
|
||||
/* #define SHOW_ALL_GL_MESSAGES */
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
static void APIENTRY gl_debug_proc(
|
||||
@ -34,6 +36,15 @@ static void APIENTRY gl_debug_proc(
|
||||
|
||||
char *source_str, *type_str, *severity_str;
|
||||
|
||||
/* frames can get a bit too much spam with irrelevant/insignificant opengl
|
||||
* debug messages */
|
||||
#ifndef SHOW_ALL_GL_MESSAGES
|
||||
if (type > GL_DEBUG_TYPE_PORTABILITY &&
|
||||
severity != GL_DEBUG_SEVERITY_HIGH) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(source) {
|
||||
case GL_DEBUG_SOURCE_API:
|
||||
source_str = "API"; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user