Merge pull request #1783 from degasus/disablelogs

OGL: disable driver warnings fetch
This commit is contained in:
Ryan Houdek 2015-01-01 14:12:02 -06:00
commit 479d1e56c3
3 changed files with 28 additions and 12 deletions

View File

@ -111,9 +111,9 @@ public:
m_Log[type]->SetEnable(enable); m_Log[type]->SetEnable(enable);
} }
bool IsEnabled(LogTypes::LOG_TYPE type) const bool IsEnabled(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level = LogTypes::LNOTICE) const
{ {
return m_Log[type]->IsEnabled(); return m_Log[type]->IsEnabled() && m_Log[type]->GetLevel() >= level;
} }
std::string GetShortName(LogTypes::LOG_TYPE type) const std::string GetShortName(LogTypes::LOG_TYPE type) const

View File

@ -15,6 +15,7 @@
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Common/Timer.h" #include "Common/Timer.h"
#include "Common/Logging/LogManager.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
@ -479,6 +480,7 @@ Renderer::Renderer()
g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading"); g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading");
g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310; g_ogl_config.bSupportOGL31 = GLExtensions::Version() >= 310;
g_ogl_config.bSupportViewportFloat = GLExtensions::Supports("GL_ARB_viewport_array"); 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) if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
{ {
@ -527,17 +529,22 @@ Renderer::Renderer()
g_ogl_config.bSupportsAEP = false; g_ogl_config.bSupportsAEP = false;
} }
if (g_ogl_config.bSupportsDebug)
{
if (GLExtensions::Supports("GL_KHR_debug")) if (GLExtensions::Supports("GL_KHR_debug"))
{ {
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true);
glDebugMessageCallback(ErrorCallback, nullptr); glDebugMessageCallback(ErrorCallback, nullptr);
glEnable( GL_DEBUG_OUTPUT );
} }
else if (GLExtensions::Supports("GL_ARB_debug_output")) else
{ {
glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true); glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, true);
glDebugMessageCallbackARB(ErrorCallback, nullptr); glDebugMessageCallbackARB(ErrorCallback, nullptr);
}
if (LogManager::GetInstance()->IsEnabled(LogTypes::VIDEO, LogTypes::LERROR))
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
else
glDisable(GL_DEBUG_OUTPUT);
} }
int samples; 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. // 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) 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; static int w = 0, h = 0;
if (g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) if (g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight)
{ {

View File

@ -31,6 +31,7 @@ struct VideoConfig
bool bSupportOGL31; bool bSupportOGL31;
bool bSupportViewportFloat; bool bSupportViewportFloat;
bool bSupportsAEP; bool bSupportsAEP;
bool bSupportsDebug;
const char* gl_vendor; const char* gl_vendor;
const char* gl_renderer; const char* gl_renderer;