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.
pub fn is_null(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Allocation
impl RefUnwindSafe for Allocation
impl Send for Allocation
impl Sync for Allocation
impl Unpin for Allocation
impl UnwindSafe for Allocation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more