Add per-source type memory change tracking, simplified state change tracking, other fixes

This commit is contained in:
gdk 2019-10-26 14:50:52 -03:00 committed by Thog
parent 1b7d955195
commit 8cba252b23
40 changed files with 494 additions and 668 deletions

View file

@ -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++)
{

View file

@ -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)

View file

@ -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);
}
}

View file

@ -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;

View file

@ -0,0 +1,10 @@
namespace Ryujinx.Graphics.Gpu.Memory
{
public enum ResourceName
{
Buffer,
Texture,
TexturePool,
SamplerPool
}
}