Global memory emulation using NV_shader_buffer_store and VK_EXT_buffer_device_address

* Make global memory emulation work on OpenGL again

* Shader cache version bump
This commit is contained in:
gdkchan
2026-09-07 04:10:47 -05:00
committed by KeatonTheBot
parent 81c9052847
commit dbf78ba55e
52 changed files with 1013 additions and 53 deletions
+12 -2
View File
@@ -27,7 +27,6 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// Must lock for any access from other threads.
/// </remarks>
private readonly RangeList<Buffer> _buffers;
private Buffer[] _bufferOverlaps;
private readonly Dictionary<ulong, BufferCacheEntry> _dirtyCache;
@@ -395,6 +394,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
return GetBuffer(address, size, write).GetRange(address, size);
}
public ulong GetBufferHostGpuAddress(ulong address, ulong size, bool write = false)
{
return GetBuffer(address, size, write).GetHostGpuAddress(address);
}
/// <summary>
/// Gets a buffer for a given memory range.
/// A buffer overlapping with the specified range is assumed to already exist on the cache.
@@ -431,13 +435,19 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// </summary>
/// <param name="address">Start address of the memory range</param>
/// <param name="size">Size in bytes of the memory range</param>
public void SynchronizeBufferRange(ulong address, ulong size)
/// <param name="write">Whether the buffer will be written to by this use</param>
public void SynchronizeBufferRange(ulong address, ulong size, bool write = false)
{
if (size != 0)
{
Buffer buffer = _buffers.FindFirstOverlap(address, size);
buffer.SynchronizeMemory(address, size);
if (write)
{
buffer.SignalModified(address, size);
}
}
}