From a6aa6512917d5ff33c8c864445e55d47a9176ead Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sat, 29 Oct 2022 09:49:52 +0200 Subject: [PATCH] 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] --- Source/Core/VideoBackends/D3D12/D3D12BoundingBox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/D3D12/D3D12BoundingBox.cpp b/Source/Core/VideoBackends/D3D12/D3D12BoundingBox.cpp index 75b3f6064a..4eec9f2e22 100644 --- a/Source/Core/VideoBackends/D3D12/D3D12BoundingBox.cpp +++ b/Source/Core/VideoBackends/D3D12/D3D12BoundingBox.cpp @@ -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;