|
UINT64 | GetOffset () const |
| Returns offset in bytes from the start of memory heap.
|
UINT64 | GetAlignment () const |
| Returns alignment that resource was created with.
|
UINT64 | GetSize () const |
| Returns size in bytes of the allocation.
|
ID3D12Resource * | GetResource () const |
| Returns D3D12 resource associated with this object.
|
void | SetResource (ID3D12Resource *pResource) |
| Releases the resource currently pointed by the allocation (if not null), sets it to new one, incrementing its reference counter (if not null).
|
ID3D12Heap * | GetHeap () const |
| Returns memory heap that the resource is created in.
|
void | SetPrivateData (void *pPrivateData) |
| Changes custom pointer for an allocation to a new value.
|
void * | GetPrivateData () const |
| Get custom pointer associated with the allocation.
|
void | SetName (LPCWSTR Name) |
| Associates a name with the allocation object. This name is for use in debug diagnostics and tools.
|
LPCWSTR | GetName () const |
| Returns the name associated with the allocation object.
|
Represents single memory allocation.
It may be either implicit memory heap dedicated to a single resource or a specific region of a bigger heap plus unique offset.
To create such object, fill structure D3D12MA::ALLOCATION_DESC and call function Allocator::CreateResource.
The object remembers size and some other information. To retrieve this information, use methods of this class.
The object also remembers ID3D12Resource and "owns" a reference to it, so it calls Release() on the resource when destroyed.
UINT64 D3D12MA::Allocation::GetOffset |
( |
| ) |
const |
Returns offset in bytes from the start of memory heap.
You usually don't need to use this offset. If you create a buffer or a texture together with the allocation using function D3D12MA::Allocator::CreateResource, functions that operate on that resource refer to the beginning of the resource, not entire memory heap.
If the Allocation represents committed resource with implicit heap, returns 0.