microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.44k stars 369 forks source link

Add CreateUploadBuffer and CreateUAVBuffer helpers #189

Closed walbourn closed 8 months ago

walbourn commented 8 months ago

The CreateStaticBuffer helper is designed to create a DEFAULT resource and initialize it with data uploaded via a ResourceUploadBatch.

This PR adds CreateUploadBuffer which creates an UPLOAD resource and initializes it via a direct Map/Unmap cycle since it's CPU accessible. If you pass a nullptr for the data, it just creates the UPLOAD resource.

This also adds CreateUAVBuffer which is just a simple way to create a UAV resource since that's common for DXR and DirectCompute scenarios.

walbourn commented 8 months ago

Test Suite updates in this PR.