Make shader ID validation optional by adding a gfx setting called "EnableShaderDebugging".

Setting this to True will enable additional checks if the shader cache misses any relevant register changes.
This commit is contained in:
NeoBrainX
2011-09-09 21:34:46 +02:00
parent b28348066e
commit 5c14a24ce1
9 changed files with 28 additions and 20 deletions

View File

@ -100,6 +100,7 @@ VERTEXSHADER* VertexShaderCache::SetShader(u32 components)
entry.frameCount = frameCount;
pShaderLast = &entry.shader;
const char *code = GenerateVertexShaderCode(components, API_OPENGL);
GetSafeVertexShaderId(&entry.safe_uid, components);
#if defined(_DEBUG) || defined(DEBUGFAST)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) {
@ -183,9 +184,8 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr
cgDestroyProgram(tempprog);
#endif
//#if defined(_DEBUG) || defined(DEBUGFAST)
vs.strprog = pstrprogram;
//#endif
if (g_ActiveConfig.bEnableShaderDebugging)
vs.strprog = pstrprogram;
return true;
}