![]() |
XII Release 0.1.0
|
#include <MemoryAllocatorD3D12.h>
Public Member Functions | |
| xiiResult | Initialize (xiiGALDeviceD3D12 *pDeviceD3D12, xiiUInt32 uiPreferredBlockSize=0U) |
| void | DeInitialize () |
| Cleans up internal resources. | |
| xiiResult | CreateBuffer (const D3D12_RESOURCE_DESC &resourceDescription, const xiiD3D12MemoryAllocationCreateInfo &allocationCreateInfo, ID3D12Resource **out_ppResource, xiiD3D12Allocation *out_pAllocation) |
| void | DestroyBuffer (ID3D12Resource *&pResource, xiiD3D12Allocation &pAllocation) |
| xiiResult | CreateImage (const D3D12_RESOURCE_DESC &resourceDescription, const xiiD3D12MemoryAllocationCreateInfo &allocationCreateInfo, const xiiGALOptimizedClearValue *pOptimizedClearValue, ID3D12Resource **out_ppResource, xiiD3D12Allocation *out_pAllocation) |
| void | DestroyImage (ID3D12Resource *&pResource, xiiD3D12Allocation &pAllocation) |
Friends | |
| void * | xiiD3D12AllocatePtr (size_t uiSize, size_t uiAlignment, void *pPrivateData) |
| Internal implementation details. | |
| void | xiiD3D12FreePtr (void *pMemory, void *pPrivateData) |
Direct3D 12 memory allocator wrapper.
Provides high-level allocation and resource management for D3D12 buffers and images. Internally wraps D3D12 Memory Allocator (D3D12MA) and custom logic to simplify memory handling.
| xiiResult xiiD3D12MemoryAllocator::CreateBuffer | ( | const D3D12_RESOURCE_DESC & | resourceDescription, |
| const xiiD3D12MemoryAllocationCreateInfo & | allocationCreateInfo, | ||
| ID3D12Resource ** | out_ppResource, | ||
| xiiD3D12Allocation * | out_pAllocation ) |
Creates a D3D12 buffer resource with the specified description and memory allocation parameters.
| resourceDescription | - D3D12 resource description defining the buffer properties (size, usage, etc.). |
| allocationCreateInfo | - Parameters that control how memory should be allocated for the buffer, including heap type, flags, and optional user data. |
| out_ppResource | - Output pointer to the created buffer resource. |
| out_pAllocation | - Output pointer to the memory allocation info. |
| xiiResult xiiD3D12MemoryAllocator::CreateImage | ( | const D3D12_RESOURCE_DESC & | resourceDescription, |
| const xiiD3D12MemoryAllocationCreateInfo & | allocationCreateInfo, | ||
| const xiiGALOptimizedClearValue * | pOptimizedClearValue, | ||
| ID3D12Resource ** | out_ppResource, | ||
| xiiD3D12Allocation * | out_pAllocation ) |
Creates a D3D12 image resource with the specified description and memory allocation parameters.
| resourceDescription | - D3D12 resource description defining the image properties (dimensions, format, usage, etc.). |
| allocationCreateInfo | - Parameters that control how memory should be allocated for the image including heap type, flags, and optional user data. |
| pOptimizedClearValue | - Optional pointer to an optimized clear value for render target or depth stencil images, which can improve clear performance. |
| out_ppResource | - Output pointer to the created image resource. |
| out_pAllocation | - Output pointer to the memory allocation info. |
| void xiiD3D12MemoryAllocator::DestroyBuffer | ( | ID3D12Resource *& | pResource, |
| xiiD3D12Allocation & | pAllocation ) |
Destroys a D3D12 buffer resource and frees its associated memory allocation.
| pResource | - Pointer to the buffer resource to destroy. |
| pAllocation | - The memory allocation info for the buffer. |
| void xiiD3D12MemoryAllocator::DestroyImage | ( | ID3D12Resource *& | pResource, |
| xiiD3D12Allocation & | pAllocation ) |
Destroys a D3D12 image resource and frees its associated memory allocation.
| pResource | - Pointer to the image resource to destroy. |
| pAllocation | - The memory allocation info for the image. |
| xiiResult xiiD3D12MemoryAllocator::Initialize | ( | xiiGALDeviceD3D12 * | pDeviceD3D12, |
| xiiUInt32 | uiPreferredBlockSize = 0U ) |
Constructs the memory allocator with D3D12 device.
| pDeviceD3D12 | - The D3D12 device implementation. |
| uiPreferredBlockSize | - Optional preferred block size for allocations (Set to 0 to use default, which is currently 64 MiB.). |