Skip to content

LiteFX::Rendering::Backends::VulkanCommandBuffer::track

Sets up tracking for a buffer, so that it will not be destroyed until the command buffer has been executed.

Synopsis

Declared in <litefx/backends/vulkan.hpp>

[[dllimport, dllexport]] virtual void track(SharedPtr<IImage const> image) const override;

Description

When working with resources, often times you only need them for a single execution cycle of a command buffer. Having to manually check if the command buffer has been executed (by waiting for it's submission fence on the target queue) and releasing the resource afterwards can be difficult and intricate. Resource tracking allows the command buffer to store a reference of a resource and releasing it at some point after the command buffer has been executed automatically. Note that this does not automatically destroy the resource, which only happens if all references to it are released. However, if the only reference left is the one that is tracked by the command buffer, this process also destroys the resource.

Resources can only be tracked, if the command buffer is currently recording. The command buffer will not track uninitialized resources, i.e., a submitted nullptr will be discarded.

Parameters

NameDescription
imageRepresents a shared pointer, that expresses non-exclusive ownership.

See Also

track(SharedPtr≤const IImage≥)

track(SharedPtr≤const ISampler≥)