diff options
| author | 2020-08-05 12:53:26 -0400 | |
|---|---|---|
| committer | 2020-08-16 12:02:22 -0400 | |
| commit | 1b829fbd7a36f9c2b553b04aa39bdf8135d30458 (patch) | |
| tree | b843deb06496541b1e611832ddf54c4492f0849c /src/video_core/renderer_vulkan | |
| parent | Address feedback, add shader compile notifier, update setting text (diff) | |
| download | yuzu-1b829fbd7a36f9c2b553b04aa39bdf8135d30458.tar.gz yuzu-1b829fbd7a36f9c2b553b04aa39bdf8135d30458.tar.xz yuzu-1b829fbd7a36f9c2b553b04aa39bdf8135d30458.zip | |
move thread 1/4 count computation into allocate workers method
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 720802ad5..936f76195 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -405,17 +405,7 @@ RasterizerVulkan::RasterizerVulkan(Core::System& system, Core::Frontend::EmuWind | |||
| 405 | wfi_event{device.GetLogical().CreateNewEvent()}, async_shaders{renderer} { | 405 | wfi_event{device.GetLogical().CreateNewEvent()}, async_shaders{renderer} { |
| 406 | scheduler.SetQueryCache(query_cache); | 406 | scheduler.SetQueryCache(query_cache); |
| 407 | if (device.UseAsynchronousShaders()) { | 407 | if (device.UseAsynchronousShaders()) { |
| 408 | // The following is subject to move into the allocate workers method, to be api agnostic | 408 | async_shaders.AllocateWorkers(); |
| 409 | |||
| 410 | // Max worker threads we should allow | ||
| 411 | constexpr u32 MAX_THREADS = 4; | ||
| 412 | // Deduce how many threads we can use | ||
| 413 | const auto threads_used = std::thread::hardware_concurrency() / 4; | ||
| 414 | // Always allow at least 1 thread regardless of our settings | ||
| 415 | const auto max_worker_count = std::max(1U, threads_used); | ||
| 416 | // Don't use more than MAX_THREADS | ||
| 417 | const auto worker_count = std::min(max_worker_count, MAX_THREADS); | ||
| 418 | async_shaders.AllocateWorkers(worker_count); | ||
| 419 | } | 409 | } |
| 420 | } | 410 | } |
| 421 | 411 | ||