mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Monoblocks: optimize blocks that contain a single type of node (#16293)
Reduces memory usage on the server, especially with many user and/or large viewing distances. Currently disabled on the client due to known data races on a block's data.
This commit is contained in:
parent
afd681d013
commit
08b7870c79
11 changed files with 245 additions and 47 deletions
|
@ -305,9 +305,10 @@ struct alignas(u32) MapNode
|
|||
// content_width = the number of bytes of content per node
|
||||
// params_width = the number of bytes of params per node
|
||||
// compressed = true to zlib-compress output
|
||||
// is_mono_block = if true, nodes is array of size 1
|
||||
static Buffer<u8> serializeBulk(int version,
|
||||
const MapNode *nodes, u32 nodecount,
|
||||
u8 content_width, u8 params_width);
|
||||
u8 content_width, u8 params_width, bool is_mono_block = false);
|
||||
static void deSerializeBulk(std::istream &is, int version,
|
||||
MapNode *nodes, u32 nodecount,
|
||||
u8 content_width, u8 params_width);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue