diff --git a/rpcs3/Emu/RSX/GL/GLOverlays.cpp b/rpcs3/Emu/RSX/GL/GLOverlays.cpp index 22d2f26d66..b0f20c3b72 100644 --- a/rpcs3/Emu/RSX/GL/GLOverlays.cpp +++ b/rpcs3/Emu/RSX/GL/GLOverlays.cpp @@ -498,6 +498,12 @@ namespace gl saved_sampler_state save_30(30, m_sampler); saved_sampler_state save_31(31, m_sampler); + if (ui.status_flags & rsx::overlays::status_bits::invalidate_image_cache) + { + remove_temp_resources(ui.uid); + ui.status_flags.clear(rsx::overlays::status_bits::invalidate_image_cache); + } + for (auto& cmd : ui.get_compiled().draw_commands) { set_primitive_type(cmd.config.primitives); diff --git a/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp index 675f560327..ecfd0b1dbf 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_media_list_dialog.cpp @@ -264,6 +264,11 @@ namespace rsx rsx_log.notice("Media dialog: showing entry '%s' ('%s')", m_media->name, m_media->path); + if (m_list) + { + status_flags |= status_bits::invalidate_image_cache; + } + m_list = std::make_unique(1240, 540); m_list->set_pos(20, 85); diff --git a/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h index d774de437b..745544542b 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -7,6 +7,8 @@ #include "Utilities/mutex.h" #include "Utilities/Timer.h" +#include "../Common/bitfield.hpp" + #include #include @@ -16,6 +18,12 @@ namespace rsx { namespace overlays { + // Bitfield of UI signals to overlay manager + enum status_bits : u32 + { + invalidate_image_cache = 0x0001, // Flush the address-based image cache + }; + // Non-interactable UI element struct overlay { @@ -27,6 +35,7 @@ namespace rsx u32 min_refresh_duration_us = 16600; atomic_t visible = false; + atomic_bitmask_t status_flags = {}; virtual ~overlay() = default; @@ -92,6 +101,7 @@ namespace rsx pad_button::ls_left, pad_button::ls_right }; + atomic_t m_stop_input_loop = false; atomic_t m_interactive = false; bool m_start_pad_interception = true; diff --git a/rpcs3/Emu/RSX/VK/VKOverlays.cpp b/rpcs3/Emu/RSX/VK/VKOverlays.cpp index 670e393677..17481ad646 100644 --- a/rpcs3/Emu/RSX/VK/VKOverlays.cpp +++ b/rpcs3/Emu/RSX/VK/VKOverlays.cpp @@ -740,6 +740,12 @@ namespace vk vk::null_image_view(cmd, VK_IMAGE_VIEW_TYPE_2D_ARRAY) }; + if (ui.status_flags & rsx::overlays::status_bits::invalidate_image_cache) + { + remove_temp_resources(ui.uid); + ui.status_flags.clear(rsx::overlays::status_bits::invalidate_image_cache); + } + for (auto& command : ui.get_compiled().draw_commands) { num_drawable_elements = static_cast(command.verts.size());