mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Some changes to VertexLoaderManager:
- Lazily create the native vertex format (which involves GL calls) from RunVertices rather than RefreshLoader itself, freeing the latter to be run from the CPU thread (hopefully). - In order to avoid useless allocations while doing so, store the native format inside the VertexLoader rather than using a cache entry. - Wrap the s_vertex_loader_map in a lock, for similar reasons.
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
// Metroid Prime: P I16-flt N I16-s16 T0 I16-u16 T1 i16-flt
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -114,6 +116,9 @@ public:
|
||||
void AppendToString(std::string *dest) const;
|
||||
int GetNumLoadedVerts() const { return m_numLoadedVertices; }
|
||||
|
||||
NativeVertexFormat* GetNativeVertexFormat();
|
||||
static void ClearNativeVertexFormatCache() { s_native_vertex_map.clear(); }
|
||||
|
||||
private:
|
||||
int m_VertexSize; // number of bytes of a raw GC vertex. Computed by CompileVertexTranslator.
|
||||
|
||||
@ -135,6 +140,9 @@ private:
|
||||
|
||||
int m_numLoadedVertices;
|
||||
|
||||
NativeVertexFormat* m_native_vertex_format;
|
||||
static std::map<PortableVertexDeclaration, std::unique_ptr<NativeVertexFormat>> s_native_vertex_map;
|
||||
|
||||
void SetVAT(const VAT& vat);
|
||||
|
||||
void CompileVertexTranslator();
|
||||
|
Reference in New Issue
Block a user