mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-06 04:33:49 +01:00
Vulkan: Add code to track allocator usage info.
This way we can potentially debug leaks, if any.
This commit is contained in:
1 parent
ca0fb77080
commit
1c253ee271
4 files changed
+62
-7
No files matched your search
@@ -74,7 +74,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, int w, int h, int numMips,
|
||||
vkGetImageMemoryRequirements(vulkan_->GetDevice(), image_, &mem_reqs);
|
||||
|
||||
if (allocator_) {
|
||||
offset_ = allocator_->Allocate(mem_reqs, &mem_);
|
||||
offset_ = allocator_->Allocate(mem_reqs, &mem_, Tag());
|
||||
if (offset_ == VulkanDeviceAllocator::ALLOCATE_FAILED) {
|
||||
return false;
|
||||
}
|
||||
@@ -207,6 +207,12 @@ void VulkanTexture::EndCreate(VkCommandBuffer cmd, bool vertexTexture) {
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT);
|
||||
}
|
||||
|
||||
void VulkanTexture::Touch() {
|
||||
if (allocator_ && mem_ != VK_NULL_HANDLE) {
|
||||
allocator_->Touch(mem_, offset_);
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanTexture::Destroy() {
|
||||
if (view_ != VK_NULL_HANDLE) {
|
||||
vulkan_->Delete().QueueDeleteImageView(view_);
|
||||
|
||||
Reference in new issue
Block a user