mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Eliminated a memcpy in DX11's vertex shader disk cache loading. Maybe games will boot faster now, who knows?
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7422 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -306,12 +306,16 @@ ID3D11Buffer*const& PixelShaderCache::GetConstantBuffer()
|
||||
}
|
||||
|
||||
// this class will load the precompiled shaders into our cache
|
||||
class PixelShaderCacheInserter : public LinearDiskCacheReader<PIXELSHADERUID, u8>
|
||||
class PixelShaderCacheInserter
|
||||
{
|
||||
public:
|
||||
void Read(const PIXELSHADERUID &key, const u8 *value, u32 value_size)
|
||||
template <typename F>
|
||||
void operator()(const PIXELSHADERUID& key, u32 value_size, F get_data) const
|
||||
{
|
||||
PixelShaderCache::InsertByteCode(key, value, value_size);
|
||||
std::unique_ptr<u8[]> value(new u8[value_size]);
|
||||
get_data(value.get());
|
||||
|
||||
PixelShaderCache::InsertByteCode(key, value.get(), value_size);
|
||||
}
|
||||
};
|
||||
|
||||
@ -353,9 +357,9 @@ void PixelShaderCache::Init()
|
||||
|
||||
char cache_filename[MAX_PATH];
|
||||
sprintf(cache_filename, "%sdx11-%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX).c_str(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
|
||||
PixelShaderCacheInserter inserter;
|
||||
g_ps_disk_cache.OpenAndRead(cache_filename, inserter);
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
|
||||
|
||||
g_ps_disk_cache.OpenAndRead(cache_filename, PixelShaderCacheInserter());
|
||||
}
|
||||
|
||||
// ONLY to be used during shutdown.
|
||||
|
Reference in New Issue
Block a user