I have installed OpenGL debug callback and enabled GL_DEBUG_OUTPUT
. The callback looks like this:
void glMsgCallback( GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar* message,
const void* userParam )
{
std::ostringstream os;
os << "GL LOG: type = " << type << ", severity = " << severity << ", message = " << message;
log(os.str());
}
And this is what I get in the log file:
GL LOG: type = 33361, severity = 33387, message = type: 1, local: 0, shared: 0, gpr: 6, inst: 18, bytes: 192
How do I interpret this data? Is there any way to discover which OpenGL function or feature is causing the message? I found out that type 33361 corresponds to GL_DEBUG_TYPE_OTHER
, and severity 33387 stands for GL_DEBUG_SEVERITY_NOTIFICATION
, but I'm oblivious of the rest.
Is there any way to discover which OpenGL function or feature is causing the message?
The debug callback can be called synchronously or asynchronously. See Debug Output - Getting messages Enable synchronously debug output:
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
So you can set a breakpoint in the callback of the debug message and see on the call stack which function is causing the problem.
Furthermore the output can be filtered. See How to use glDebugMessageControl. For example, limit the output to error messages:
glDebugMessageControl(
GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_ERROR, GL_DONT_CARE, 0, NULL, GL_TRUE);