gsdx-ogl: use only core debug extension

There are 2 extensions GL_ARB_debug_output (promoted from amd extension)
and GL_KHR_debug (the core extension, promoted from GL_ARB_debug_output)

As we use the callback we could drop the manual query of errors.
And save us the load of the GL_ARB_debug_output extension function pointer.
This commit is contained in:
Gregory Hainaut 2019-01-30 12:50:54 +01:00
parent cd333c2c94
commit 8cd6f4375e
3 changed files with 1 additions and 38 deletions

View File

@ -202,7 +202,7 @@ typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level,
// #define ENABLE_GL_ARB_bindless_texture 1 // #define ENABLE_GL_ARB_bindless_texture 1
// #define ENABLE_GL_ARB_cl_event 1 // #define ENABLE_GL_ARB_cl_event 1
// #define ENABLE_GL_ARB_compute_variable_group_size 1 // #define ENABLE_GL_ARB_compute_variable_group_size 1
#define ENABLE_GL_ARB_debug_output 1 // #define ENABLE_GL_ARB_debug_output 1
// #define ENABLE_GL_ARB_draw_buffers_blend 1 // #define ENABLE_GL_ARB_draw_buffers_blend 1
// #define ENABLE_GL_ARB_draw_instanced 1 // #define ENABLE_GL_ARB_draw_instanced 1
// #define ENABLE_GL_ARB_geometry_shader4 1 // #define ENABLE_GL_ARB_geometry_shader4 1

View File

@ -149,10 +149,6 @@ GSDeviceOGL::~GSDeviceOGL()
// Must be done after the destruction of all shader/program objects // Must be done after the destruction of all shader/program objects
delete m_shader; delete m_shader;
m_shader = NULL; m_shader = NULL;
// Purge any pending message to reduce noise in Valgrind (potential memory leak
// in Mesa driver that doesn't free internal buffer when the context is destroyed)
CheckDebugLog();
} }
void GSDeviceOGL::GenerateProfilerData() void GSDeviceOGL::GenerateProfilerData()
@ -631,10 +627,6 @@ void GSDeviceOGL::SetVSync(int vsync)
void GSDeviceOGL::Flip() void GSDeviceOGL::Flip()
{ {
#ifdef ENABLE_OGL_DEBUG
CheckDebugLog();
#endif
m_wnd->Flip(); m_wnd->Flip();
if (GLLoader::in_replayer) { if (GLLoader::in_replayer) {
@ -1891,34 +1883,6 @@ void GSDeviceOGL::SetupOM(OMDepthStencilSelector dssel)
OMSetDepthStencilState(m_om_dss[dssel]); OMSetDepthStencilState(m_om_dss[dssel]);
} }
void GSDeviceOGL::CheckDebugLog()
{
if (!m_debug_gl_call) return;
unsigned int count = 16; // max. num. of messages that will be read from the log
int bufsize = 2048;
unsigned int sources[16] = {};
unsigned int types[16] = {};
unsigned int ids[16] = {};
unsigned int severities[16] = {};
int lengths[16] = {};
char* messageLog = new char[bufsize];
unsigned int retVal = glGetDebugMessageLogARB(count, bufsize, sources, types, ids, severities, lengths, messageLog);
if(retVal > 0)
{
unsigned int pos = 0;
for(unsigned int i=0; i<retVal; i++)
{
DebugOutputToFile(sources[i], types[i], ids[i], severities[i], lengths[i], &messageLog[pos], NULL);
pos += lengths[i];
}
}
delete[] messageLog;
}
// Note: used as a callback of DebugMessageCallback. Don't change the signature // Note: used as a callback of DebugMessageCallback. Don't change the signature
void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id, GLenum gl_severity, GLsizei gl_length, const GLchar *gl_message, const void* userParam) void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id, GLenum gl_severity, GLsizei gl_length, const GLchar *gl_message, const void* userParam)
{ {

View File

@ -513,7 +513,6 @@ public:
void GenerateProfilerData(); void GenerateProfilerData();
static void CheckDebugLog();
// Used by OpenGL, so the same calling convention is required. // Used by OpenGL, so the same calling convention is required.
static void APIENTRY DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id, GLenum gl_severity, GLsizei gl_length, const GLchar *gl_message, const void* userParam); static void APIENTRY DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id, GLenum gl_severity, GLsizei gl_length, const GLchar *gl_message, const void* userParam);