diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 6ec28192a6..8aeade13fa 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -76,9 +76,7 @@ void GLGSRender::on_init_thread() m_frame->delete_context(ctx); }; - int thread_count = g_cfg.video.shader_compiler_threads_count; - if (!thread_count) thread_count = -1; - gl::initialize_pipe_compiler(context_create_func, context_bind_func, context_destroy_func, thread_count); + gl::initialize_pipe_compiler(context_create_func, context_bind_func, context_destroy_func, g_cfg.video.shader_compiler_threads_count); } else { diff --git a/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp index 72a02b7948..4125b9dcb1 100644 --- a/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp +++ b/rpcs3/Emu/RSX/GL/GLPipelineCompiler.cpp @@ -94,15 +94,19 @@ namespace gl std::function context_destroy_func, int num_worker_threads) { - if (num_worker_threads == -1) + if (num_worker_threads == 0) { // Select optimal number of compiler threads const auto hw_threads = std::thread::hardware_concurrency(); - if (hw_threads >= 12) + if (hw_threads > 12) + { + num_worker_threads = 6; + } + else if (hw_threads > 8) { num_worker_threads = 4; } - else if (hw_threads >= 8) + else if (hw_threads == 8) { num_worker_threads = 2; } diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 5e1f755906..da14209c74 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -473,10 +473,8 @@ VKGSRender::VKGSRender() : GSRender() null_buffer = std::make_unique(*m_device, 32, memory_map.device_local, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, 0); null_buffer_view = std::make_unique(*m_device, null_buffer->value, VK_FORMAT_R8_UINT, 0, 32); - int thread_count = g_cfg.video.shader_compiler_threads_count; - if (!thread_count) thread_count = -1; vk::initialize_compiler_context(); - vk::initialize_pipe_compiler(thread_count); + vk::initialize_pipe_compiler(g_cfg.video.shader_compiler_threads_count); if (g_cfg.video.overlay) { diff --git a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp index fdba500f2a..f357eeef8d 100644 --- a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp +++ b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp @@ -182,15 +182,19 @@ namespace vk void initialize_pipe_compiler(int num_worker_threads) { - if (num_worker_threads == -1) + if (num_worker_threads == 0) { // Select optimal number of compiler threads const auto hw_threads = std::thread::hardware_concurrency(); - if (hw_threads >= 12) + if (hw_threads > 12) + { + num_worker_threads = 6; + } + else if (hw_threads > 8) { num_worker_threads = 4; } - else if (hw_threads >= 8) + else if (hw_threads == 8) { num_worker_threads = 2; }