Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit fc68215

Browse files
committed
[Impeller] started tracking the pool with the command buffer
1 parent e3883ea commit fc68215

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

impeller/renderer/backend/vulkan/command_encoder_vk.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ class TrackedObjectsVK {
3434
if (!buffer_) {
3535
return;
3636
}
37-
auto pool = pool_.lock();
38-
if (!pool) {
39-
// The buffer can not be freed if its command pool has been destroyed.
40-
buffer_.release();
41-
return;
42-
}
43-
pool->CollectGraphicsCommandBuffer(std::move(buffer_));
37+
pool_->CollectGraphicsCommandBuffer(std::move(buffer_));
4438
}
4539

4640
bool IsValid() const { return is_valid_; }
@@ -86,7 +80,7 @@ class TrackedObjectsVK {
8680

8781
private:
8882
DescriptorPoolVK desc_pool_;
89-
std::weak_ptr<CommandPoolVK> pool_;
83+
std::shared_ptr<CommandPoolVK> pool_;
9084
vk::UniqueCommandBuffer buffer_;
9185
std::set<std::shared_ptr<SharedObjectVK>> tracked_objects_;
9286
std::set<std::shared_ptr<const Buffer>> tracked_buffers_;

0 commit comments

Comments
 (0)