gsdx-debug: more debug message/group

This commit is contained in:
Gregory Hainaut 2015-05-15 15:12:49 +02:00
parent 08291aed0c
commit 84c3592fbe
5 changed files with 36 additions and 6 deletions

View File

@ -106,6 +106,8 @@ void GSDevice::Present(const GSVector4i& r, int shader)
}
}
GL_PUSH("Present");
ClearRenderTarget(m_backbuffer, 0);
if(m_current)
@ -116,6 +118,8 @@ void GSDevice::Present(const GSVector4i& r, int shader)
}
Flip();
GL_POP();
}
void GSDevice::Present(GSTexture* st, GSTexture* dt, const GSVector4& dr, int shader)

View File

@ -75,6 +75,8 @@ GSDeviceOGL::~GSDeviceOGL()
if (m_shader == NULL)
return;
GL_PUSH("GSDeviceOGL destructor");
// Clean vertex buffer state
delete (m_va);
@ -141,6 +143,8 @@ GSDeviceOGL::~GSDeviceOGL()
// Must be done after the destruction of all shader/program objects
delete m_shader;
m_shader = NULL;
GL_POP();
}
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int format)
@ -180,6 +184,8 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
if (!GLLoader::check_gl_supported_extension()) return false;
}
GL_PUSH("GSDeviceOGL::Create");
m_window = wnd;
// ****************************************************************
@ -329,6 +335,8 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
// ****************************************************************
PboPool::Init();
GL_POP();
// ****************************************************************
// Finish window setup and backbuffer
// ****************************************************************
@ -1252,9 +1260,13 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
}
#ifdef _DEBUG
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", type.c_str(), g_draw_count, severity.c_str(), message.c_str());
// Don't spam noisy information on the terminal
if (!(gl_type == GL_DEBUG_TYPE_OTHER_ARB && gl_severity == GL_DEBUG_SEVERITY_NOTIFICATION)) {
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", type.c_str(), g_draw_count, severity.c_str(), message.c_str());
}
#endif
// FIXME move open/close in constructor/destructor
FILE* f = fopen("GSdx_opengl_debug.txt","a");
if(f)
{

View File

@ -116,6 +116,8 @@ bool GSRenderer::Merge(int field)
return false;
}
GL_PUSH("Renderer Merge");
// try to avoid fullscreen blur, could be nice on tv but on a monitor it's like double vision, hurts my eyes (persona 4, guitar hero)
//
// NOTE: probably the technique explained in graphtip.pdf (Antialiasing by Supersampling / 4. Reading Odd/Even Scan Lines Separately with the PCRTC then Blending)
@ -292,6 +294,8 @@ bool GSRenderer::Merge(int field)
}
}
GL_POP();
return true;
}

View File

@ -130,12 +130,12 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
{
#ifdef ENABLE_OGL_DEBUG
if (dst) {
GL_CACHE(format("TC: dst hit: %d (%x)",
GL_CACHE(format("TC: dst hit: %d (0x%x)",
dst->m_texture ? dst->m_texture->GetID() : 0,
TEX0.TBP0
).c_str());
} else {
GL_CACHE(format("TC: src miss (%x)", TEX0.TBP0).c_str());
GL_CACHE(format("TC: src miss (0x%x)", TEX0.TBP0).c_str());
}
#endif
src = CreateSource(TEX0, TEXA, dst);
@ -146,7 +146,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
}
#ifdef ENABLE_OGL_DEBUG
} else {
GL_CACHE(format("TC: src hit: %d (%x)",
GL_CACHE(format("TC: src hit: %d (0x%x)",
src->m_texture ? src->m_texture->GetID() : 0,
TEX0.TBP0
).c_str());
@ -195,6 +195,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
if(dst == NULL)
{
GL_CACHE(format("TC: Lookup Target(%d) %dx%d, miss (0x%x)", type, w, h, bp).c_str());
dst = CreateTarget(TEX0, w, h, type);
if(dst == NULL)
@ -204,6 +206,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
}
else
{
GL_CACHE(format("TC: Lookup Target(%d) %dx%d, hit: %d (0x%x)", type, w, h, dst->m_texture->GetID(), bp).c_str());
dst->Update();
}
@ -271,6 +275,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
{
dst = t;
GL_CACHE(format("TC: Lookup Frame %dx%d, perfect hit: %d (0x%x)", w, h, dst->m_texture->GetID(), bp).c_str());
break;
}
else
@ -279,6 +285,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
if(t->m_TEX0.TBP0 <= bp && bp < t->m_TEX0.TBP0 + 0xe00UL && (!dst || t->m_TEX0.TBP0 >= dst->m_TEX0.TBP0))
{
GL_CACHE(format("TC: Lookup Frame %dx%d, close hit: %d (0x%x, took 0x%x)", w, h, dst->m_texture->GetID(), bp, dst->m_TEX0.TBP0).c_str());
dst = t;
}
}
@ -286,8 +293,11 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
if(dst == NULL)
{
GL_CACHE(format("TC: Lookup Frame %dx%d, miss (0x%x)", w, h, bp).c_str());
dst = CreateTarget(TEX0, w, h, RenderTarget);
if(dst == NULL)
{
return NULL;
@ -1267,7 +1277,7 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s)
{
m_surfaces.erase(s);
GL_CACHE(format("TC: remove texture %d (%x)",
GL_CACHE(format("TC: remove texture %d (0x%x)",
s->m_texture ? s->m_texture->GetID() : 0,
s->m_TEX0.TBP0).c_str());

View File

@ -495,7 +495,7 @@ extern void vmfree(void* ptr, size_t size);
// Except apple any sane driver support this extension
#if defined(__linux__) && defined(_DEBUG)
#define GL_CACHE(s) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0xFEAD, GL_DEBUG_SEVERITY_MEDIUM, -1, s);
#define GL_CACHE(s) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 0xFEAD, GL_DEBUG_SEVERITY_NOTIFICATION, -1, s);
#else
#define GL_CACHE(s) (0);
#endif