diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-10-26 14:50:52 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 8cba252b238ee6cf6599ad2fc57793e6f76c5e2e (patch) | |
| tree | 5ee98eb374a46e210d4a960f5e1d58b42b3f27eb /Ryujinx.Graphics.Gpu/Memory | |
| parent | 1b7d95519569639135a68e7ebda5148f3263217c (diff) | |
Add per-source type memory change tracking, simplified state change tracking, other fixes
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/BufferManager.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/ResourceName.cs | 10 |
5 files changed, 19 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index 30bd1ac0..6f904d0f 100644 --- a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -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++) { diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 3ceee206..6d7fab68 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -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) diff --git a/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs b/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs index 5f21704d..73b3a9e1 100644 --- a/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs +++ b/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs @@ -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); } }
\ No newline at end of file diff --git a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs index d1a3e69c..59319a47 100644 --- a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs @@ -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; diff --git a/Ryujinx.Graphics.Gpu/Memory/ResourceName.cs b/Ryujinx.Graphics.Gpu/Memory/ResourceName.cs new file mode 100644 index 00000000..9476a384 --- /dev/null +++ b/Ryujinx.Graphics.Gpu/Memory/ResourceName.cs @@ -0,0 +1,10 @@ +namespace Ryujinx.Graphics.Gpu.Memory +{ + public enum ResourceName + { + Buffer, + Texture, + TexturePool, + SamplerPool + } +}
\ No newline at end of file |
