-
Notifications
You must be signed in to change notification settings - Fork 434
Memory Management
In DirectX 12, the application is responsible for much of the graphics memory management much as it is for system memory. This includes managing CPU/GPU synchronization and ensuring that resources are not modified by the CPU while the GPU is using them or vice-versa.
For the DirectX Tool Kit for DirectX 12 this is primarily handled through two classes: GraphicsMemory and ResourceUploadBatch.
The primary use of the GraphicsMemory class is to allocate constant buffers from a D3D12_HEAP_TYPE_UPLOAD
heap. CBs can persist for many frames, or be used for a single frame, but they must remain unchanged until their usage is completed. GraphicsMemory
tracks this using a per-frame fence which is reclaimed each frame as they complete during the Present
loop. CBs are in memory shared between the CPU and GPU as they are used for communication between CPU code and GPU shaders.
UNDER DEVELOPMENT
Typically textures are created as ID3D12Resource
interfaces as committed memory in the D3D12_HEAP_TYPE_DEFAULT
heap, requiring a D3D12_HEAP_TYPE_UPLOAD
heap to transfer data from the CPU to the GPU memory which is often managed by the ResourceUploadBatch class. For more information see Textures.
Direct3D 12 does support 'sparse textures'. For more information see the D3D12ReservedResources sample for PC / UWP
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Xbox One
- Xbox Series X|S
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- MinGW 12.2, 13.2
- CMake 3.20