13 const std::weak_ptr<const ContextVK>& context,
14 const std::shared_ptr<CommandPoolVK>& pool,
15 std::shared_ptr<DescriptorPoolVK> descriptor_pool,
16 std::unique_ptr<GPUProbe> probe)
17 : desc_pool_(
std::move(descriptor_pool)), probe_(
std::move(probe)) {
21 auto buffer = pool->CreateCommandBuffer();
26 buffer_ = std::move(buffer);
30 tracked_objects_.reserve(5);
31 tracked_buffers_.reserve(5);
32 tracked_textures_.reserve(5);
39 pool_->CollectCommandBuffer(std::move(buffer_));
47 if (!
object || (!tracked_objects_.empty() &&
48 object.get() == tracked_objects_.back().get())) {
51 tracked_objects_.emplace_back(
object);
55 const std::shared_ptr<const DeviceBuffer>& buffer) {
56 if (!buffer || (!tracked_buffers_.empty() &&
57 buffer.get() == tracked_buffers_.back().get())) {
60 tracked_buffers_.emplace_back(buffer);
64 const std::shared_ptr<const TextureSourceVK>& texture) {
65 if (!texture || (!tracked_textures_.empty() &&
66 texture.get() == tracked_textures_.back().get())) {
69 tracked_textures_.emplace_back(texture);
A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually....
void Track(const std::shared_ptr< SharedObjectVK > &object)
GPUProbe & GetGPUProbe() const
DescriptorPoolVK & GetDescriptorPool()
vk::CommandBuffer GetCommandBuffer() const
TrackedObjectsVK(const std::weak_ptr< const ContextVK > &context, const std::shared_ptr< CommandPoolVK > &pool, std::shared_ptr< DescriptorPoolVK > descriptor_pool, std::unique_ptr< GPUProbe > probe)