mirror of https://github.com/PCSX2/pcsx2.git
gsdx-debug: more debug message/group
This commit is contained in:
parent
08291aed0c
commit
84c3592fbe
|
@ -106,6 +106,8 @@ void GSDevice::Present(const GSVector4i& r, int shader)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL_PUSH("Present");
|
||||||
|
|
||||||
ClearRenderTarget(m_backbuffer, 0);
|
ClearRenderTarget(m_backbuffer, 0);
|
||||||
|
|
||||||
if(m_current)
|
if(m_current)
|
||||||
|
@ -116,6 +118,8 @@ void GSDevice::Present(const GSVector4i& r, int shader)
|
||||||
}
|
}
|
||||||
|
|
||||||
Flip();
|
Flip();
|
||||||
|
|
||||||
|
GL_POP();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSDevice::Present(GSTexture* st, GSTexture* dt, const GSVector4& dr, int shader)
|
void GSDevice::Present(GSTexture* st, GSTexture* dt, const GSVector4& dr, int shader)
|
||||||
|
|
|
@ -75,6 +75,8 @@ GSDeviceOGL::~GSDeviceOGL()
|
||||||
if (m_shader == NULL)
|
if (m_shader == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
GL_PUSH("GSDeviceOGL destructor");
|
||||||
|
|
||||||
// Clean vertex buffer state
|
// Clean vertex buffer state
|
||||||
delete (m_va);
|
delete (m_va);
|
||||||
|
|
||||||
|
@ -141,6 +143,8 @@ 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;
|
||||||
|
|
||||||
|
GL_POP();
|
||||||
}
|
}
|
||||||
|
|
||||||
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int format)
|
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;
|
if (!GLLoader::check_gl_supported_extension()) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL_PUSH("GSDeviceOGL::Create");
|
||||||
|
|
||||||
m_window = wnd;
|
m_window = wnd;
|
||||||
|
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
|
@ -329,6 +335,8 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
PboPool::Init();
|
PboPool::Init();
|
||||||
|
|
||||||
|
GL_POP();
|
||||||
|
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
// Finish window setup and backbuffer
|
// Finish window setup and backbuffer
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
|
@ -1252,9 +1260,13 @@ void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
// 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());
|
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", type.c_str(), g_draw_count, severity.c_str(), message.c_str());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// FIXME move open/close in constructor/destructor
|
||||||
FILE* f = fopen("GSdx_opengl_debug.txt","a");
|
FILE* f = fopen("GSdx_opengl_debug.txt","a");
|
||||||
if(f)
|
if(f)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,6 +116,8 @@ bool GSRenderer::Merge(int field)
|
||||||
return false;
|
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)
|
// 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)
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,12 +130,12 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_OGL_DEBUG
|
#ifdef ENABLE_OGL_DEBUG
|
||||||
if (dst) {
|
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,
|
dst->m_texture ? dst->m_texture->GetID() : 0,
|
||||||
TEX0.TBP0
|
TEX0.TBP0
|
||||||
).c_str());
|
).c_str());
|
||||||
} else {
|
} 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
|
#endif
|
||||||
src = CreateSource(TEX0, TEXA, dst);
|
src = CreateSource(TEX0, TEXA, dst);
|
||||||
|
@ -146,7 +146,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_OGL_DEBUG
|
#ifdef ENABLE_OGL_DEBUG
|
||||||
} else {
|
} 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,
|
src->m_texture ? src->m_texture->GetID() : 0,
|
||||||
TEX0.TBP0
|
TEX0.TBP0
|
||||||
).c_str());
|
).c_str());
|
||||||
|
@ -195,6 +195,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
|
|
||||||
if(dst == NULL)
|
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);
|
dst = CreateTarget(TEX0, w, h, type);
|
||||||
|
|
||||||
if(dst == NULL)
|
if(dst == NULL)
|
||||||
|
@ -204,6 +206,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
}
|
}
|
||||||
else
|
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();
|
dst->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,6 +275,8 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
{
|
{
|
||||||
dst = t;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
else
|
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))
|
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;
|
dst = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,8 +293,11 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
|
|
||||||
if(dst == NULL)
|
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);
|
dst = CreateTarget(TEX0, w, h, RenderTarget);
|
||||||
|
|
||||||
|
|
||||||
if(dst == NULL)
|
if(dst == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1267,7 +1277,7 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s)
|
||||||
{
|
{
|
||||||
m_surfaces.erase(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_texture ? s->m_texture->GetID() : 0,
|
||||||
s->m_TEX0.TBP0).c_str());
|
s->m_TEX0.TBP0).c_str());
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ extern void vmfree(void* ptr, size_t size);
|
||||||
|
|
||||||
// Except apple any sane driver support this extension
|
// Except apple any sane driver support this extension
|
||||||
#if defined(__linux__) && defined(_DEBUG)
|
#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
|
#else
|
||||||
#define GL_CACHE(s) (0);
|
#define GL_CACHE(s) (0);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue