summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-10-29 00:25:11 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2025-10-31 13:27:50 -0500
commitee7c476e24d59af2c6b8e24486cd08ff09946112 (patch)
treec4e95333a7d2465fa10c955fbb0812c754d9166c /Source/Core/VideoCommon/BPStructs.cpp
parentb920182c97703b3df0fcb44cebdd6d1cc5485fcc (diff)
VideoCommon: move global variables out of BPFunctions
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 9679ed6237..dd0cd59570 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -381,7 +381,19 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
// Clear the rectangular region after copying it.
if (PE_copy.clear)
{
- ClearScreen(srcRect);
+ const bool color_enable = bpmem.blendmode.color_update != 0;
+ const bool alpha_enable = bpmem.blendmode.alpha_update != 0;
+ const bool z_enable = bpmem.zmode.update_enable != 0;
+ const auto pixel_format = bpmem.zcontrol.pixel_format;
+ const auto color_ar = bpmem.clearcolorAR;
+ const auto color_gb = bpmem.clearcolorGB;
+ const auto z_value = bpmem.clearZValue;
+ ClearScreen(g_framebuffer_manager.get(), srcRect, color_enable, alpha_enable, z_enable,
+ pixel_format, color_ar, color_gb, z_value);
+
+ // Scissor rect must be restored.
+ BPFunctions::SetScissorAndViewport(g_framebuffer_manager.get(), bpmem.scissorTL,
+ bpmem.scissorBR, bpmem.scissorOffset, xfmem.viewport);
}
return;
@@ -523,7 +535,8 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
return;
case BPMEM_ZCOMPARE: // Set the Z-Compare and EFB pixel format
- OnPixelFormatChange();
+ OnPixelFormatChange(g_framebuffer_manager.get(), bpmem.zcontrol.pixel_format,
+ bpmem.zcontrol.zformat);
if (bp.changes & 7)
SetBlendMode(); // dual source could be activated by changing to PIXELFMT_RGBA6_Z24
pixel_shader_manager.SetZModeControl();
@@ -1355,8 +1368,10 @@ void BPReload()
// let's not risk actually replaying any writes.
// note that PixelShaderManager is already covered since it has its own DoState.
SetGenerationMode();
- SetScissorAndViewport();
+ BPFunctions::SetScissorAndViewport(g_framebuffer_manager.get(), bpmem.scissorTL, bpmem.scissorBR,
+ bpmem.scissorOffset, xfmem.viewport);
SetDepthMode();
SetBlendMode();
- OnPixelFormatChange();
+ OnPixelFormatChange(g_framebuffer_manager.get(), bpmem.zcontrol.pixel_format,
+ bpmem.zcontrol.zformat);
}