mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: require GL_KHR_debug
Will reduce the slowdown on debug build
This commit is contained in:
parent
9598417f42
commit
8217c717f6
|
@ -178,6 +178,7 @@ namespace GLLoader {
|
||||||
bool found_GL_ARB_shading_language_420pack = false;
|
bool found_GL_ARB_shading_language_420pack = false;
|
||||||
bool found_GL_ARB_texture_barrier = false;
|
bool found_GL_ARB_texture_barrier = false;
|
||||||
bool found_GL_ARB_texture_storage = false;
|
bool found_GL_ARB_texture_storage = false;
|
||||||
|
bool found_GL_KHR_debug = false;
|
||||||
|
|
||||||
static bool status_and_override(bool& found, const std::string& name, bool mandatory = false)
|
static bool status_and_override(bool& found, const std::string& name, bool mandatory = false)
|
||||||
{
|
{
|
||||||
|
@ -268,6 +269,7 @@ namespace GLLoader {
|
||||||
if (ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
|
if (ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
|
||||||
// GL4.3
|
// GL4.3
|
||||||
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
|
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
|
||||||
|
if (ext.compare("GL_KHR_debug") == 0) found_GL_KHR_debug = true;
|
||||||
// GL4.4
|
// GL4.4
|
||||||
if (ext.compare("GL_ARB_buffer_storage") == 0) found_GL_ARB_buffer_storage = true;
|
if (ext.compare("GL_ARB_buffer_storage") == 0) found_GL_ARB_buffer_storage = true;
|
||||||
if (ext.compare("GL_ARB_clear_texture") == 0) found_GL_ARB_clear_texture = true;
|
if (ext.compare("GL_ARB_clear_texture") == 0) found_GL_ARB_clear_texture = true;
|
||||||
|
@ -296,6 +298,7 @@ namespace GLLoader {
|
||||||
status &= status_and_override(found_GL_ARB_texture_storage, "GL_ARB_texture_storage", true);
|
status &= status_and_override(found_GL_ARB_texture_storage, "GL_ARB_texture_storage", true);
|
||||||
// GL4.3
|
// GL4.3
|
||||||
status &= status_and_override(found_GL_ARB_copy_image, "GL_ARB_copy_image", true);
|
status &= status_and_override(found_GL_ARB_copy_image, "GL_ARB_copy_image", true);
|
||||||
|
status &= status_and_override(found_GL_KHR_debug, "GL_KHR_debug", true);
|
||||||
// GL4.4
|
// GL4.4
|
||||||
status &= status_and_override(found_GL_ARB_buffer_storage,"GL_ARB_buffer_storage", true);
|
status &= status_and_override(found_GL_ARB_buffer_storage,"GL_ARB_buffer_storage", true);
|
||||||
status &= status_and_override(found_GL_ARB_clear_texture,"GL_ARB_clear_texture");
|
status &= status_and_override(found_GL_ARB_clear_texture,"GL_ARB_clear_texture");
|
||||||
|
|
|
@ -182,17 +182,14 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
#ifdef ENABLE_OGL_DEBUG
|
#ifdef ENABLE_OGL_DEBUG
|
||||||
if (theApp.GetConfig("debug_opengl", 0)) {
|
if (theApp.GetConfig("debug_opengl", 0)) {
|
||||||
if (glDebugMessageCallback) {
|
|
||||||
glDebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL);
|
glDebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL);
|
||||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||||
}
|
|
||||||
if (glDebugMessageControl) {
|
|
||||||
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, true);
|
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, true);
|
||||||
// Useless info message on Nvidia driver
|
// Useless info message on Nvidia driver
|
||||||
GLuint ids[] = {0x20004};
|
GLuint ids[] = {0x20004};
|
||||||
glDebugMessageControl(GL_DEBUG_SOURCE_API_ARB, GL_DEBUG_TYPE_OTHER_ARB, GL_DONT_CARE, countof(ids), ids, false);
|
glDebugMessageControl(GL_DEBUG_SOURCE_API_ARB, GL_DEBUG_TYPE_OTHER_ARB, GL_DONT_CARE, countof(ids), ids, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// WARNING it must be done after the control setup (at least on MESA)
|
// WARNING it must be done after the control setup (at least on MESA)
|
||||||
|
|
|
@ -63,7 +63,6 @@ void GSWndGL::PopulateGlFunction()
|
||||||
GL_EXT_LOAD(glGenVertexArrays);
|
GL_EXT_LOAD(glGenVertexArrays);
|
||||||
GL_EXT_LOAD(glGetBufferParameteriv);
|
GL_EXT_LOAD(glGetBufferParameteriv);
|
||||||
GL_EXT_LOAD(glGetDebugMessageLogARB);
|
GL_EXT_LOAD(glGetDebugMessageLogARB);
|
||||||
GL_EXT_LOAD_OPT(glDebugMessageCallback);
|
|
||||||
GL_EXT_LOAD(glGetProgramInfoLog);
|
GL_EXT_LOAD(glGetProgramInfoLog);
|
||||||
GL_EXT_LOAD(glGetProgramiv);
|
GL_EXT_LOAD(glGetProgramiv);
|
||||||
GL_EXT_LOAD(glGetShaderiv);
|
GL_EXT_LOAD(glGetShaderiv);
|
||||||
|
@ -118,10 +117,11 @@ void GSWndGL::PopulateGlFunction()
|
||||||
// GL4.3
|
// GL4.3
|
||||||
GL_EXT_LOAD(glCopyImageSubData);
|
GL_EXT_LOAD(glCopyImageSubData);
|
||||||
GL_EXT_LOAD_OPT(glInvalidateTexImage);
|
GL_EXT_LOAD_OPT(glInvalidateTexImage);
|
||||||
GL_EXT_LOAD_OPT(glPushDebugGroup);
|
GL_EXT_LOAD(glPushDebugGroup);
|
||||||
GL_EXT_LOAD_OPT(glPopDebugGroup);
|
GL_EXT_LOAD(glPopDebugGroup);
|
||||||
GL_EXT_LOAD_OPT(glDebugMessageInsert);
|
GL_EXT_LOAD(glDebugMessageInsert);
|
||||||
GL_EXT_LOAD_OPT(glDebugMessageControl);
|
GL_EXT_LOAD(glDebugMessageControl);
|
||||||
|
GL_EXT_LOAD(glDebugMessageCallback);
|
||||||
// GL4.4
|
// GL4.4
|
||||||
GL_EXT_LOAD_OPT(glClearTexImage);
|
GL_EXT_LOAD_OPT(glClearTexImage);
|
||||||
GL_EXT_LOAD(glBufferStorage);
|
GL_EXT_LOAD(glBufferStorage);
|
||||||
|
|
|
@ -425,7 +425,7 @@ extern void vmfree(void* ptr, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GL_INSERT(type, code, sev, ...) \
|
#define GL_INSERT(type, code, sev, ...) \
|
||||||
do if (glDebugMessageInsert) glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, type, code, sev, -1, format(__VA_ARGS__).c_str()); while(0);
|
do glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, type, code, sev, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||||
|
|
||||||
// Except apple any sane driver support this extension
|
// Except apple any sane driver support this extension
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
|
@ -435,8 +435,8 @@ extern void vmfree(void* ptr, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_OGL_DEBUG)
|
#if defined(ENABLE_OGL_DEBUG)
|
||||||
#define GL_PUSH(...) do if (glPushDebugGroup) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str()); while(0);
|
#define GL_PUSH(...) do glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||||
#define GL_POP() do if (glPopDebugGroup) glPopDebugGroup(); while(0);
|
#define GL_POP() do glPopDebugGroup(); while(0);
|
||||||
#define GL_INS(...) GL_INSERT(GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, __VA_ARGS__)
|
#define GL_INS(...) GL_INSERT(GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, __VA_ARGS__)
|
||||||
#define GL_PERF(...) GL_INSERT(GL_DEBUG_TYPE_PERFORMANCE, 0xFEE1, GL_DEBUG_SEVERITY_NOTIFICATION, __VA_ARGS__)
|
#define GL_PERF(...) GL_INSERT(GL_DEBUG_TYPE_PERFORMANCE, 0xFEE1, GL_DEBUG_SEVERITY_NOTIFICATION, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue