diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 5d6df6c2bd..06a2118f03 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -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; diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index 6daa15f64e..c843970739 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -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; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 010acbe219..eaf506b019 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -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) { - glDebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL); - glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); + 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 // **************************************************************** diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index f0af677130..bbc3601e97 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -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);