Struct gpu_allocator::d3d12::Allocation
source · pub struct Allocation { /* private fields */ }
Implementations§
source§impl Allocation
impl Allocation
pub fn chunk_id(&self) -> Option<NonZeroU64>
sourcepub unsafe fn heap(&self) -> &ID3D12Heap
pub unsafe fn heap(&self) -> &ID3D12Heap
Returns the ID3D12Heap
object that is backing this allocation.
This heap object can be shared with multiple other allocations and shouldn’t be freed (or allocated from)
without this library, because that will lead to undefined behavior.
Safety
The result of this function be safely passed into ID3D12Device::CreatePlacedResource()
.
It is exposed for this reason. Keep in mind to also pass Self::offset()
along to it.
sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
Returns the offset of the allocation on the ID3D12Heap
.
When creating a placed resources, this offset needs to be supplied as well.