Skip to content

Commit 4eee683

Browse files
Updated README
1 parent 5b33438 commit 4eee683

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ This library can help developers to manage memory allocations and resource creat
3030

3131
Additional features:
3232

33-
- Support for resource aliasing (overlap).
34-
- Virtual allocator - possibility to use core allocation algorithm without using real GPU memory, to allocate your own stuff, e.g. sub-allocate pieces of one large buffer.
3533
- Well-documented - description of all classes and functions provided, along with chapters that contain general description and example code.
3634
- Thread-safety: Library is designed to be used in multithreaded code.
3735
- Configuration: Fill optional members of `ALLOCATOR_DESC` structure to provide custom CPU memory allocator and other parameters.
38-
- Customization: Predefine appropriate macros to provide your own implementation of external facilities used by the library, like assert, mutex, and atomic.
39-
- Statistics: Obtain detailed statistics about the amount of memory used, unused, number of allocated blocks, number of allocations etc. - globally and per memory heap type.
40-
- Debug annotations: Associate string name with every allocation.
41-
- JSON dump: Obtain a string in JSON format with detailed map of internal state, including list of allocations and gaps between them.
36+
- Customization and integration with custom engines: Predefine appropriate macros to provide your own implementation of external facilities used by the library, like assert, mutex, and atomic.
37+
- Support for resource aliasing (overlap).
38+
- Custom memory pools: Create a pool with desired parameters (e.g. fixed or limited maximum size, custom `D3D12_HEAP_PROPERTIES` and `D3D12_HEAP_FLAGS`) and allocate memory out of it.
39+
- Linear allocator: Create a pool with linear algorithm and use it for much faster allocations and deallocations in free-at-once, stack, double stack, or ring buffer fashion.
40+
- Defragmentation: Let the library move data around to free some memory blocks and make your allocations better compacted.
41+
- Statistics: Obtain brief or detailed statistics about the amount of memory used, unused, number of allocated heaps, number of allocations etc. - globally and per memory heap type. Current memory usage and budget as reported by the system can also be queried.
42+
- Debug annotations: Associate custom `void* pPrivateData` and debug `LPCWSTR pName` with each allocation.
43+
- JSON dump: Obtain a string in JSON format with detailed map of internal state, including list of allocations, their string names, and gaps between them.
44+
- Convert this JSON dump into a picture to visualize your memory using attached Python script.
45+
- Virtual allocator - an API that exposes the core allocation algorithm to be used without allocating real GPU memory, to allocate your own stuff, e.g. sub-allocate pieces of one large buffer.
4246

4347
# Prerequisites
4448

@@ -65,24 +69,21 @@ resourceDesc.SampleDesc.Quality = 0;
6569
resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
6670
resourceDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
6771

68-
D3D12MA::ALLOCATION_DESC allocationDesc = {};
72+
D3D12MA::ALLOCATION_DESC allocDesc = {};
6973
allocDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT;
7074

7175
D3D12Resource* resource;
7276
D3D12MA::Allocation* allocation;
7377
HRESULT hr = allocator->CreateResource(
74-
&allocationDesc,
75-
&resourceDesc,
76-
D3D12_RESOURCE_STATE_COPY_DEST,
77-
NULL,
78-
&allocation,
79-
IID_PPV_ARGS(&resource));
78+
&allocDesc, &resourceDesc,
79+
D3D12_RESOURCE_STATE_COPY_DEST, NULL,
80+
&allocation, IID_PPV_ARGS(&resource));
8081
```
8182
8283
With this one function call:
8384
8485
1. `ID3D12Heap` memory block is allocated if needed.
85-
2. An unused region of the memory block assigned.
86+
2. An unused region of the memory block is reserved for the allocation.
8687
3. `ID3D12Resource` is created as placed resource, bound to this region.
8788
8889
`Allocation` is an object that represents memory assigned to this texture. It can be queried for parameters like offset and size.

0 commit comments

Comments
 (0)