LiteFX::Rendering::Backends::VulkanGraphicsFactory::allocate¶
Allocates a set of resources as described by allocationInfos.
Synopsis¶
Declared in <litefx/backends/vulkan.hpp>
[[dllimport, dllexport]] virtual Generator<ResourceAllocationResult> allocate(
Enumerable<ResourceAllocationInfo const&> allocationInfos,
AllocationBehavior allocationBehavior = AllocationBehavior::Default,
bool alias = false) const override;
Description¶
If the alias parameter is set to true, the allocator attempts to overlap the resources in a single allocation, which saves memory. However, this implies that the resources must be properly synchronized and accessed according to the aliasing rules imposed by the backend. Most notably, you have to manually insert aliasing barriers to isolate access.
Note that overlapping arbitrary resource types might not be possible on each GPU. You can check if aliasing is supported for the desired resources by calling canAlias first. If aliasing is not possible, you can instead fallback to non-overlapping resources by setting the alias parameter to false accordingly. If you attempt to allocate aliasing resources on an unsupported GPU directly, this method will raise an error.
Return Value¶
A generator that returns the individual resources that have been allocated.
Parameters¶
| Name | Description |
|---|---|
| allocationInfos | The description of the resources to allocate. |
| allocationBehavior | The behavior controlling what happens if currently there is not enough memory available for the resource. |
| alias | true if the allocator should attempt to overlap the allocations and false otherwise. |
See Also¶
canAlias
https://gpuopen-librariesandsdks.github.io/D3D12MemoryAllocator/html/resource_aliasing.html
https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/resource_aliasing.html