mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-16 01:12:55 +00:00
Merge pull request #4948 from lioncash/page-resize
virtual_buffer: Do nothing on resize() calls with same sizes
This commit is contained in:
commit
6971d08893
|
@ -43,9 +43,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void resize(std::size_t count) {
|
void resize(std::size_t count) {
|
||||||
|
const auto new_size = count * sizeof(T);
|
||||||
|
if (new_size == alloc_size) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FreeMemoryPages(base_ptr, alloc_size);
|
FreeMemoryPages(base_ptr, alloc_size);
|
||||||
|
|
||||||
alloc_size = count * sizeof(T);
|
alloc_size = new_size;
|
||||||
base_ptr = reinterpret_cast<T*>(AllocateMemoryPages(alloc_size));
|
base_ptr = reinterpret_cast<T*>(AllocateMemoryPages(alloc_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue