aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/textures/workers.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 03:39:52 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 03:39:52 -0400
commite17fd9cef116a088f080ca502951e500864a58b6 (patch)
treee7ff65f614622515d6a2e4263521909eea89a5d8 /src/video_core/textures/workers.cpp
parentea6c1193fbfa95e586bb6d129dc684163a12cb3e (diff)
parent80c79333fe6fd28a31b65b997f1cbf2987711c91 (diff)
Merge Switch 2 work from local Eden (nx2 at b0dd3fe)
Diffstat (limited to 'src/video_core/textures/workers.cpp')
-rw-r--r--src/video_core/textures/workers.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/video_core/textures/workers.cpp b/src/video_core/textures/workers.cpp
index a1953c4bf4..e3a0f26cf2 100644
--- a/src/video_core/textures/workers.cpp
+++ b/src/video_core/textures/workers.cpp
@@ -4,13 +4,23 @@
// 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"};
+ // A quarter of the hardware threads (at least 2). Half took ~3.5 cores from the emulated
+ // CPU cores and the GPU thread on an 8-core laptop when textures were thrashing; with an
+ // eighth (2) both threads stayed saturated and streamed textures arrived seconds late (shown
+ // as placeholders), while 4 cost no frame rate. 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() / 4, 2U);
+ }(), "ImageTranscode"};
return workers;
}