From 6d31124d3a0c70bcb71a3b4a318b69708396a30a Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 8 May 2015 09:48:09 +0200 Subject: [PATCH] gsdx-debug: only enabled advance gl debugging on linux It will avoid some crash on windows for driver that doesn't support the extension. Make debug support mandatory for debug build on linux. --- plugins/GSdx/GSWnd.cpp | 11 ++++++++--- plugins/GSdx/stdafx.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index ff34804258..5fbbc4f970 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -107,9 +107,14 @@ void GSWndGL::PopulateGlFunction() // GL4.3 *(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true); *(void**)&(gl_InvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true); - *(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", true); - *(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", true); - *(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true); +#if defined(__linux__) && defined(ENABLE_OGL_DEBUG) + bool debug_optional = false; +#else + bool debug_optional = true; +#endif + *(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", debug_optional); + *(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", debug_optional); + *(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", debug_optional); // GL4.4 *(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true); // GL_ARB_bindless_texture (GL5?) diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index ea2e0cec3d..d2da3ff693 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -494,7 +494,7 @@ extern void vmfree(void* ptr, size_t size); #endif // Except apple any sane driver support this extension -#ifdef ENABLE_OGL_DEBUG +#if defined(__linux__) && defined(ENABLE_OGL_DEBUG) #define GL_PUSH(s) gl_PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, s); #define GL_POP(s) gl_PopDebugGroup(); #define GL_INS(s) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, -1, s);