mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 00:59:44 +00:00
optimize TextureCacheBase::SerializeTexture, ::DeserializeTexture
texture serialization and deserialization used to involve many memory allocations and deallocations, along with many copies to and from those allocations. avoid those by reserving a memory region inside the output and writing there directly, skipping the allocation and copy to an intermediate buffer entirely.
This commit is contained in:
parent
14959a1087
commit
43ceba4fef
2 changed files with 48 additions and 18 deletions
|
@ -200,6 +200,16 @@ public:
|
|||
DoArray(arr, static_cast<u32>(N));
|
||||
}
|
||||
|
||||
// The caller is required to inspect the mode of this PointerWrap
|
||||
// and deal with the pointer returned from this function themself.
|
||||
[[nodiscard]] u8* DoExternal(u32& count)
|
||||
{
|
||||
Do(count);
|
||||
u8* current = *ptr;
|
||||
*ptr += count;
|
||||
return current;
|
||||
}
|
||||
|
||||
void Do(Common::Flag& flag)
|
||||
{
|
||||
bool s = flag.IsSet();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue