From b2b2e046696e9c187cd9d7d4e3e92dc521082fe5 Mon Sep 17 00:00:00 2001 From: gdk Date: Sat, 23 Nov 2019 02:17:22 -0300 Subject: Small optimizations on texture and sampler pool invalidation --- Ryujinx.Graphics.Gpu/Image/SamplerPool.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Image/SamplerPool.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs index 970a0983..55555109 100644 --- a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs +++ b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs @@ -5,6 +5,8 @@ namespace Ryujinx.Graphics.Gpu.Image { class SamplerPool : Pool { + private int _sequenceNumber; + public SamplerPool(GpuContext context, ulong address, int maximumId) : base(context, address, maximumId) { } public override Sampler Get(int id) @@ -14,7 +16,12 @@ namespace Ryujinx.Graphics.Gpu.Image return null; } - SynchronizeMemory(); + if (_sequenceNumber != Context.SequenceNumber) + { + _sequenceNumber = Context.SequenceNumber; + + SynchronizeMemory(); + } Sampler sampler = Items[id]; -- cgit v1.2.3