GPUDevice: Improve pipeline error reporting

This commit is contained in:
Stenzek
2024-07-22 15:35:28 +10:00
parent deed0c9713
commit ba6b65401d
24 changed files with 227 additions and 163 deletions

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#include "d3d12_stream_buffer.h"
@ -6,6 +6,7 @@
#include "common/align.h"
#include "common/assert.h"
#include "common/error.h"
#include "common/log.h"
#include "D3D12MemAlloc.h"
@ -21,7 +22,7 @@ D3D12StreamBuffer::~D3D12StreamBuffer()
Destroy();
}
bool D3D12StreamBuffer::Create(u32 size)
bool D3D12StreamBuffer::Create(u32 size, Error* error)
{
const D3D12_RESOURCE_DESC resource_desc = {
D3D12_RESOURCE_DIMENSION_BUFFER, 0, size, 1, 1, 1, DXGI_FORMAT_UNKNOWN, {1, 0}, D3D12_TEXTURE_LAYOUT_ROW_MAJOR,
@ -38,7 +39,7 @@ bool D3D12StreamBuffer::Create(u32 size)
IID_PPV_ARGS(buffer.GetAddressOf()));
if (FAILED(hr)) [[unlikely]]
{
ERROR_LOG("CreateResource() failed: {:08X}", static_cast<unsigned>(hr));
Error::SetHResult(error, "CreateResource() for stream buffer failed: ", hr);
return false;
}
@ -47,7 +48,7 @@ bool D3D12StreamBuffer::Create(u32 size)
hr = buffer->Map(0, &read_range, reinterpret_cast<void**>(&host_pointer));
if (FAILED(hr)) [[unlikely]]
{
ERROR_LOG("Map() failed: {:08X}", static_cast<unsigned>(hr));
Error::SetHResult(error, "Map() for stream buffer failed: ", hr);
return false;
}