aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache/buffer_cache.h
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 17:08:43 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 17:08:43 -0400
commit55d315c644fdf36405daaf71f75942553a267a6e (patch)
tree5c68632583f18db89e15352ee825a8dc73a57e2a /src/video_core/buffer_cache/buffer_cache.h
parent104381f025772909bb0032d58c47aeeab17a6ef6 (diff)
ASTC: re-compress to BC3 except huge arrays, which stay RGBA8 and trimmed
Title 1 has ~700 ASTC 8x8 textures (~280 MB as stored); decoded to RGBA8 they took ~4.5 GB, pushing Eden past the 8 GB of an RTX 4070 Laptop (8.4-9.8 GB in use) and the texture cache into permanent aggressive collection. With astc_recompression=Bc3 (CPU, asynchronous) they fit (4.6-5.6 GB). The two 8192x8192x68 terrain arrays would still not fit as BC3, so ASTC 2D arrays over 1 GiB as RGBA8 always use the GPU decoder with trimmed levels (RGBA8 host image, UNORM/sRGB views), and the decoder pass now exists whenever the GPU lacks native ASTC. Also logs every 600 frames: device memory against the collector thresholds, the largest images, totals by format, and buffer cache totals. Title screen 65-150 s: 10.1 -> 16.0 fps.
Diffstat (limited to 'src/video_core/buffer_cache/buffer_cache.h')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 126e73c9b6..4df855c0fe 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -10,6 +10,8 @@
#include <memory>
#include <numeric>
#include <stdexcept>
+#include <vector>
+#include <fmt/ranges.h>
#include "common/range_sets.inc"
#include "video_core/buffer_cache/buffer_cache_base.h"
@@ -79,6 +81,20 @@ void BufferCache<P>::TickFrame() {
return;
}
runtime.TickFrame(slot_buffers);
+ if (static u64 frames{}; ++frames % 600 == 0) {
+ u64 total{};
+ size_t count{};
+ std::vector<std::pair<u64, VAddr>> largest;
+ for (const auto [buffer_id, buffer] : slot_buffers) {
+ total += buffer->SizeBytes();
+ ++count;
+ largest.emplace_back(buffer->SizeBytes(), buffer->CpuAddr());
+ }
+ std::partial_sort(largest.begin(), largest.begin() + std::min<size_t>(6, largest.size()),
+ largest.end(), std::greater<>{});
+ LOG_INFO(HW_GPU, "Buffer cache: {} buffers {} MiB; largest {}", count, total >> 20,
+ fmt::join(largest.begin(), largest.begin() + std::min<size_t>(6, largest.size()), ", "));
+ }
// Calculate hits and shots and move hit bits to the right
const u32 hits = std::reduce(channel_state->uniform_cache_hits.begin(),