diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-29 00:37:06 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-29 00:37:06 -0400 |
| commit | 322a5afce3d6c5fbcf16ed9a8914805087b33a55 (patch) | |
| tree | 2d99727668fc42fc55d8b075ce52d630600112ea /src/video_core/macro.cpp | |
| parent | 934eeb0e6d82458048c94361b0d7b2db1b89f041 (diff) | |
nx2: macro memo hashes its keys as they are, rewrites re-stored calls in place
The flat map re-hashed the already mixed u64 keys with MSVC's byte-wise
FNV-1a (~1.4% of the GPU thread), and calls stored again after a data
RAM guard failed appended new records, so the arena filled with stale
copies and was cleared every few seconds. EDEN_NX2_MME_MEMO_STATS logs
the counters: in title 1, 97.3% of calls replay, 2.1% fail a guard.
Diffstat (limited to 'src/video_core/macro.cpp')
| -rw-r--r-- | src/video_core/macro.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index ee64ef5ab7..2864d1c5ad 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -1457,6 +1457,17 @@ void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u return value == nullptr || value[0] != '0'; }(); if (use_memo) { + // EDEN_NX2_MME_MEMO_STATS: log the memo's counters every 2^24 calls. + if (static const bool memo_stats = std::getenv("EDEN_NX2_MME_MEMO_STATS") != nullptr; + memo_stats && (++native_calls & 0xffffff) == 0) { + const auto& stats = native_memo.GetStatistics(); + LOG_INFO(HW_GPU, + "Macro memo: {} hits, {} misses, {} guard failures, {} stores ({} in " + "place), {} clears; {} entries, {} KiB", + stats.hits, stats.misses, stats.guard_failures, stats.stores, + stats.overwrites, stats.clears, native_memo.Size(), + native_memo.ArenaWords() * 4 / 1024); + } native_memo.Synchronize(native_code_generation); if (decltype(native_memo)::Effects effects; native_memo.Find(method, parameters, *native_interpreter.active_dram, effects)) { |
