提交 e88632ed 编写于 作者: J jp9000

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.
上级 ca8a9fb5
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册