From 24df92140d13ec1be75409cddb188419523c04c3 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sun, 2 Feb 2020 17:09:46 +0000 Subject: [PATCH] Remove locking. --- Ryujinx.Graphics.Gpu/Image/TextureManager.cs | 26 ++++++-------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs index 7c953f46ac..0095ccc7bb 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs @@ -600,10 +600,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// The texture that was modified. private void CacheTextureModified(Texture texture) { - lock (_modified) - { - _modified.Add(texture); - } + _modified.Add(texture); } /// @@ -740,16 +737,12 @@ namespace Ryujinx.Graphics.Gpu.Image /// public void Flush() { - lock (_modified) + foreach (Texture texture in _modified) { - foreach (Texture texture in _modified) + if (texture.Info.IsLinear) { - if (texture.Info.IsLinear) - { - texture.Flush(); - } + texture.Flush(); } - _modified.Clear(); } } @@ -760,17 +753,14 @@ namespace Ryujinx.Graphics.Gpu.Image /// The range size public void Flush(ulong address, ulong size) { - lock (_modified) + foreach (Texture texture in _modified) { - foreach (Texture texture in _modified) + if (texture.OverlapsWith(address, size)) { - if (texture.OverlapsWith(address, size)) - { - texture.Flush(); - } + texture.Flush(); } - _modified.Clear(); } + _modified.Clear(); } ///