mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
VideoCommon: Move NativeVertexFormat cache to VertexLoaderManager
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user