VideoCommon: Move NativeVertexFormat cache to VertexLoaderManager

This commit is contained in:
degasus
2014-12-12 08:53:48 +01:00
parent 1281798992
commit 6e3b2712d2
3 changed files with 22 additions and 32 deletions

View File

@ -591,22 +591,3 @@ void VertexLoader::AppendToString(std::string *dest) const
}
dest->append(StringFromFormat(" - %i v\n", m_numLoadedVertices));
}
NativeVertexFormat* VertexLoader::GetNativeVertexFormat()
{
if (m_native_vertex_format)
return m_native_vertex_format;
auto& native = s_native_vertex_map[m_native_vtx_decl];
if (!native)
{
auto raw_pointer = g_vertex_manager->CreateNativeVertexFormat();
native = std::unique_ptr<NativeVertexFormat>(raw_pointer);
native->Initialize(m_native_vtx_decl);
native->m_components = m_native_components;
}
m_native_vertex_format = native.get();
return native.get();
}
std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> VertexLoader::s_native_vertex_map;