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

@ -205,6 +205,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_D3D11, vshaders[uid].safe_uid, vshaders[uid].code, components);
return (vshaders[uid].shader != NULL);
}
@ -218,6 +219,7 @@ bool VertexShaderCache::SetShader(u32 components)
last_entry = &entry;
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
ValidateVertexShaderIDs(API_D3D11, entry.safe_uid, entry.code, components);
return (entry.shader != NULL);
}
@ -235,10 +237,17 @@ bool VertexShaderCache::SetShader(u32 components)
g_vs_disk_cache.Append(uid, pbytecode->Data(), pbytecode->Size());
g_vs_disk_cache.Sync();
bool result = InsertByteCode(uid, pbytecode);
bool success = InsertByteCode(uid, pbytecode);
pbytecode->Release();
if (success)
{
vshaders[uid].code = code;
GetSafeVertexShaderId(&vshaders[uid].safe_uid, components);
}
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
return result;
return success;
}
bool VertexShaderCache::InsertByteCode(const VERTEXSHADERUID &uid, D3DBlob* bcodeblob)