Split AbstractGfx out of Renderer

Almost all the virtual functions in Renderer are part of dolphin's
"graphics api abstraction layer", which has slowly formed over the
last decade or two.

Most of the work was done previously with the introduction of the
various "AbstractX" classes, associated with texture cache cleanups
and implementation of newer graphics APIs (Direct3D 12, Vulkan, Metal).
We are simply taking the last step and yeeting these functions out
of Renderer.

This "AbstractGfx" class is now completely agnostic of any details
from the flipper/hollywood GPU we are emulating, though somewhat
specialized.

(Will not build, this commit only contains changes outside VideoBackends)
This commit is contained in:
Scott Mansell
2023-01-27 11:34:59 +13:00
parent e57eb04ed3
commit 8a23629345
21 changed files with 645 additions and 531 deletions

View File

@ -17,6 +17,7 @@
#include "Core/DolphinAnalytics.h"
#include "Core/System.h"
#include "VideoCommon/AbstractGfx.h"
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/DataReader.h"
@ -329,7 +330,7 @@ void VertexManagerBase::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 ba
g_renderer->BBoxFlush();
}
g_renderer->DrawIndexed(base_index, num_indices, base_vertex);
g_gfx->DrawIndexed(base_index, num_indices, base_vertex);
}
void VertexManagerBase::UploadUniforms()
@ -599,7 +600,7 @@ void VertexManagerBase::Flush()
UpdatePipelineObject();
if (m_current_pipeline_object)
{
g_renderer->SetPipeline(m_current_pipeline_object);
g_gfx->SetPipeline(m_current_pipeline_object);
if (PerfQueryBase::ShouldEmulate())
g_perf_query->EnableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP);
@ -877,7 +878,7 @@ void VertexManagerBase::OnDraw()
u32 diff = m_draw_counter - m_last_efb_copy_draw_counter;
if (m_unflushed_efb_copy && diff > MINIMUM_DRAW_CALLS_PER_COMMAND_BUFFER_FOR_READBACK)
{
g_renderer->Flush();
g_gfx->Flush();
m_unflushed_efb_copy = false;
m_last_efb_copy_draw_counter = m_draw_counter;
}
@ -892,7 +893,7 @@ void VertexManagerBase::OnDraw()
m_scheduled_command_buffer_kicks.end(), m_draw_counter))
{
// Kick a command buffer on the background thread.
g_renderer->Flush();
g_gfx->Flush();
m_unflushed_efb_copy = false;
m_last_efb_copy_draw_counter = m_draw_counter;
}
@ -927,7 +928,7 @@ void VertexManagerBase::OnEFBCopyToRAM()
}
m_unflushed_efb_copy = false;
g_renderer->Flush();
g_gfx->Flush();
}
void VertexManagerBase::OnEndFrame()