Apply suggestions from code review

Co-authored-by: Mai <mathew1800@gmail.com>
Co-authored-by: BhaaL <bhaalsen@gmail.com>
Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
This commit is contained in:
Scott Mansell
2023-02-03 13:18:37 +13:00
parent e0a1631659
commit 60f2b5af7b
18 changed files with 44 additions and 31 deletions

View File

@ -98,7 +98,7 @@ private:
std::mutex m_screenshot_lock;
std::string m_screenshot_name;
EventHook m_frame_end_handle;
Common::EventHook m_frame_end_handle;
};
extern std::unique_ptr<FrameDumper> g_frame_dumper;

View File

@ -238,7 +238,7 @@ protected:
std::vector<EFBPokeVertex> m_color_poke_vertices;
std::vector<EFBPokeVertex> m_depth_poke_vertices;
EventHook m_end_of_frame_event;
Common::EventHook m_end_of_frame_event;
};
extern std::unique_ptr<FramebufferManager> g_framebuffer_manager;

View File

@ -54,7 +54,7 @@ private:
std::unordered_set<std::string> m_groups;
EventHook m_end_of_frame_event;
Common::EventHook m_end_of_frame_event;
};
extern std::unique_ptr<GraphicsModManager> g_graphics_mod_manager;

View File

@ -252,7 +252,7 @@ private:
// Texture decoding shaders
std::map<std::pair<u32, u32>, std::unique_ptr<AbstractShader>> m_texture_decoding_shaders;
EventHook m_frame_end_handler;
Common::EventHook m_frame_end_handler;
};
} // namespace VideoCommon

View File

@ -18,10 +18,10 @@
Statistics g_stats;
static EventHook s_before_frame_event =
static Common::EventHook s_before_frame_event =
BeforeFrameEvent::Register([] { g_stats.ResetFrame(); }, "Statistics::ResetFrame");
static EventHook s_after_frame_event = AfterFrameEvent::Register(
static Common::EventHook s_after_frame_event = AfterFrameEvent::Register(
[] {
DolphinAnalytics::PerformanceSample perf_sample;
perf_sample.speed_ratio = SystemTimers::GetEstimatedEmulationPerformance();

View File

@ -780,10 +780,10 @@ void TextureCacheBase::OnFrameEnd()
// Flush any outstanding EFB copies to RAM, in case the game is running at an uncapped frame
// rate and not waiting for vblank. Otherwise, we'd end up with a huge list of pending
// copies.
g_texture_cache->FlushEFBCopies();
FlushEFBCopies();
}
g_texture_cache->Cleanup(g_presenter->FrameCount());
Cleanup(g_presenter->FrameCount());
}
void TCacheEntry::DoState(PointerWrap& p)

View File

@ -123,8 +123,8 @@ struct TCacheEntry
bool is_efb_copy = false;
bool is_custom_tex = false;
bool may_have_overlapping_textures = true;
bool has_arbitrary_mips = false; // indicates that the mips in this texture are arbitrary
// content, aren't just downscaled
// indicates that the mips in this texture are arbitrary content, aren't just downscaled
bool has_arbitrary_mips = false;
bool should_force_safe_hashing = false; // for XFB
bool is_xfb_copy = false;
bool is_xfb_container = false;
@ -438,7 +438,8 @@ private:
void OnFrameEnd();
Common::Flag m_force_reload_textures;
EventHook m_frame_event = AfterFrameEvent::Register([this] { OnFrameEnd(); }, "TextureCache");
Common::EventHook m_frame_event =
AfterFrameEvent::Register([this] { OnFrameEnd(); }, "TextureCache");
};
extern std::unique_ptr<TextureCacheBase> g_texture_cache;

View File

@ -230,7 +230,7 @@ private:
std::vector<u32> m_scheduled_command_buffer_kicks;
bool m_allow_background_execution = true;
EventHook m_frame_end_event;
Common::EventHook m_frame_end_event;
};
extern std::unique_ptr<VertexManagerBase> g_vertex_manager;

View File

@ -355,5 +355,5 @@ void CheckForConfigChanges()
// TODO: Move everything else to the ConfigChanged event
}
static EventHook s_check_config_event =
static Common::EventHook s_check_config_event =
AfterFrameEvent::Register([] { CheckForConfigChanges(); }, "CheckForConfigChanges");

View File

@ -7,16 +7,16 @@
#include "Common/EventHook.h"
// Called when certain video config setting are changed
using ConfigChangedEvent = Event<"ConfigChanged", u32>;
using ConfigChangedEvent = Common::Event<"ConfigChanged", u32>;
// An event called just before the first draw call of a frame
using BeforeFrameEvent = Event<"BeforeFrame">;
using BeforeFrameEvent = Common::Event<"BeforeFrame">;
// An event called after the frame XFB copy begins processing on the host GPU.
// Useful for "once per frame" usecases.
// Note: In a few rare cases, games do multiple XFB copies per frame and join them while presenting.
// If this matters to your usecase, you should use BeforePresent instead.
using AfterFrameEvent = Event<"AfterFrame">;
using AfterFrameEvent = Common::Event<"AfterFrame">;
struct PresentInfo
{
@ -76,8 +76,8 @@ struct PresentInfo
// frame.
//
// frame_count: The number of frames
using BeforePresentEvent = Event<"BeforePresent", PresentInfo&>;
using BeforePresentEvent = Common::Event<"BeforePresent", PresentInfo&>;
// An event that is triggered after a frame is presented.
// The exact timing of this event depends on backend/driver support.
using AfterPresentEvent = Event<"AfterPresent", PresentInfo&>;
using AfterPresentEvent = Common::Event<"AfterPresent", PresentInfo&>;

View File

@ -27,8 +27,8 @@ private:
bool m_is_game_widescreen = false;
bool m_was_orthographically_anamorphic = false;
EventHook m_update_widescreen;
EventHook m_config_changed;
Common::EventHook m_update_widescreen;
Common::EventHook m_config_changed;
};
extern std::unique_ptr<WidescreenManager> g_widescreen;