Move utiltily drawing out of RenderBase

This commit is contained in:
Scott Mansell 2023-01-30 04:02:55 +13:00
parent 99d3e489ea
commit 55d15bdd6e
3 changed files with 5 additions and 18 deletions

View File

@ -7,6 +7,7 @@
#include "VideoCommon/AbstractFramebuffer.h" #include "VideoCommon/AbstractFramebuffer.h"
#include "VideoCommon/AbstractTexture.h" #include "VideoCommon/AbstractTexture.h"
#include "VideoCommon/BPFunctions.h"
#include "VideoCommon/FramebufferManager.h" #include "VideoCommon/FramebufferManager.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
#include "VideoCommon/ShaderCache.h" #include "VideoCommon/ShaderCache.h"
@ -22,14 +23,14 @@ bool AbstractGfx::IsHeadless() const
void AbstractGfx::BeginUtilityDrawing() void AbstractGfx::BeginUtilityDrawing()
{ {
if (g_renderer) g_vertex_manager->Flush();
g_renderer->BeginUtilityDrawing();
} }
void AbstractGfx::EndUtilityDrawing() void AbstractGfx::EndUtilityDrawing()
{ {
if (g_renderer) // Reset framebuffer/scissor/viewport. Pipeline will be reset at next draw.
g_renderer->EndUtilityDrawing(); g_framebuffer_manager->BindEFBFramebuffer();
BPFunctions::SetScissorAndViewport();
} }
void AbstractGfx::SetFramebuffer(AbstractFramebuffer* framebuffer) void AbstractGfx::SetFramebuffer(AbstractFramebuffer* framebuffer)

View File

@ -95,18 +95,6 @@ bool Renderer::Initialize()
return true; return true;
} }
void Renderer::BeginUtilityDrawing()
{
g_vertex_manager->Flush();
}
void Renderer::EndUtilityDrawing()
{
// Reset framebuffer/scissor/viewport. Pipeline will be reset at next draw.
g_framebuffer_manager->BindEFBFramebuffer();
BPFunctions::SetScissorAndViewport();
}
bool Renderer::EFBHasAlphaChannel() const bool Renderer::EFBHasAlphaChannel() const
{ {
return m_prev_efb_format == PixelFormat::RGBA6_Z24; return m_prev_efb_format == PixelFormat::RGBA6_Z24;

View File

@ -68,8 +68,6 @@ public:
virtual bool Initialize(); virtual bool Initialize();
void BeginUtilityDrawing();
void EndUtilityDrawing();
// Ideal internal resolution - multiple of the native EFB resolution // Ideal internal resolution - multiple of the native EFB resolution
int GetTargetWidth() const { return m_target_width; } int GetTargetWidth() const { return m_target_width; }
int GetTargetHeight() const { return m_target_height; } int GetTargetHeight() const { return m_target_height; }