summaryrefslogtreecommitdiffstats
path: root/src/video_core/memory_manager.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-05-21 17:24:20 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:38:33 +0200
commitbdf9faab331cd79ca5c5e51c2369fc801e8cecea (patch)
tree09b45767f5e9a72319db7b3184dc9b70120d4ea2 /src/video_core/memory_manager.cpp
parenttexture_cache: return null surface on invalid address (diff)
downloadyuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.gz
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.bz2
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.lz
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.xz
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.zst
yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/memory_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 5d8d126c1..322453116 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -202,11 +202,12 @@ const u8* MemoryManager::GetPointer(GPUVAddr addr) const {
}
bool MemoryManager::IsBlockContinuous(const GPUVAddr start, const std::size_t size) const {
- const GPUVAddr end = start + size;
+ const std::size_t inner_size = size - 1;
+ const GPUVAddr end = start + inner_size;
const auto host_ptr_start = reinterpret_cast<std::uintptr_t>(GetPointer(start));
const auto host_ptr_end = reinterpret_cast<std::uintptr_t>(GetPointer(end));
const auto range = static_cast<std::size_t>(host_ptr_end - host_ptr_start);
- return range == size;
+ return range == inner_size;
}
void MemoryManager::ReadBlock(GPUVAddr src_addr, void* dest_buffer, const std::size_t size) const {