LiteFX::Rendering::Backends::DirectX12Device::allocateGlobalDescriptors¶
Allocates a descriptors on the descriptor heap indicated by <paramref name=heapType" /> for use with external clients.
Synopsis¶
Declared in <litefx/backends/dx12.hpp>
[[dllimport, nodiscard, dllexport]] VirtualAllocator::Allocation allocateGlobalDescriptors(
UInt32 descriptors,
DescriptorHeapType heapType) const;
Description¶
This call allocates a descriptor range on one of the global descriptor heaps, that can be used with external clients and libraries. Keep in mind that you have to release those descriptors manually by calling the appropriate overload to releaseGlobalDescriptors. The following example demonstrates how to use this function.
Example¶
auto allocation = d3dDevice.allocateGlobalDescriptors(1000, DescriptorHeapType::Resource); // Use the descriptors. d3dDevice.releaseGlobalDescriptors(DescriptorHeapType::Resource, std::move(allocation));
Return Value¶
The allocation for the requested descriptors in the descriptor heap indicated by heapType.
Note
The return value should not be discarded.
Parameters¶
| Name | Description |
|---|---|
| descriptors | The number of descriptors to allocate. |
| heapType | The heap type, indicating the descriptor heap to allocate the descriptors from. |