gsdx-debug: support correct logging on mesa

By default low severity message were disabled. (thanks to be open source)
This commit is contained in:
Gregory Hainaut 2015-10-24 14:05:00 +02:00
parent c26f2cc80a
commit 9ba949c2d9
4 changed files with 14 additions and 5 deletions

View File

@ -107,6 +107,7 @@ PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage = NUL
PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup = NULL;
PFNGLPOPDEBUGGROUPPROC glPopDebugGroup = NULL;
PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert = NULL;
PFNGLDEBUGMESSAGECONTROLPROC glDebugMessageControl = NULL;
// GL4.2
PFNGLBINDIMAGETEXTUREPROC glBindImageTexture = NULL;
PFNGLMEMORYBARRIERPROC glMemoryBarrier = NULL;

View File

@ -275,6 +275,7 @@ extern PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
extern PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage;
extern PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup;
extern PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert;
extern PFNGLDEBUGMESSAGECONTROLPROC glDebugMessageControl;
// GL4.4
extern PFNGLCLEARTEXIMAGEPROC glClearTexImage;
extern PFNGLBUFFERSTORAGEPROC glBufferStorage;

View File

@ -191,20 +191,26 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
if (!GLLoader::check_gl_supported_extension()) return false;
}
GL_PUSH("GSDeviceOGL::Create");
m_window = wnd;
// ****************************************************************
// Debug helper
// ****************************************************************
#ifdef ENABLE_OGL_DEBUG
if (theApp.GetConfig("debug_opengl", 0) && glDebugMessageCallback) {
if (theApp.GetConfig("debug_opengl", 0)) {
if (glDebugMessageCallback) {
glDebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
}
if (glDebugMessageControl) {
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, true);
}
}
#endif
// WARNING it must be done after the control setup (at least on MESA)
GL_PUSH("GSDeviceOGL::Create");
// ****************************************************************
// Various object
// ****************************************************************

View File

@ -114,6 +114,7 @@ void GSWndGL::PopulateGlFunction()
*(void**)&(glPushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
*(void**)&(glPopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
*(void**)&(glDebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
*(void**)&(glDebugMessageControl) = GetProcAddress("glDebugMessageControl", true);
// GL4.4
*(void**)&(glClearTexImage) = GetProcAddress("glClearTexImage", true);
*(void**)&(glBufferStorage) = GetProcAddress("glBufferStorage", true);