diff options
author | bunnei <bunneidev@gmail.com> | 2020-08-05 00:43:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 00:43:42 +0200 |
commit | efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4 (patch) | |
tree | 4cc20138a03ca793b7bf271e2f32fe3957a8114c /src | |
parent | Merge pull request #4450 from Morph1984/fix-gamelist-scanning (diff) | |
parent | renderer_opengl: Use 1/4 of all threads for async shader compilation (diff) | |
download | yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar.gz yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar.bz2 yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar.lz yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar.xz yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.tar.zst yuzu-efd1b57d03637a5a1cfa3ad2d8ae1f9bf5460eb4.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 03e82c599..cb284db77 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -178,16 +178,11 @@ RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWind if (device.UseAsynchronousShaders()) { // Max worker threads we should allow - constexpr auto MAX_THREADS = 2u; - // Amount of threads we should reserve for other parts of yuzu - constexpr auto RESERVED_THREADS = 6u; - // Get the amount of threads we can use(this can return zero) - const auto cpu_thread_count = - std::max(RESERVED_THREADS, std::thread::hardware_concurrency()); - // Deduce how many "extra" threads we have to use. - const auto max_threads_unused = cpu_thread_count - RESERVED_THREADS; + constexpr u32 MAX_THREADS = 4; + // Deduce how many threads we can use + const u32 threads_used = std::thread::hardware_concurrency() / 4; // Always allow at least 1 thread regardless of our settings - const auto max_worker_count = std::max(1u, max_threads_unused); + const auto max_worker_count = std::max(1U, threads_used); // Don't use more than MAX_THREADS const auto worker_count = std::min(max_worker_count, MAX_THREADS); async_shaders.AllocateWorkers(worker_count); |