From 956db3366f55bbfb8e7560bb0628d23efe139dab Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Wed, 1 May 2024 04:25:22 -0400 Subject: [PATCH] Moved UI resource destruction to RT64 deinit hook, temporarily disabled shader cache as it's out of date --- lib/rt64 | 2 +- src/ui/ui_renderer.cpp | 11 +++++------ ultramodern/rt64_layer.cpp | 11 ++++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/rt64 b/lib/rt64 index 92ae002..611d26a 160000 --- a/lib/rt64 +++ b/lib/rt64 @@ -1 +1 @@ -Subproject commit 92ae002acf9c344fed5575d6def79fb6a8207181 +Subproject commit 611d26a7c8254d15f8aa9250969e3357feea5e64 diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index 6dfe54e..0f913c5 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -1379,7 +1379,11 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s } void deinit_hook() { - + std::lock_guard lock {ui_context_mutex}; + Rml::Debugger::Shutdown(); + Rml::Shutdown(); + ui_context->rml.unload(); + ui_context.reset(); } void set_rt64_hooks() { @@ -1398,11 +1402,6 @@ void recomp::set_config_submenu(recomp::ConfigSubmenu submenu) { } void recomp::destroy_ui() { - std::lock_guard lock {ui_context_mutex}; - Rml::Debugger::Shutdown(); - Rml::Shutdown(); - ui_context->rml.unload(); - ui_context.reset(); } recomp::Menu recomp::get_current_menu() { diff --git a/ultramodern/rt64_layer.cpp b/ultramodern/rt64_layer.cpp index 2e9e3d2..e56a2fa 100644 --- a/ultramodern/rt64_layer.cpp +++ b/ultramodern/rt64_layer.cpp @@ -179,7 +179,7 @@ ultramodern::RT64Context::RT64Context(uint8_t* rdram, ultramodern::WindowHandle #ifdef _WIN32 thread_id = window_handle.thread_id; #endif - if (!app->setup(thread_id)) { + if (app->setup(thread_id) != RT64::Application::SetupResult::Success) { app = nullptr; return; } @@ -249,10 +249,11 @@ void ultramodern::RT64Context::load_shader_cache(std::span cache_bin // TODO figure out how to avoid a copy here. std::istringstream cache_stream{std::string{cache_binary.data(), cache_binary.size()}}; - if (!app->rasterShaderCache->loadOfflineList(cache_stream)) { - printf("Failed to preload shader cache!\n"); - assert(false); - } + // TODO update shader cache + //if (!app->rasterShaderCache->loadOfflineList(cache_stream)) { + // printf("Failed to preload shader cache!\n"); + // assert(false); + //} } RT64::UserConfiguration::Antialiasing ultramodern::RT64MaxMSAA() {