Improve the shader UID debugging stuff and merge it to VideoCommon, effectively enabling it in D3D9 and D3D11 as well.

This commit is contained in:
NeoBrainX
2011-09-09 00:32:04 +02:00
parent 349a3ae91d
commit b28348066e
16 changed files with 614 additions and 527 deletions

View File

@ -187,6 +187,7 @@ bool VertexShaderCache::SetShader(u32 components)
if (uid == last_vertex_shader_uid && vshaders[uid].frameCount == frameCount)
{
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
ValidateVertexShaderIDs(API_D3D9, vshaders[uid].safe_uid, vshaders[uid].code, components);
return (vshaders[uid].shader != NULL);
}
@ -201,6 +202,7 @@ bool VertexShaderCache::SetShader(u32 components)
if (entry.shader) D3D::SetVertexShader(entry.shader);
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
ValidateVertexShaderIDs(API_D3D9, entry.safe_uid, entry.code, components);
return (entry.shader != NULL);
}
@ -215,10 +217,15 @@ bool VertexShaderCache::SetShader(u32 components)
g_vs_disk_cache.Append(uid, bytecode, bytecodelen);
g_vs_disk_cache.Sync();
bool result = InsertByteCode(uid, bytecode, bytecodelen, true);
bool success = InsertByteCode(uid, bytecode, bytecodelen, true);
if (success)
{
vshaders[uid].code = code;
GetSafeVertexShaderId(&vshaders[uid].safe_uid, components);
}
delete [] bytecode;
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
return result;
return success;
}
bool VertexShaderCache::InsertByteCode(const VERTEXSHADERUID &uid, const u8 *bytecode, int bytecodelen, bool activate) {