diff options
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 |
