summaryrefslogtreecommitdiffstats
path: root/src/video_core/memory_manager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-13 03:52:16 +0200
committerbunnei <bunneidev@gmail.com>2018-10-16 17:31:00 +0200
commit37575eae654c1cbcf63724107a77a03ffc114e5a (patch)
tree0841d1e681cf999a7a36a477990b76fe24bc4af6 /src/video_core/memory_manager.cpp
parentrasterizer_cache: Reintroduce method for flushing. (diff)
downloadyuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar.gz
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar.bz2
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar.lz
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar.xz
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.tar.zst
yuzu-37575eae654c1cbcf63724107a77a03ffc114e5a.zip
Diffstat (limited to 'src/video_core/memory_manager.cpp')
-rw-r--r--src/video_core/memory_manager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index ca923d17d..022d4ab74 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -87,6 +87,16 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) {
return gpu_addr;
}
+GPUVAddr MemoryManager::GetRegionEnd(GPUVAddr region_start) const {
+ for (const auto& region : mapped_regions) {
+ const GPUVAddr region_end{region.gpu_addr + region.size};
+ if (region_start >= region.gpu_addr && region_start < region_end) {
+ return region_end;
+ }
+ }
+ return {};
+}
+
boost::optional<GPUVAddr> MemoryManager::FindFreeBlock(u64 size, u64 align) {
GPUVAddr gpu_addr = 0;
u64 free_space = 0;