diff --git a/src/xenia/gpu/gl4/gl4_gpu-private.h b/src/xenia/gpu/gl4/gl4_gpu-private.h index 3e365622c..1306cda2b 100644 --- a/src/xenia/gpu/gl4/gl4_gpu-private.h +++ b/src/xenia/gpu/gl4/gl4_gpu-private.h @@ -17,6 +17,7 @@ DECLARE_bool(thread_safe_gl); DECLARE_bool(disable_gl_context_reset); +DECLARE_bool(gl_debug); DECLARE_bool(gl_debug_output); DECLARE_bool(gl_debug_output_synchronous); diff --git a/src/xenia/gpu/gl4/gl4_gpu.cc b/src/xenia/gpu/gl4/gl4_gpu.cc index 164fedaa1..0ace4447f 100644 --- a/src/xenia/gpu/gl4/gl4_gpu.cc +++ b/src/xenia/gpu/gl4/gl4_gpu.cc @@ -19,6 +19,7 @@ DEFINE_bool(disable_gl_context_reset, false, "Do not aggressively reset the GL context (helps with capture " "programs such as OBS or FRAPS)."); +DEFINE_bool(gl_debug, false, "Enable OpenGL debug validation layer."); DEFINE_bool(gl_debug_output, false, "Dump ARB_debug_output to stderr."); DEFINE_bool(gl_debug_output_synchronous, true, "ARB_debug_output will synchronize to be thread safe."); diff --git a/src/xenia/gpu/gl4/gl_context.cc b/src/xenia/gpu/gl4/gl_context.cc index 7792001c3..6448bcd33 100644 --- a/src/xenia/gpu/gl4/gl_context.cc +++ b/src/xenia/gpu/gl4/gl_context.cc @@ -94,9 +94,9 @@ bool GLContext::Initialize(HWND hwnd) { } int context_flags = 0; -#if DEBUG - context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; -#endif // DEBUG + if (FLAGS_gl_debug) { + context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; + } int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, // WGL_CONTEXT_MINOR_VERSION_ARB, 5, // @@ -150,9 +150,9 @@ std::unique_ptr GLContext::CreateShared() { int context_flags = 0; // int profile = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; int profile = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; -#if DEBUG - context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; -#endif // DEBUG + if (FLAGS_gl_debug) { + context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB; + } int attrib_list[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 4, // WGL_CONTEXT_MINOR_VERSION_ARB, 5, // @@ -290,7 +290,7 @@ GLContext::DebugMessageThunk(GLenum source, GLenum type, GLuint id, } void GLContext::SetupDebugging() { - if (!FLAGS_gl_debug_output) { + if (!FLAGS_gl_debug || !FLAGS_gl_debug_output) { return; }