mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-16 12:58:33 +02:00
VideoCommon: Cache native vertex formats
We are used to have a 1:1 mapping of GX vertex formats and the native (OGL + D3D) ones, but there are by far more GX ones. This new cache maps them directly so that we don't flush on GX vertex format changes as long as the native one doesn't change. The idea is stolen from galop1n.
This commit is contained in:
@ -76,6 +76,15 @@ struct PortableVertexDeclaration
|
||||
AttributeFormat colors[2];
|
||||
AttributeFormat texcoords[8];
|
||||
AttributeFormat posmtx;
|
||||
|
||||
inline bool operator<(const PortableVertexDeclaration& b) const
|
||||
{
|
||||
return memcmp(this, &b, sizeof(PortableVertexDeclaration)) < 0;
|
||||
}
|
||||
inline bool operator==(const PortableVertexDeclaration& b) const
|
||||
{
|
||||
return memcmp(this, &b, sizeof(PortableVertexDeclaration)) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
|
||||
|
Reference in New Issue
Block a user