mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: protect the trace with if statement
And mark the function as optional
This commit is contained in:
parent
a639634769
commit
009dd103ae
|
@ -107,14 +107,9 @@ void GSWndGL::PopulateGlFunction()
|
|||
// GL4.3
|
||||
*(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
||||
*(void**)&(gl_InvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
|
||||
#if defined(__linux__) && defined(ENABLE_OGL_DEBUG)
|
||||
bool debug_optional = false;
|
||||
#else
|
||||
bool debug_optional = true;
|
||||
#endif
|
||||
*(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", debug_optional);
|
||||
*(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", debug_optional);
|
||||
*(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", debug_optional);
|
||||
*(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
|
||||
*(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
|
||||
*(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
|
||||
// GL4.4
|
||||
*(void**)&(gl_ClearTexImage) = GetProcAddress("glClearTexImage", true);
|
||||
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
|
||||
|
|
|
@ -493,18 +493,21 @@ extern void vmfree(void* ptr, size_t size);
|
|||
|
||||
#endif
|
||||
|
||||
#define GL_INSERT(type, code, sev, ...) \
|
||||
do if (gl_DebugMessageInsert) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, type, code, sev, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
|
||||
// Except apple any sane driver support this extension
|
||||
#if defined(__linux__) && defined(_DEBUG)
|
||||
#define GL_CACHE(...) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 0xFEAD, GL_DEBUG_SEVERITY_NOTIFICATION, -1, format(__VA_ARGS__).c_str());
|
||||
#define GL_CACHE(...) GL_INSERT(GL_DEBUG_TYPE_OTHER, 0xFEAD, GL_DEBUG_SEVERITY_NOTIFICATION, __VA_ARGS__)
|
||||
#else
|
||||
#define GL_CACHE(...) (0);
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) && defined(ENABLE_OGL_DEBUG)
|
||||
#define GL_PUSH(...) gl_PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str());
|
||||
#define GL_POP() gl_PopDebugGroup();
|
||||
#define GL_INS(...) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, -1, format(__VA_ARGS__).c_str());
|
||||
#define GL_PERF(...) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_PERFORMANCE, 0xFEE1, GL_DEBUG_SEVERITY_MEDIUM, -1, format(__VA_ARGS__).c_str());
|
||||
#define GL_PUSH(...) do if (gl_PushDebugGroup) gl_PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
#define GL_POP() do if (gl_PopDebugGroup) gl_PopDebugGroup(); while(0);
|
||||
#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_MEDIUM, __VA_ARGS__)
|
||||
#else
|
||||
#define GL_PUSH(...) (0);
|
||||
#define GL_POP() (0);
|
||||
|
|
Loading…
Reference in New Issue