mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-10 03:44:26 +00:00
Switch to an unordered_map as a micro-optimization.
This commit is contained in:
parent
f8452ff501
commit
90638c6806
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/Hash.h"
|
||||||
|
|
||||||
// m_components
|
// m_components
|
||||||
enum
|
enum
|
||||||
@ -87,6 +87,20 @@ struct PortableVertexDeclaration
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct hash<PortableVertexDeclaration>
|
||||||
|
{
|
||||||
|
size_t operator()(const PortableVertexDeclaration& decl) const
|
||||||
|
{
|
||||||
|
return HashFletcher((u8 *) &decl, sizeof(decl));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
|
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
|
||||||
// is in the respective backend, not here in VideoCommon.
|
// is in the respective backend, not here in VideoCommon.
|
||||||
|
|
||||||
|
@ -1051,4 +1051,4 @@ NativeVertexFormat* VertexLoader::GetNativeVertexFormat()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> VertexLoader::s_native_vertex_map;
|
std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> VertexLoader::s_native_vertex_map;
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/x64Emitter.h"
|
#include "Common/x64Emitter.h"
|
||||||
@ -141,7 +141,7 @@ private:
|
|||||||
int m_numLoadedVertices;
|
int m_numLoadedVertices;
|
||||||
|
|
||||||
NativeVertexFormat* m_native_vertex_format;
|
NativeVertexFormat* m_native_vertex_format;
|
||||||
static std::map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> s_native_vertex_map;
|
static std::unordered_map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> s_native_vertex_map;
|
||||||
|
|
||||||
void SetVAT(const VAT& vat);
|
void SetVAT(const VAT& vat);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user