From 8a236293455e9a71aa6fb400a6253c27540e403b Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 27 Jan 2023 11:34:59 +1300 Subject: 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) --- Source/Core/VideoCommon/VertexManagerBase.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp') diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp index 1ccfebad0c..5f6b8a310e 100644 --- a/Source/Core/VideoCommon/VertexManagerBase.cpp +++ b/Source/Core/VideoCommon/VertexManagerBase.cpp @@ -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() -- cgit v1.2.3