aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/textures/workers.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 20:43:01 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 20:43:01 -0400
commit0d5534a2883329183ae8aa89b3fe1c7b67291ece (patch)
treeaabad4260f301a8a52af16e15e7fb76a700d642f /src/video_core/textures/workers.cpp
parente4deef6ba4ea76aac997ed3102f8e9801fd170b9 (diff)
ASTC: decode and re-compress to BC1/BC3 on the GPU; texture cache budget
- accelerate_astc=Gpu with astc_recompression=Bc1/Bc3 now decodes ASTC with the GPU decoder into a temporary RGBA8 image (dedicated memory, freed once the GPU is past it) and compresses it with a new compute shader (bc_encoder.comp: bounding-box endpoints along the colours' covariance, inset 1/16, nearest palette entry; BC3 alpha ramp; BC1 punch-through), then copies the blocks into the image. No CPU decode, so streamed textures are ready the frame they are first used instead of showing placeholders for seconds; the decode pass no longer waits for the GPU on this path. - The CPU path (CpuAsynchronous) fills a new image with zero blocks before its first decode instead of showing stale VRAM, and the transcode pool is a quarter of the hardware threads. - Switch 2 titles: collector thresholds near the device budget, re-read every 60 frames from VK_EXT_memory_budget (another game shrank it from 7.0 to 5.4 GB). - EDEN_NX2_HIDE_WINDOW=0 now leaves the window visible.
Diffstat (limited to 'src/video_core/textures/workers.cpp')
-rw-r--r--src/video_core/textures/workers.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/textures/workers.cpp b/src/video_core/textures/workers.cpp
index 6922634e30..e3a0f26cf2 100644
--- a/src/video_core/textures/workers.cpp
+++ b/src/video_core/textures/workers.cpp
@@ -11,14 +11,15 @@
namespace Tegra::Texture {
Common::ThreadWorker& GetThreadWorkers() {
- // 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.
+ // 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() / 8, 2U);
+ return (std::max)(std::thread::hardware_concurrency() / 4, 2U);
}(), "ImageTranscode"};
return workers;
}