diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 8 |
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 | |||
| 1243 | if (!cpu_addr || size == 0) { | 1243 | if (!cpu_addr || size == 0) { |
| 1244 | return NULL_BINDING; | 1244 | return NULL_BINDING; |
| 1245 | } | 1245 | } |
| 1246 | // HACK(Rodrigo): This is the number of bytes bound in host beyond the guest API's range. | ||
| 1247 | // It exists due to some games like Astral Chain operate out of bounds. | ||
| 1248 | // Binding the whole map range would be technically correct, but games have large maps that make | ||
| 1249 | // this approach unaffordable for now. | ||
| 1250 | static constexpr u32 arbitrary_extra_bytes = 0xc000; | ||
| 1251 | const u32 bytes_to_map_end = static_cast<u32>(gpu_memory.BytesToMapEnd(gpu_addr)); | ||
| 1246 | const Binding binding{ | 1252 | const Binding binding{ |
| 1247 | .cpu_addr = *cpu_addr, | 1253 | .cpu_addr = *cpu_addr, |
| 1248 | .size = size, | 1254 | .size = std::min(size + arbitrary_extra_bytes, bytes_to_map_end), |
| 1249 | .buffer_id = BufferId{}, | 1255 | .buffer_id = BufferId{}, |
| 1250 | }; | 1256 | }; |
| 1251 | return binding; | 1257 | return binding; |