Skip to content

Commit

Permalink
do not delete ubo when not using it
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Apr 10, 2021
1 parent 23b1f40 commit 7cfea18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/runtime/vulkan/vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,12 @@ class VulkanModuleNode final : public runtime::ModuleNode {
vkDestroyDescriptorSetLayout(vctx.device, pe->descriptor_set_layout, nullptr);
vkDestroyShaderModule(vctx.device, pe->shader, nullptr);
// UBO
vkDestroyBuffer(vctx.device, pe->ubo.vk_buf->buffer, nullptr);
vkFreeMemory(vctx.device, pe->ubo.vk_buf->memory, nullptr);
delete pe->ubo.vk_buf;
delete[] pe->ubo.host_buf;
if (pe->ubo.host_buf) {
vkDestroyBuffer(vctx.device, pe->ubo.vk_buf->buffer, nullptr);
vkFreeMemory(vctx.device, pe->ubo.vk_buf->memory, nullptr);
delete pe->ubo.vk_buf;
delete[] pe->ubo.host_buf;
}
}
}
}
Expand Down

0 comments on commit 7cfea18

Please sign in to comment.