From 90487ddf17321c44e883640ba45ff4cd89b9654f Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 16 Jun 2021 23:19:12 +0300 Subject: [PATCH 1/2] rsx: Remove unused variable leftover from refactoring --- rpcs3/Emu/RSX/Common/surface_store.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/surface_store.h b/rpcs3/Emu/RSX/Common/surface_store.h index a18c25d2caea..54d0b82848a2 100644 --- a/rpcs3/Emu/RSX/Common/surface_store.h +++ b/rpcs3/Emu/RSX/Common/surface_store.h @@ -327,8 +327,6 @@ namespace rsx for (const auto& e : list2) surface_info.push_back(e); } - // TODO: Modify deferred_clip_region::direct_copy() to take a few more things into account! - const auto pitch = new_surface->get_rsx_pitch(); for (const auto &e: surface_info) { auto this_address = e.first; From e63c86e8813b86cb8dff7c892c8a4e5f757cc5dd Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 16 Jun 2021 23:20:05 +0300 Subject: [PATCH 2/2] vk: Ensure async scheduler thread is never auto-spawned by fxo - This thread is a resource hog for design reasons. --- rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp | 8 ++++++++ rpcs3/Emu/RSX/VK/VKAsyncScheduler.h | 4 ++-- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp index 5f08968fd6c6..6e0649058281 100644 --- a/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp +++ b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.cpp @@ -12,6 +12,14 @@ namespace vk { void AsyncTaskScheduler::operator()() { + if (g_cfg.video.renderer != video_renderer::vulkan || !g_cfg.video.vk.asynchronous_texture_streaming) + { + // Invalid renderer combination, do not proceed. This should never happen. + // NOTE: If managed by fxo, this object may be created automatically on boot. + rsx_log.notice("Vulkan async streaming is disabled. This thread will now exit."); + return; + } + init_config_options(); if (!m_use_host_scheduler) { diff --git a/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h index 73d6d223ae33..b85370d9597b 100644 --- a/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h +++ b/rpcs3/Emu/RSX/VK/VKAsyncScheduler.h @@ -73,7 +73,7 @@ namespace vk void insert_sync_event(); public: - AsyncTaskScheduler() = default; + AsyncTaskScheduler(const std::string_view& name) : thread_name(name) {} // This ctor stops default initialization by fxo ~AsyncTaskScheduler(); command_buffer* get_current(); @@ -86,7 +86,7 @@ namespace vk // Thread entry-point void operator()(); - static constexpr auto thread_name = "Vulkan Async Scheduler"sv; + const std::string_view thread_name; }; using async_scheduler_thread = named_thread; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 62bf8ddb8a2f..26f7f511db34 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -592,7 +592,7 @@ VKGSRender::VKGSRender() : GSRender() if (backend_config.supports_asynchronous_compute) { // Run only if async compute can be used. - g_fxo->init(); + g_fxo->init("Vulkan Async Scheduler"sv); } } }