Update documentation with a warning about memory containing garbage data not zeros

This commit is contained in:
Adam Sawicki 2019-11-05 16:29:45 +01:00
parent 9586dbdced
commit 87528d084a

View File

@ -116,7 +116,7 @@ including choice of `D3D12_HEAP_TYPE`.
The function also returns a new object of type D3D12MA::Allocation, created along The function also returns a new object of type D3D12MA::Allocation, created along
with usual `ID3D12Resource`. It represents allocated memory and can be queried with usual `ID3D12Resource`. It represents allocated memory and can be queried
for size, offset, and `ID3D12Heap` if needed. for size, offset, `ID3D12Resource`, and `ID3D12Heap` if needed.
\code \code
D3D12_RESOURCE_DESC resourceDesc = {}; D3D12_RESOURCE_DESC resourceDesc = {};
@ -161,6 +161,11 @@ it, at different offsets, using `ID3D12Device::CreatePlacedResource`. The librar
manages its own collection of allocated memory blocks (heaps) and remembers which manages its own collection of allocated memory blocks (heaps) and remembers which
parts of them are occupied and which parts are free to be used for new resources. parts of them are occupied and which parts are free to be used for new resources.
It is important to remember that resources created as placed don't have their memory
initialized to zeros, but may contain garbage data, so they need to be fully initialized
before usage, e.g. using Clear (`ClearRenderTargetView`), Discard (`DiscardResource`),
or copy (`CopyResource`).
The library also automatically handles resource heap tier. The library also automatically handles resource heap tier.
When `D3D12_FEATURE_DATA_D3D12_OPTIONS::ResourceHeapTier` equals `D3D12_RESOURCE_HEAP_TIER_1`, When `D3D12_FEATURE_DATA_D3D12_OPTIONS::ResourceHeapTier` equals `D3D12_RESOURCE_HEAP_TIER_1`,
resources of 3 types: buffers, textures that are render targets or depth-stencil, resources of 3 types: buffers, textures that are render targets or depth-stencil,