summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ameerj2022-01-27 15:31:43 -0500
committerGravatar ameerj2022-01-27 15:31:43 -0500
commitf300a1d54be6b61f3f8667f1578bf42361f210dc (patch)
tree7e4af4bcb376b01e344e2347b4da3de42991e205
parentMerge pull request #7783 from lioncash/abi-cexpr (diff)
downloadyuzu-f300a1d54be6b61f3f8667f1578bf42361f210dc.tar.gz
yuzu-f300a1d54be6b61f3f8667f1578bf42361f210dc.tar.xz
yuzu-f300a1d54be6b61f3f8667f1578bf42361f210dc.zip
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 '')
-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 43bed63ac..048dba4f3 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
1474 // When this memory region has been joined a bunch of times, we assume it's being used 1474 // When this memory region has been joined a bunch of times, we assume it's being used
1475 // as a stream buffer. Increase the size to skip constantly recreating buffers. 1475 // as a stream buffer. Increase the size to skip constantly recreating buffers.
1476 has_stream_leap = true; 1476 has_stream_leap = true;
1477 begin -= PAGE_SIZE * 256;
1478 cpu_addr = begin;
1477 end += PAGE_SIZE * 256; 1479 end += PAGE_SIZE * 256;
1478 } 1480 }
1479 } 1481 }