summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-01-23 02:17:23 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-02-13 06:18:38 +0100
commit0b8b9614426d099be7c5a02c147c9f97631c1c2f (patch)
tree1c16841c05a82fa3dc1fc4154219ae9d4dc04c2f
parentMerge branch 'bytes-to-map-end' into new-bufcache-wip (diff)
downloadyuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar.gz
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar.bz2
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar.lz
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar.xz
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.tar.zst
yuzu-0b8b9614426d099be7c5a02c147c9f97631c1c2f.zip
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index a296036f4..2a6844ab1 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -1243,9 +1243,15 @@ typename BufferCache<P>::Binding BufferCache<P>::StorageBufferBinding(GPUVAddr s
if (!cpu_addr || size == 0) {
return NULL_BINDING;
}
+ // HACK(Rodrigo): This is the number of bytes bound in host beyond the guest API's range.
+ // It exists due to some games like Astral Chain operate out of bounds.
+ // Binding the whole map range would be technically correct, but games have large maps that make
+ // this approach unaffordable for now.
+ static constexpr u32 arbitrary_extra_bytes = 0xc000;
+ const u32 bytes_to_map_end = static_cast<u32>(gpu_memory.BytesToMapEnd(gpu_addr));
const Binding binding{
.cpu_addr = *cpu_addr,
- .size = size,
+ .size = std::min(size + arbitrary_extra_bytes, bytes_to_map_end),
.buffer_id = BufferId{},
};
return binding;