gsdx ogl: trace shader permutation

Too much permutation is bad for driver performances
This commit is contained in:
Gregory Hainaut 2016-06-10 20:44:35 +02:00
parent 5ffc911a69
commit 1c8de02c8d
1 changed files with 50 additions and 6 deletions

View File

@ -1556,9 +1556,6 @@ void GSDeviceOGL::SetupCBMisc(const GSVector4i& channel)
void GSDeviceOGL::SetupPipeline(const VSSelector& vsel, const GSSelector& gsel, const PSSelector& psel)
{
// *************************************************************
// Static
// *************************************************************
GLuint ps;
auto i = m_ps.find(psel);
@ -1569,9 +1566,56 @@ void GSDeviceOGL::SetupPipeline(const VSSelector& vsel, const GSSelector& gsel,
ps = i->second;
}
// *************************************************************
// Dynamic
// *************************************************************
{
#if defined(_DEBUG) && 0
// Toggling Shader is bad for the perf. Let's trace parameter that often toggle to detect
// potential uber shader possibilities.
static PSSelector old_psel;
static GLuint old_ps = 0;
std::string msg("");
#define CHECK_STATE(p) if (psel.p != old_psel.p) msg.append(" ").append(#p);
if (old_ps != ps) {
CHECK_STATE(tex_fmt);
CHECK_STATE(dfmt);
CHECK_STATE(depth_fmt);
CHECK_STATE(aem);
CHECK_STATE(fba);
CHECK_STATE(fog);
CHECK_STATE(iip);
CHECK_STATE(date);
CHECK_STATE(atst);
CHECK_STATE(fst);
CHECK_STATE(tfx);
CHECK_STATE(tcc);
CHECK_STATE(wms);
CHECK_STATE(wmt);
CHECK_STATE(ltf);
CHECK_STATE(shuffle);
CHECK_STATE(read_ba);
CHECK_STATE(write_rg);
CHECK_STATE(fbmask);
CHECK_STATE(blend_a);
CHECK_STATE(blend_b);
CHECK_STATE(blend_c);
CHECK_STATE(blend_d);
CHECK_STATE(clr1);
CHECK_STATE(pabe);
CHECK_STATE(hdr);
CHECK_STATE(colclip);
// CHECK_STATE(channel);
// CHECK_STATE(tcoffsethack);
// CHECK_STATE(urban_chaos_hle);
// CHECK_STATE(tales_of_abyss_hle);
GL_PERF("New PS :%s", msg.c_str());
}
old_psel.key = psel.key;
old_ps = ps;
#endif
}
if (GLLoader::buggy_sso_dual_src)
m_shader->BindProgram(m_vs[vsel], m_gs[gsel], ps);
else