mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00: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:
parent
be1fe80bb6
commit
bb2fc8ecbb
4 changed files with 30 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue