mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Tweak logging and asserts in VulkanDeviceMemory::Destroy
This commit is contained in:
parent
27227f87fd
commit
91b089d90d
1 changed files with 6 additions and 2 deletions
|
@ -171,9 +171,13 @@ void VulkanDeviceAllocator::Destroy() {
|
|||
// Did anyone forget to free?
|
||||
for (auto pair : slab.allocSizes) {
|
||||
int slabUsage = slab.usage[pair.first];
|
||||
// If it's not 2 (queued), there's a problem.
|
||||
// If it's not 2 (queued), there's a leak.
|
||||
// If it's zero, it means allocSizes is somehow out of sync.
|
||||
_assert_msg_(G3D, slabUsage == 2, "Destroy: slabUsage has unexpected value %d", slabUsage);
|
||||
if (slabUsage == 1) {
|
||||
ERROR_LOG(G3D, "VulkanDeviceAllocator detected memory leak of size %d", (int)pair.second);
|
||||
} else {
|
||||
_dbg_assert_msg_(G3D, slabUsage == 2, "Destroy: slabUsage has unexpected value %d", slabUsage);
|
||||
}
|
||||
}
|
||||
|
||||
assert(slab.deviceMemory);
|
||||
|
|
Loading…
Add table
Reference in a new issue