--gl_debug flag.
This commit is contained in:
parent
1844bcf094
commit
4ffaac6d6f
|
@ -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);
|
||||
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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> 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue