aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2022-01-27 15:31:43 -0500
committerameerj <52414509+ameerj@users.noreply.github.com>2022-01-27 15:31:43 -0500
commit9bffee169bfed6c889095f8daf81404151d65fae (patch)
tree7e4af4bcb376b01e344e2347b4da3de42991e205 /src/video_core/buffer_cache
parent6c0cc7303f3b6a77ef1e27f1f06aa123cdcf20bb (diff)
buffer_cache: Reduce stream buffer allocations when expanding from the left
The existing stream buffer optimization accounts for size increases at the end of the allocated buffer. This adds the same optimization, increasing the size from the beginning of the buffer as well to reduce buffer allocations when expanding the same buffer from the left.
Diffstat (limited to 'src/video_core/buffer_cache')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 43bed63ac2..048dba4f33 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -1474,6 +1474,8 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(VAddr cpu
// When this memory region has been joined a bunch of times, we assume it's being used
// as a stream buffer. Increase the size to skip constantly recreating buffers.
has_stream_leap = true;
+ begin -= PAGE_SIZE * 256;
+ cpu_addr = begin;
end += PAGE_SIZE * 256;
}
}