From 6b7185676d59976bf02f6666368032067ff344bc Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Thu, 29 Oct 2026 07:05:03 -0400 Subject: common: pass-through hash for integer and pointer keys; RangeSet::Intersects Common::unordered_map/set defaulted to std::hash, a byte-wise FNV-1a on MSVC for integers and pointers, which boost's flat containers then mix again: the GPU thread's page maps (shader and query cache invalidation, per inline upload) spent ~1% in it. Integer and pointer keys now go through as they are and boost mixes them. BufferCache::IsRegionGpuModified visited every GPU-written range inside the query just to answer yes or no; without per-fence downloads those ranges stay fragmented and it was ~4% of title 1's GPU thread (inline uploads). RangeSet::Intersects answers with one lookup. Inline uploads: 10.5% -> 7.5% of the GPU thread. --- src/video_core/buffer_cache/buffer_cache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/video_core/buffer_cache/buffer_cache.h') diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 0a6b53b33b..c6fc5989b7 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -746,9 +746,9 @@ void BufferCache
::PopAsyncBuffers() {
template ::IsRegionGpuModified(DAddr addr, size_t size) {
- bool is_dirty = false;
- gpu_modified_ranges.ForEachInRange(addr, size, [&](DAddr, DAddr) { is_dirty = true; });
- return is_dirty;
+ // One lookup instead of visiting every range inside (~4% of the GPU thread for title 1's
+ // inline uploads once GPU-written ranges are no longer cleared by downloads).
+ return gpu_modified_ranges.Intersects(addr, size);
}
template