vk: Ensure async scheduler thread is never auto-spawned by fxo

- This thread is a resource hog for design reasons.
This commit is contained in:
kd-11 2021-06-16 23:20:05 +03:00 committed by kd-11
parent 4bf9700562
commit 9fadd48ea3
3 changed files with 11 additions and 3 deletions

View File

@ -12,6 +12,14 @@ namespace vk
{ {
void AsyncTaskScheduler::operator()() 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(); init_config_options();
if (!m_use_host_scheduler) if (!m_use_host_scheduler)
{ {

View File

@ -73,7 +73,7 @@ namespace vk
void insert_sync_event(); void insert_sync_event();
public: public:
AsyncTaskScheduler() = default; AsyncTaskScheduler(const std::string_view& name) : thread_name(name) {} // This ctor stops default initialization by fxo
~AsyncTaskScheduler(); ~AsyncTaskScheduler();
command_buffer* get_current(); command_buffer* get_current();
@ -86,7 +86,7 @@ namespace vk
// Thread entry-point // Thread entry-point
void operator()(); void operator()();
static constexpr auto thread_name = "Vulkan Async Scheduler"sv; const std::string_view thread_name;
}; };
using async_scheduler_thread = named_thread<AsyncTaskScheduler>; using async_scheduler_thread = named_thread<AsyncTaskScheduler>;

View File

@ -592,7 +592,7 @@ VKGSRender::VKGSRender() : GSRender()
if (backend_config.supports_asynchronous_compute) if (backend_config.supports_asynchronous_compute)
{ {
// Run only if async compute can be used. // Run only if async compute can be used.
g_fxo->init<vk::async_scheduler_thread>(); g_fxo->init<vk::async_scheduler_thread>("Vulkan Async Scheduler"sv);
} }
} }
} }