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

CreateUploadBuffer never needs initialState #222

Closed walbourn closed 3 months ago

walbourn commented 3 months ago

The CreateUploadBuffer helper does not need to take initialState since it must always be D3D12_RESOURCE_STATE_GENERIC_READ.

D3D12 ERROR: [0x965A3E39] ID3D12Device::CreateCommittedResource: Certain heaps are restricted to certain D3D12_RESOURCE_STATES states, and cannot be changed.
D3D12_HEAP_TYPE_UPLOAD requires D3D12_RESOURCE_STATE_GENERIC_READ.
D3D12_HEAP_TYPE_READBACK requires D3D12_RESOURCE_STATE_COPY_DEST.  [ RESOURCE_MANIPULATION ERROR #742 ]
walbourn commented 3 months ago

Test update https://github.com/walbourn/directxtk12test/commit/00b35e53163ea96b5df9de8c16296d5233ac0388