rjx-mirror/src/Ryujinx.Graphics.Gpu/Memory
riperiperi ecbf303266
GPU: Avoid using garbage size for non-cb0 storage buffers (#4999)
* GPU: Avoid using garbage size for non-cb0 storage buffers

In the depths area, Tears of the Kingdom uses a global memory access with address on constant buffer slot 6. This isn't standard and thus doesn't actually have a size 8 bytes after it, so we were reading back a garbage size that ended up very large (at least in version 1.1.0), and would synchronize a lot of data per frame.

This PR makes storage buffers created from addresses outside constant buffer slot 0 get their size as the number of bytes remaining in the GPU mapping starting at the given virtual address. This should bound the buffer to a reasonable size, and ideally stop it crossing into other memory.

* Limit max size

* Add TODO

* Feedback
2023-05-18 08:56:34 +02:00
..
Buffer.cs GPU: Remove CPU region handle containers (#4817) 2023-05-05 23:40:46 +02:00
BufferBounds.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferCache.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferCacheEntry.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferManager.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferMigration.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferModifiedRangeList.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
BufferTextureBinding.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
CounterCache.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
GpuRegionHandle.cs GPU: Remove CPU region handle containers (#4817) 2023-05-05 23:40:46 +02:00
IndexBuffer.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
MemoryManager.cs GPU: Avoid using garbage size for non-cb0 storage buffers (#4999) 2023-05-18 08:56:34 +02:00
MultiRangeWritableBlock.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
PhysicalMemory.cs GPU: Remove CPU region handle containers (#4817) 2023-05-05 23:40:46 +02:00
PteKind.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ResourceKind.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
UnmapEventArgs.cs GPU: Fix errors handling texture remapping (#4745) 2023-05-01 15:32:32 -03:00
VertexBuffer.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00