diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-01-01 14:12:02 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-01-01 14:12:02 -0600 |
| commit | 479d1e56c37e17227bcca2f37f78a5c4ec3a703b (patch) | |
| tree | d05de891457262accab92ab7b71d80e3259e6e4c /Source/Core/VideoBackends/OGL/Render.cpp | |
| parent | 6b88704fd68bf81d70e99206e73ef879b14af20d (diff) | |
| parent | 1ed41672f50c9cfe7aa4ab5aa3b73f7e41029124 (diff) | |
Merge pull request #1783 from degasus/disablelogs
OGL: disable driver warnings fetch
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Render.cpp | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index be3b37c580..5685ed3bb3 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -15,6 +15,7 @@ #include "Common/StringUtil.h" #include "Common/Thread.h" #include "Common/Timer.h" +#include "Common/Logging/LogManager.h" #include "Core/ConfigManager.h" #include "Core/Core.h" @@ -479,6 +480,7 @@ Renderer::Renderer() g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading"); g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310; g_ogl_config.bSupportViewportFloat = GLExtensions::Supports("GL_ARB_viewport_array"); + g_ogl_config.bSupportsDebug = GLExtensions::Supports("GL_KHR_debug") || GLExtensions::Supports("GL_ARB_debug_output"); if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3) { @@ -527,17 +529,22 @@ Renderer::Renderer() g_ogl_config.bSupportsAEP = false; } - if (GLExtensions::Supports("GL_KHR_debug")) + if (g_ogl_config.bSupportsDebug) { - glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); - glDebugMessageCallback( ErrorCallback, nullptr ); - glEnable( GL_DEBUG_OUTPUT ); - } - else if (GLExtensions::Supports("GL_ARB_debug_output")) - { - glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); - glDebugMessageCallbackARB( ErrorCallback, nullptr ); - glEnable( GL_DEBUG_OUTPUT ); + if (GLExtensions::Supports("GL_KHR_debug")) + { + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); + glDebugMessageCallback(ErrorCallback, nullptr); + } + else + { + glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); + glDebugMessageCallbackARB(ErrorCallback, nullptr); + } + if (LogManager::GetInstance()->IsEnabled(LogTypes::VIDEO, LogTypes::LERROR)) + glEnable(GL_DEBUG_OUTPUT); + else + glDisable(GL_DEBUG_OUTPUT); } int samples; @@ -1418,6 +1425,14 @@ static void DumpFrame(const std::vector<u8>& data, int w, int h) // This function has the final picture. We adjust the aspect ratio here. void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma) { + if (g_ogl_config.bSupportsDebug) + { + if (LogManager::GetInstance()->IsEnabled(LogTypes::VIDEO, LogTypes::LERROR)) + glEnable(GL_DEBUG_OUTPUT); + else + glDisable(GL_DEBUG_OUTPUT); + } + static int w = 0, h = 0; if (g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) { |
