1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Cache grouped sparse buffers (#15594)

continuation of #15531
This commit is contained in:
sfan5 2025-01-14 23:40:57 +01:00 committed by GitHub
parent 7053348e31
commit cf074dd271
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 178 additions and 61 deletions

View file

@ -36,6 +36,16 @@ namespace irr::video
class IVideoDriver;
}
struct CachedMeshBuffer {
std::vector<scene::IMeshBuffer*> buf;
u8 age = 0;
void drop();
};
using CachedMeshBuffers = std::unordered_map<std::string, CachedMeshBuffer>;
/*
ClientMap
@ -95,6 +105,8 @@ public:
void renderPostFx(CameraMode cam_mode);
void invalidateMapBlockMesh(MapBlockMesh *mesh);
// For debug printing
void PrintInfo(std::ostream &out) override;
@ -151,6 +163,7 @@ private:
std::vector<MapBlock*> m_keeplist;
std::map<v3s16, MapBlock*> m_drawlist_shadow;
bool m_needs_update_drawlist;
CachedMeshBuffers m_dynamic_buffers;
bool m_cache_trilinear_filter;
bool m_cache_bilinear_filter;