diff options
| author | Scott Mansell <phiren@gmail.com> | 2023-02-09 19:59:16 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-09 19:59:16 +1300 |
| commit | ccf92a3e56764d6378c436a8040519a5bffc3372 (patch) | |
| tree | e2b330b225044e1901e77a6ed147cf21b9d7ac0e /Source/Core/VideoCommon/BPFunctions.cpp | |
| parent | 72b22ef0a54f841b1c52d49cf0e00d3b12c29ac7 (diff) | |
| parent | 5c1b3ac61d7e660a9d1c206dbd0e615d637d3272 (diff) | |
Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
Diffstat (limited to 'Source/Core/VideoCommon/BPFunctions.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPFunctions.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index c065f1cc5f..ad9898b27e 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -12,11 +12,13 @@ #include "Common/Logging/Log.h" #include "VideoCommon/AbstractFramebuffer.h" +#include "VideoCommon/AbstractGfx.h" #include "VideoCommon/BPMemory.h" #include "VideoCommon/FramebufferManager.h" #include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderState.h" #include "VideoCommon/VertexManagerBase.h" +#include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" #include "VideoCommon/XFMemory.h" @@ -157,11 +159,11 @@ ScissorResult::ScissorResult(const BPMemory& bpmemory, std::pair<float, float> v for (const auto& x_range : x_ranges) { DEBUG_ASSERT(x_range.start < x_range.end); - DEBUG_ASSERT(x_range.end <= EFB_WIDTH); + DEBUG_ASSERT(static_cast<u32>(x_range.end) <= EFB_WIDTH); for (const auto& y_range : y_ranges) { DEBUG_ASSERT(y_range.start < y_range.end); - DEBUG_ASSERT(y_range.end <= EFB_HEIGHT); + DEBUG_ASSERT(static_cast<u32>(y_range.end) <= EFB_HEIGHT); m_result.emplace_back(x_range, y_range); } } @@ -197,10 +199,9 @@ void SetScissorAndViewport() { auto native_rc = ComputeScissorRects().Best(); - auto target_rc = g_renderer->ConvertEFBRectangle(native_rc.rect); - auto converted_rc = - g_renderer->ConvertFramebufferRectangle(target_rc, g_renderer->GetCurrentFramebuffer()); - g_renderer->SetScissorRect(converted_rc); + auto target_rc = g_framebuffer_manager->ConvertEFBRectangle(native_rc.rect); + auto converted_rc = g_gfx->ConvertFramebufferRectangle(target_rc, g_gfx->GetCurrentFramebuffer()); + g_gfx->SetScissorRect(converted_rc); float raw_x = (xfmem.viewport.xOrig - native_rc.x_off) - xfmem.viewport.wd; float raw_y = (xfmem.viewport.yOrig - native_rc.y_off) + xfmem.viewport.ht; @@ -216,10 +217,10 @@ void SetScissorAndViewport() raw_height = std::round(raw_height); } - float x = g_renderer->EFBToScaledXf(raw_x); - float y = g_renderer->EFBToScaledYf(raw_y); - float width = g_renderer->EFBToScaledXf(raw_width); - float height = g_renderer->EFBToScaledYf(raw_height); + float x = g_framebuffer_manager->EFBToScaledXf(raw_x); + float y = g_framebuffer_manager->EFBToScaledYf(raw_y); + float width = g_framebuffer_manager->EFBToScaledXf(raw_width); + float height = g_framebuffer_manager->EFBToScaledYf(raw_height); float min_depth = (xfmem.viewport.farZ - xfmem.viewport.zRange) / 16777216.0f; float max_depth = xfmem.viewport.farZ / 16777216.0f; if (width < 0.f) @@ -246,7 +247,7 @@ void SetScissorAndViewport() max_depth = std::clamp(max_depth, 0.0f, GX_MAX_DEPTH); } - if (g_renderer->UseVertexDepthRange()) + if (VertexShaderManager::UseVertexDepthRange()) { // We need to ensure depth values are clamped the maximum value supported by the console GPU. // Taking into account whether the depth range is inverted or not. @@ -280,9 +281,9 @@ void SetScissorAndViewport() // Lower-left flip. if (g_ActiveConfig.backend_info.bUsesLowerLeftOrigin) - y = static_cast<float>(g_renderer->GetCurrentFramebuffer()->GetHeight()) - y - height; + y = static_cast<float>(g_gfx->GetCurrentFramebuffer()->GetHeight()) - y - height; - g_renderer->SetViewport(x, y, width, height, near_depth, far_depth); + g_gfx->SetViewport(x, y, width, height, near_depth, far_depth); } void SetDepthMode() @@ -342,7 +343,7 @@ void ClearScreen(const MathUtil::Rectangle<int>& rc) color = RGBA8ToRGB565ToRGBA8(color); z = Z24ToZ16ToZ24(z); } - g_renderer->ClearScreen(rc, colorEnable, alphaEnable, zEnable, color, z); + g_framebuffer_manager->ClearEFB(rc, colorEnable, alphaEnable, zEnable, color, z); } } @@ -364,9 +365,9 @@ void OnPixelFormatChange() if (!g_ActiveConfig.bEFBEmulateFormatChanges) return; - const auto old_format = g_renderer->GetPrevPixelFormat(); + const auto old_format = g_framebuffer_manager->GetPrevPixelFormat(); const auto new_format = bpmem.zcontrol.pixel_format; - g_renderer->StorePixelFormat(new_format); + g_framebuffer_manager->StorePixelFormat(new_format); DEBUG_LOG_FMT(VIDEO, "pixelfmt: pixel={}, zc={}", new_format, bpmem.zcontrol.zformat); |
