mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -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()
|
||||
|
Reference in New Issue
Block a user