Common: Make HookableEvent use non-static data.

Co-authored-by: Dentomologist <dentomologist@gmail.com>
This commit is contained in:
Jordan Woyak
2025-05-03 02:48:44 -05:00
parent 9c28f19e56
commit f289b06e0d
30 changed files with 263 additions and 175 deletions
+3 -3
View File
@@ -4,7 +4,6 @@
#include "VideoCommon/BPStructs.h"
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
@@ -341,6 +340,8 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
false, false, yScale, s_gammaLUT[PE_copy.gamma], bpmem.triggerEFBCopy.clamp_top,
bpmem.triggerEFBCopy.clamp_bottom, bpmem.copyfilter.GetCoefficients());
auto& system = Core::System::GetInstance();
// This is as closest as we have to an "end of the frame"
// It works 99% of the time.
// But sometimes games want to render an XFB larger than the EFB's 640x528 pixel resolution
@@ -348,7 +349,7 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
// render multiple sub-frames and arrange the XFB copies in next to each-other in main memory
// so they form a single completed XFB.
// See https://dolphin-emu.org/blog/2017/11/19/hybridxfb/ for examples and more detail.
AfterFrameEvent::Trigger(Core::System::GetInstance());
system.GetVideoEvents().after_frame_event.Trigger(system);
// Note: Theoretically, in the future we could track the VI configuration and try to detect
// when an XFB is the last XFB copy of a frame. Not only would we get a clean "end of
@@ -356,7 +357,6 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
// Might also clean up some issues with games doing XFB copies they don't intend to
// display.
auto& system = Core::System::GetInstance();
if (g_ActiveConfig.bImmediateXFB)
{
// TODO: GetTicks is not sane from the GPU thread.