diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 17:15:59 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-28 17:15:59 -0400 |
| commit | 32e5578d7a19aaf4ebca4e25eb0dbf87a7ab0ab9 (patch) | |
| tree | 4aa238053cd9735c09b1a20113017a48c229f697 /src/video_core/textures/workers.cpp | |
| parent | 55d315c644fdf36405daaf71f75942553a267a6e (diff) | |
ASTC transcode pool: an eighth of the hardware threads (at least 2)
With half (8 on a Ryzen 7 8845HS), re-compressing streamed ASTC textures to
BC3 took ~3.5 cores away from the six emulated cores and the GPU thread.
Title 1 attract loop, 65-150 s: 8 threads 16.0 fps, 4 threads 12.6, 2
threads 18.9 (scene noise is large). EDEN_NX2_TRANSCODE_THREADS overrides.
Diffstat (limited to 'src/video_core/textures/workers.cpp')
| -rw-r--r-- | src/video_core/textures/workers.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/video_core/textures/workers.cpp b/src/video_core/textures/workers.cpp index a1953c4bf4..6922634e30 100644 --- a/src/video_core/textures/workers.cpp +++ b/src/video_core/textures/workers.cpp @@ -4,13 +4,22 @@ // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include <cstdlib> + #include "video_core/textures/workers.h" namespace Tegra::Texture { Common::ThreadWorker& GetThreadWorkers() { - static Common::ThreadWorker workers{(std::max)(std::thread::hardware_concurrency(), 2U) / 2, - "ImageTranscode"}; + // An eighth of the hardware threads (at least 2): with half, re-compressing streamed ASTC + // textures took ~3.5 cores from the emulated CPU cores and the GPU thread on an 8-core + // laptop. EDEN_NX2_TRANSCODE_THREADS=<n> overrides. + static Common::ThreadWorker workers{[] { + if (const char* text = std::getenv("EDEN_NX2_TRANSCODE_THREADS")) { + return (std::max)(static_cast<u32>(std::strtoul(text, nullptr, 10)), 1U); + } + return (std::max)(std::thread::hardware_concurrency() / 8, 2U); + }(), "ImageTranscode"}; return workers; } |
