Split OpenGL errors into a separate logtype from Video errors.

Allows them to be enabled/disabled separately.
This commit is contained in:
Scott Mansell 2015-09-10 18:27:31 +12:00
parent f2771695a2
commit de9310fe70
3 changed files with 9 additions and 7 deletions

View File

@ -58,6 +58,7 @@ enum LOG_TYPE
WII_IPC_WIIMOTE, WII_IPC_WIIMOTE,
WIIMOTE, WIIMOTE,
NETPLAY, NETPLAY,
HOST_GPU,
NUMBER_OF_LOGS // Must be last NUMBER_OF_LOGS // Must be last
}; };

View File

@ -82,6 +82,7 @@ LogManager::LogManager()
m_Log[LogTypes::ACTIONREPLAY] = new LogContainer("ActionReplay", "ActionReplay"); m_Log[LogTypes::ACTIONREPLAY] = new LogContainer("ActionReplay", "ActionReplay");
m_Log[LogTypes::MEMCARD_MANAGER] = new LogContainer("MemCard Manager", "MemCard Manager"); m_Log[LogTypes::MEMCARD_MANAGER] = new LogContainer("MemCard Manager", "MemCard Manager");
m_Log[LogTypes::NETPLAY] = new LogContainer("NETPLAY", "Netplay"); m_Log[LogTypes::NETPLAY] = new LogContainer("NETPLAY", "Netplay");
m_Log[LogTypes::HOST_GPU] = new LogContainer("Host GPU", "Host GPU");
m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX)); m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX));
m_consoleLog = new ConsoleListener(); m_consoleLog = new ConsoleListener();

View File

@ -162,11 +162,11 @@ static void GLAPIENTRY ErrorCallback( GLenum source, GLenum type, GLuint id, GLe
} }
switch (severity) switch (severity)
{ {
case GL_DEBUG_SEVERITY_HIGH_ARB: ERROR_LOG(VIDEO, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break; case GL_DEBUG_SEVERITY_HIGH_ARB: ERROR_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break;
case GL_DEBUG_SEVERITY_MEDIUM_ARB: WARN_LOG(VIDEO, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break; case GL_DEBUG_SEVERITY_MEDIUM_ARB: WARN_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break;
case GL_DEBUG_SEVERITY_LOW_ARB: WARN_LOG(VIDEO, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break; case GL_DEBUG_SEVERITY_LOW_ARB: WARN_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break;
case GL_DEBUG_SEVERITY_NOTIFICATION: DEBUG_LOG(VIDEO, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break; case GL_DEBUG_SEVERITY_NOTIFICATION: DEBUG_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break;
default: ERROR_LOG(VIDEO, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break; default: ERROR_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message); break;
} }
} }
@ -575,7 +575,7 @@ Renderer::Renderer()
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)) if (LogManager::GetInstance()->IsEnabled(LogTypes::HOST_GPU, LogTypes::LERROR))
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
else else
glDisable(GL_DEBUG_OUTPUT); glDisable(GL_DEBUG_OUTPUT);
@ -1436,7 +1436,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
{ {
if (g_ogl_config.bSupportsDebug) if (g_ogl_config.bSupportsDebug)
{ {
if (LogManager::GetInstance()->IsEnabled(LogTypes::VIDEO, LogTypes::LERROR)) if (LogManager::GetInstance()->IsEnabled(LogTypes::HOST_GPU, LogTypes::LERROR))
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
else else
glDisable(GL_DEBUG_OUTPUT); glDisable(GL_DEBUG_OUTPUT);