aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 05:46:59 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-29 20:49:47 -0400
commitb905580202f0da5ca0a6268b176b4591e347fd8d (patch)
tree679fdd043eee8f437b988a652b4c6e18aa9da186 /src/video_core/buffer_cache
parenta99484f3cb6a78eed8563ac67551ab1ea0d0c0c3 (diff)
video_core: compact the macro memo arena; download profiling counters
Calls stored again with another shape leave their old record in the memo's arena; title 1 filled its 16 MiB every ~2 s and clearing it made the next ~20,000 calls interpret again. The live records are now copied to a new arena (a clear only when they alone fill three quarters of it). The memo statistics count hits on the last call's slot and compactions. With EDEN_NX2_GPU_PROFILE the GPU thread also reports how much downloaded buffer data lands on pages the native MME has DMA-read.
Diffstat (limited to 'src/video_core/buffer_cache')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index e2de0eede1..b909971e42 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -679,6 +679,19 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
Buffer& buffer = slot_buffers[buffer_id];
second_copy.src_offset = static_cast<size_t>(buffer.CpuAddr()) + copy.src_offset;
const DAddr orig_device_addr = static_cast<DAddr>(second_copy.src_offset);
+ if (Nx2Profile::Enabled()) {
+ u64 on_dma_pages = 0;
+ const auto& pages = Nx2Profile::DmaReadPages();
+ for (DAddr page = orig_device_addr >> 12; page <= (orig_device_addr + copy.size - 1) >> 12;
+ ++page) {
+ if (pages.contains(page)) {
+ const DAddr begin = (std::max)(orig_device_addr, page << 12);
+ const DAddr end = (std::min)(orig_device_addr + copy.size, (page + 1) << 12);
+ on_dma_pages += end - begin;
+ }
+ }
+ Nx2Profile::Add(Nx2Profile::Counter::DownloadBytesOnDmaPages, on_dma_pages);
+ }
async_downloads.Add(orig_device_addr, copy.size);
buffer.MarkUsage(copy.src_offset, copy.size);
runtime.CopyBuffer(download_staging.buffer, buffer, copies, false);