gsdx-ogl-debug: insert error message in GL stream

This way, you can see your message in the GL debugger
This commit is contained in:
Gregory Hainaut 2015-05-08 00:16:31 +02:00
parent 544a923e32
commit d6448183d7
7 changed files with 13 additions and 0 deletions

View File

@ -102,6 +102,7 @@ PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NU
PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage = NULL;
PFNGLPUSHDEBUGGROUPPROC gl_PushDebugGroup = NULL;
PFNGLPOPDEBUGGROUPPROC gl_PopDebugGroup = NULL;
PFNGLDEBUGMESSAGEINSERTPROC gl_DebugMessageInsert = NULL;
// GL4.2
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;

View File

@ -290,6 +290,7 @@ extern PFNGLPOPDEBUGGROUPPROC gl_PopDebugGroup;
extern PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData;
extern PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage;
extern PFNGLPUSHDEBUGGROUPPROC gl_PushDebugGroup;
extern PFNGLDEBUGMESSAGEINSERTPROC gl_DebugMessageInsert;
// GL4.4
extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage;
// GL_ARB_bindless_texture (GL5?)

View File

@ -524,6 +524,8 @@ GLuint GSDeviceOGL::CreateSampler(PSSamplerSelector sel)
GLuint GSDeviceOGL::CreateSampler(bool bilinear, bool tau, bool tav)
{
GL_PUSH("Create Sampler");
GLuint sampler;
gl_GenSamplers(1, &sampler);
if (bilinear) {
@ -554,6 +556,7 @@ GLuint GSDeviceOGL::CreateSampler(bool bilinear, bool tau, bool tav)
gl_SamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)anisotropy);
}
GL_POP();
return sampler;
}

View File

@ -92,6 +92,7 @@ public:
if (m_enable) {
#ifdef ENABLE_OGL_DEBUG
if (m_bogus) {
GL_INS("!!! Bogus blending effect !!!");
fprintf(stderr, "Bogus blending effect used : %s\n", (m_bogus == 1) ? "impossible effect" : "clear effect");
}
#endif

View File

@ -233,6 +233,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
//ASSERT(0);
#ifdef ENABLE_OGL_DEBUG
fprintf(stderr, "env PABE not supported\n");
GL_INS("!!! ENV PABE not supported !!!");
#endif
}
}
@ -329,6 +330,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// Fixme :Following conditional fixes some dialog frame in Wild Arms 3, but may not be what was intended.
if (m_vt.m_min.p.z > 0xffffff)
{
GL_INS("Bad Z size on 24 bits buffers")
vs_sel.bppz = 1;
om_dssel.ztst = ZTST_ALWAYS;
}
@ -342,6 +344,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// Fixme : Same as above, I guess.
if (m_vt.m_min.p.z > 0xffff)
{
GL_INS("Bad Z size on 16 bits buffers")
vs_sel.bppz = 2;
om_dssel.ztst = ZTST_ALWAYS;
}

View File

@ -109,6 +109,7 @@ void GSWndGL::PopulateGlFunction()
*(void**)&(gl_InvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
*(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
*(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
*(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
// GL4.4
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
// GL_ARB_bindless_texture (GL5?)

View File

@ -497,9 +497,12 @@ extern void vmfree(void* ptr, size_t size);
#ifdef ENABLE_OGL_DEBUG
#define GL_PUSH(s) gl_PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, s);
#define GL_POP(s) gl_PopDebugGroup();
#define GL_INS(s) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, -1, s);
#else
#define GL_PUSH(s) (0);
#define GL_POP() (0);
#define GL_INS() (0);
#endif
// Helper path to dump texture