diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-18 00:40:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 00:40:34 +0200 |
commit | f912a82a8efe9a699fef74acb0db9f1779295c32 (patch) | |
tree | 716cce6c0c286c224f3eeb196cdb1bbb4a42850e /src/video_core/memory_manager.cpp | |
parent | Merge pull request #1498 from lioncash/aslr (diff) | |
parent | gl_rasterizer_cache: Remove unnecessary block_depth=1 on Flush. (diff) | |
download | yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar.gz yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar.bz2 yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar.lz yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar.xz yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.tar.zst yuzu-f912a82a8efe9a699fef74acb0db9f1779295c32.zip |
Diffstat (limited to 'src/video_core/memory_manager.cpp')
-rw-r--r-- | src/video_core/memory_manager.cpp | 10 |
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; |