VideoCommon: Abstract bounding box

This moves much of the duplicated bounding box code into VideoCommon,
leaving only the specific buffer implementations in each backend.
This commit is contained in:
Techjar
2021-06-09 07:42:21 -04:00
parent 7ec02ee4d3
commit 1161af8059
41 changed files with 617 additions and 708 deletions

View File

@ -46,17 +46,11 @@ bool Renderer::Initialize()
if (!::Renderer::Initialize())
return false;
m_bounding_box = BoundingBox::Create();
if (!m_bounding_box)
return false;
SetPixelShaderUAV(m_bounding_box->GetGPUDescriptor().cpu_handle);
return true;
}
void Renderer::Shutdown()
{
m_bounding_box.reset();
m_swap_chain.reset();
::Renderer::Shutdown();
@ -107,20 +101,9 @@ std::unique_ptr<AbstractPipeline> Renderer::CreatePipeline(const AbstractPipelin
return DXPipeline::Create(config, cache_data, cache_data_length);
}
u16 Renderer::BBoxReadImpl(int index)
std::unique_ptr<BoundingBox> Renderer::CreateBoundingBox() const
{
return static_cast<u16>(m_bounding_box->Get(index));
}
void Renderer::BBoxWriteImpl(int index, u16 value)
{
m_bounding_box->Set(index, value);
}
void Renderer::BBoxFlushImpl()
{
m_bounding_box->Flush();
m_bounding_box->Invalidate();
return std::make_unique<D3D12BoundingBox>();
}
void Renderer::Flush()