mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-08 15:04:21 +00:00
Add a function to reset memory blocks without freeing them
* This can be used only when all resources are safely freed, but means the memory can be re-used.
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -590,6 +590,7 @@ private:
|
||||
VkDeviceSize m_MemoryBlockSize[arraydim<MemoryScope>()] = {};
|
||||
|
||||
void FreeAllMemory(MemoryScope scope);
|
||||
void ResetMemoryBlocks(MemoryScope scope);
|
||||
void FreeMemoryAllocation(MemoryAllocation alloc);
|
||||
|
||||
// internal implementation - call one of the functions above
|
||||
|
||||
@@ -432,6 +432,17 @@ void WrappedVulkan::FreeAllMemory(MemoryScope scope)
|
||||
});
|
||||
}
|
||||
|
||||
void WrappedVulkan::ResetMemoryBlocks(MemoryScope scope)
|
||||
{
|
||||
rdcarray<MemoryAllocation> &allocList = m_MemoryBlocks[(size_t)scope];
|
||||
|
||||
if(allocList.empty())
|
||||
return;
|
||||
|
||||
for(MemoryAllocation &alloc : allocList)
|
||||
alloc.offs = 0;
|
||||
}
|
||||
|
||||
void WrappedVulkan::FreeMemoryAllocation(MemoryAllocation alloc)
|
||||
{
|
||||
// don't do anything at the moment, we only support freeing the whole scope at once.
|
||||
|
||||
Reference in new issue
Block a user