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/TexturePool.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePool.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index 8512e370..6014f07c 100644 --- a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -11,11 +11,7 @@ namespace Ryujinx.Graphics.Gpu.Image { public LinkedListNode CacheNode { get; set; } - private struct TextureContainer - { - public Texture Texture0 { get; set; } - public Texture Texture1 { get; set; } - } + private int _sequenceNumber; public TexturePool( GpuContext context, @@ -29,7 +25,12 @@ namespace Ryujinx.Graphics.Gpu.Image return null; } - SynchronizeMemory(); + if (_sequenceNumber != Context.SequenceNumber) + { + _sequenceNumber = Context.SequenceNumber; + + SynchronizeMemory(); + } Texture texture = Items[id]; -- cgit v1.2.3