Facilitates safe resource destruction in D3D12 and Vulkan. More...
#include <ResourceReleaseQueue.hpp>
Public Member Functions | |
template<typename ResourceType, typename = typename std::enable_if<std::is_object<ResourceType>::value>::type> | |
void | SafeReleaseResource (ResourceType &&Resource, Uint64 NextCommandListNumber) |
Moves a resource to the stale resources queue. | |
void | SafeReleaseResource (ResourceWrapperType &&Wrapper, Uint64 NextCommandListNumber) |
Moves a resource wrapper to the stale resources queue. | |
void | SafeReleaseResource (const ResourceWrapperType &Wrapper, Uint64 NextCommandListNumber) |
Moves a copy of the resource wrapper to the stale resources queue. | |
template<typename ResourceType, typename = typename std::enable_if<std::is_object<ResourceType>::value>::type> | |
void | DiscardResource (ResourceType &&Resource, Uint64 FenceValue) |
Adds a resource directly to the release queue. | |
void | DiscardResource (ResourceWrapperType &&Wrapper, Uint64 FenceValue) |
Adds a resource wrapper directly to the release queue. | |
void | DiscardResource (const ResourceWrapperType &Wrapper, Uint64 FenceValue) |
Adds a copy of the resource wrapper directly to the release queue. | |
template<typename ResourceType, typename IteratorType> | |
void | DiscardResources (Uint64 FenceValue, IteratorType Iterator) |
Adds multiple resources directly to the release queue. | |
void | DiscardStaleResources (Uint64 SubmittedCmdBuffNumber, Uint64 FenceValue) |
Moves stale objects to the release queue. | |
void | Purge (Uint64 CompletedFenceValue) |
size_t | GetStaleResourceCount () const |
Returns the number of stale resources. | |
size_t | GetPendingReleaseResourceCount () const |
Returns the number of resources pending release. | |
Static Public Member Functions | |
template<typename ResourceType, typename = typename std::enable_if<std::is_object<ResourceType>::value>::type> | |
static ResourceWrapperType | CreateWrapper (ResourceType &&Resource, typename ResourceWrapperType::RefCounterType NumReferences) |
Creates a resource wrapper for the specific resource type. | |
Facilitates safe resource destruction in D3D12 and Vulkan.
Resource destruction is a two-stage process:
ResourceWrapperType | - Type of the resource wrapper used by the release queue. |
|
inlinestatic |
Creates a resource wrapper for the specific resource type.
[in] | Resource | - Resource to be released |
[in] | NumReferences | - Number of references to the resource |
|
inline |
Adds a copy of the resource wrapper directly to the release queue.
[in] | Wrapper | - Resource wrapper containing the resource to be released. |
[in] | FenceValue | - Fence value indicating when the resource was used last time. |
|
inline |
Adds a resource directly to the release queue.
[in] | Resource | - Resource to be released. |
[in] | FenceValue | - Fence value indicating when the resource was used last time. |
|
inline |
Adds a resource wrapper directly to the release queue.
[in] | Wrapper | - Resource wrapper containing the resource to be released. |
[in] | FenceValue | - Fence value indicating when the resource was used last time. |
|
inline |
Adds multiple resources directly to the release queue.
[in] | FenceValue | - Fence value indicating when the resource was used last time. |
[in] | Iterator | - Iterator that returns resources to be released. |
|
inline |
Moves stale objects to the release queue.
[in] | SubmittedCmdBuffNumber | - number of the last submitted command list. All resources in the stale object list whose command list number is less than or equal to this value are moved to the release queue. |
[in] | FenceValue | - Fence value associated with the resources moved to the release queue. A resource will be destroyed by Purge() method when completed fence value is greater or equal to the fence value associated with the resource |
|
inline |
Removes all objects from the release queue whose fence value is less than or equal to CompletedFenceValue
[in] | CompletedFenceValue | - Value of the fence that has been completed by the GPU |
|
inline |
Moves a copy of the resource wrapper to the stale resources queue.
[in] | Wrapper | - Resource wrapper containing the resource to be released |
[in] | NextCommandListNumber | - Number of the command list that will be submitted to the queue next |
|
inline |
Moves a resource to the stale resources queue.
[in] | Resource | - Resource to be released |
[in] | NextCommandListNumber | - Number of the command list that will be submitted to the queue next |
|
inline |
Moves a resource wrapper to the stale resources queue.
[in] | Wrapper | - Resource wrapper containing the resource to be released |
[in] | NextCommandListNumber | - Number of the command list that will be submitted to the queue next |