mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-02 02:52:25 -07:00
Add per-source type memory change tracking, simplified state change tracking, other fixes
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
return;
|
||||
}
|
||||
|
||||
(ulong, ulong)[] modifiedRanges = _context.PhysicalMemory.GetModifiedRanges(address, size);
|
||||
(ulong, ulong)[] modifiedRanges = _context.PhysicalMemory.GetModifiedRanges(address, size, ResourceName.Buffer);
|
||||
|
||||
for (int index = 0; index < modifiedRanges.Length; index++)
|
||||
{
|
||||
|
@@ -116,9 +116,13 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
|
||||
ulong address = TranslateAndCreateBuffer(gpuVa, size);
|
||||
|
||||
_gpStorageBuffers[stage].Bind(index, address, size);
|
||||
if (_gpStorageBuffers[stage].Buffers[index].Address != address ||
|
||||
_gpStorageBuffers[stage].Buffers[index].Size != size)
|
||||
{
|
||||
_gpStorageBuffersDirty = true;
|
||||
}
|
||||
|
||||
_gpStorageBuffersDirty = true;
|
||||
_gpStorageBuffers[stage].Bind(index, address, size);
|
||||
}
|
||||
|
||||
public void SetComputeUniformBuffer(int index, ulong gpuVa, ulong size)
|
||||
|
@@ -10,6 +10,6 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
|
||||
void Write(ulong address, Span<byte> data);
|
||||
|
||||
(ulong, ulong)[] GetModifiedRanges(ulong address, ulong size);
|
||||
(ulong, ulong)[] GetModifiedRanges(ulong address, ulong size, ResourceName name);
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
||||
|
||||
private const int PtLvl0Bits = 14;
|
||||
private const int PtLvl1Bits = 14;
|
||||
private const int PtPageBits = 12;
|
||||
public const int PtPageBits = 12;
|
||||
|
||||
private const ulong PtLvl0Size = 1UL << PtLvl0Bits;
|
||||
private const ulong PtLvl1Size = 1UL << PtLvl1Bits;
|
||||
|
10
Ryujinx.Graphics.Gpu/Memory/ResourceName.cs
Normal file
10
Ryujinx.Graphics.Gpu/Memory/ResourceName.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
{
|
||||
public enum ResourceName
|
||||
{
|
||||
Buffer,
|
||||
Texture,
|
||||
TexturePool,
|
||||
SamplerPool
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user