From 262ecda2bfc826b11ceb36c561ac3404d2bfecf9 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 3 Feb 2023 04:40:11 +0300 Subject: [PATCH] rsx/overlays: Cache the loading animated icon Smooths out some frametime spikes when showing the notification message --- .../Overlays/overlay_shader_compile_notification.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp b/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp index d1d4cd7e6a..c008c97043 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_shader_compile_notification.cpp @@ -7,14 +7,22 @@ namespace rsx { namespace overlays { + static std::shared_ptr s_loading_icon24; + void show_shader_compile_notification() { + if (!s_loading_icon24) + { + // Creating the icon requires FS read, so it is important to cache it + s_loading_icon24 = std::make_shared(); + } + queue_message( localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS, 5'000'000, {}, message_pin_location::bottom, - std::make_shared()); + s_loading_icon24); } } }