gsdx-debug: improve debug experience

* Dump context before the increase of s_n
  => aligned with the global call number
* Don't print colclip not supported when it is optimized away
* dettach the input texture when it is useless
  => avoid to show a wrong texture in the debugger
This commit is contained in:
Gregory Hainaut 2015-05-23 12:23:05 +02:00
parent f665180d11
commit b884e0c0c0
3 changed files with 22 additions and 16 deletions

View File

@ -373,6 +373,14 @@ void GSRendererHW::Draw()
string s;
if (s_n >= s_saven) {
// Dump Register state
s = format("%05d_context.txt", s_n);
m_env.Dump(root_hw+s);
m_context->Dump(root_hw+s);
}
if(s_savet && s_n >= s_saven && tex)
{
s = format("%05d_f%lld_tex_%05x_%d_%d%d_%02x_%02x_%02x_%02x.dds",
@ -409,13 +417,6 @@ void GSRendererHW::Draw()
s_n++;
if (s_n >= s_saven) {
// Dump Register state
s = format("%05d_context.txt", s_n);
m_env.Dump(root_hw+s);
m_context->Dump(root_hw+s);
}
#ifdef ENABLE_OGL_DEBUG
} else {
s_n += 2;

View File

@ -448,7 +448,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
} else if (acc_colclip_wrap) {
ps_sel.colclip = 3;
GL_INS("COLCLIP SW ENABLED (blending is %d/%d/%d/%d)", context->ALPHA.A, context->ALPHA.B, context->ALPHA.C, context->ALPHA.D);
} else if (env.COLCLAMP.CLAMP == 0) {
} else if (env.COLCLAMP.CLAMP == 0 && (context->ALPHA.A != context->ALPHA.B)) {
GL_INS("COLCLIP NOT SUPPORTED (blending is %d/%d/%d/%d)", context->ALPHA.A, context->ALPHA.B, context->ALPHA.C, context->ALPHA.D);
}
@ -569,6 +569,11 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
if (spritehack && (ps_sel.atst == 2)) {
ps_sel.atst = 1;
}
} else {
#ifdef ENABLE_OGL_DEBUG
// Unattach texture to avoid noise in debugger
dev->PSSetShaderResource(0, NULL);
#endif
}
// Compute the blending equation to detect special case

View File

@ -516,6 +516,14 @@ void GSRendererSW::Draw()
string s;
if (s_n >= s_saven) {
// Dump Register state
s = format("%05d_context.txt", s_n);
m_env.Dump(root_sw+s);
m_context->Dump(root_sw+s);
}
if(s_savet && s_n >= s_saven && PRIM->TME)
{
s = format("%05d_f%lld_tex_%05x_%d.bmp", s_n, frame, (int)m_context->TEX0.TBP0, (int)m_context->TEX0.PSM);
@ -541,14 +549,6 @@ void GSRendererSW::Draw()
s_n++;
if (s_n >= s_saven) {
// Dump Register state
s = format("%05d_context.txt", s_n);
m_env.Dump(root_sw+s);
m_context->Dump(root_sw+s);
}
Queue(data);
Sync(3);