VideoBackends:D3D12: Use COMMON as initial state for default heap buffer

Fixes the following error in the D3D12 debug layer:

D3D12 WARNING: ID3D12Device::CreateCommittedResource:
Ignoring InitialState D3D12_RESOURCE_STATE_UNORDERED_ACCESS.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.
[ STATE_CREATION WARNING #1328: CREATERESOURCE_STATE_IGNORED]
This commit is contained in:
Robin Kertels 2022-10-29 09:49:52 +02:00
parent 22fecb41fc
commit a6aa651291
No known key found for this signature in database
GPG Key ID: 3824904F14D40757
1 changed files with 2 additions and 2 deletions

View File

@ -101,8 +101,8 @@ bool D3D12BoundingBox::CreateBuffers()
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS};
HRESULT hr = g_dx_context->GetDevice()->CreateCommittedResource(
&gpu_heap_properties, D3D12_HEAP_FLAG_NONE, &buffer_desc,
D3D12_RESOURCE_STATE_UNORDERED_ACCESS, nullptr, IID_PPV_ARGS(&m_gpu_buffer));
&gpu_heap_properties, D3D12_HEAP_FLAG_NONE, &buffer_desc, D3D12_RESOURCE_STATE_COMMON,
nullptr, IID_PPV_ARGS(&m_gpu_buffer));
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating bounding box GPU buffer failed: {}", DX12HRWrap(hr));
if (FAILED(hr) || !g_dx_context->GetDescriptorHeapManager().Allocate(&m_gpu_descriptor))
return false;