VideoBackends/D3D: Eliminate CHECK in favor of ASSERT_MSG

This commit is contained in:
Pokechu22
2021-11-10 15:55:33 -08:00
parent 161c627466
commit 82acfa6a46
17 changed files with 74 additions and 64 deletions

View File

@ -3,6 +3,7 @@
#include "VideoBackends/D3D12/D3D12BoundingBox.h"
#include "Common/Assert.h"
#include "Common/Logging/Log.h"
#include "VideoBackends/D3D12/D3D12Renderer.h"
@ -41,7 +42,7 @@ std::vector<BBoxType> D3D12BoundingBox::Read(u32 index, u32 length)
static constexpr D3D12_RANGE read_range = {0, BUFFER_SIZE};
void* mapped_pointer;
HRESULT hr = m_readback_buffer->Map(0, &read_range, &mapped_pointer);
CHECK(SUCCEEDED(hr), "Map bounding box CPU buffer");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Map bounding box CPU buffer failed");
if (FAILED(hr))
return values;
@ -102,7 +103,7 @@ bool D3D12BoundingBox::CreateBuffers()
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));
CHECK(SUCCEEDED(hr), "Creating bounding box GPU buffer failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating bounding box GPU buffer failed");
if (FAILED(hr) || !g_dx_context->GetDescriptorHeapManager().Allocate(&m_gpu_descriptor))
return false;
@ -115,7 +116,7 @@ bool D3D12BoundingBox::CreateBuffers()
hr = g_dx_context->GetDevice()->CreateCommittedResource(
&cpu_heap_properties, D3D12_HEAP_FLAG_NONE, &buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST,
nullptr, IID_PPV_ARGS(&m_readback_buffer));
CHECK(SUCCEEDED(hr), "Creating bounding box CPU buffer failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating bounding box CPU buffer failed");
if (FAILED(hr))
return false;