VideoBackends/D3D12: Include HRESULT in error messages

This commit is contained in:
Pokechu22
2021-12-12 13:18:39 -08:00
parent 23cdb5c576
commit 1b32e6dae2
11 changed files with 77 additions and 36 deletions

View File

@ -46,13 +46,14 @@ bool StreamBuffer::AllocateBuffer(u32 size)
HRESULT hr = g_dx_context->GetDevice()->CreateCommittedResource(
&heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc, D3D12_RESOURCE_STATE_GENERIC_READ,
nullptr, IID_PPV_ARGS(&m_buffer));
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to allocate buffer of size {}", size);
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to allocate buffer of size {}: {}", size,
DX12HRWrap(hr));
if (FAILED(hr))
return false;
static const D3D12_RANGE read_range = {};
hr = m_buffer->Map(0, &read_range, reinterpret_cast<void**>(&m_host_pointer));
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to map buffer of size {}", size);
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to map buffer of size {}: {}", size, DX12HRWrap(hr));
if (FAILED(hr))
return false;