diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-11-23 02:17:22 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | b2b2e046696e9c187cd9d7d4e3e92dc521082fe5 (patch) | |
| tree | a3354f5b2e50f9cefeb7c77330f40fa4db8be46a /Ryujinx.Graphics.Gpu/Image | |
| parent | 3ac023bb607eb630e86859cba0d3ebac55f4257a (diff) | |
Small optimizations on texture and sampler pool invalidation
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/SamplerPool.cs | 9 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 13 |
2 files changed, 15 insertions, 7 deletions
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<Sampler> { + 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]; 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<TexturePool> 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]; |
