diff options
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLCachedResource.cs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLCachedResource.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLCachedResource.cs index 839915ea..a65ebcbb 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLCachedResource.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLCachedResource.cs @@ -1,3 +1,4 @@ +using Ryujinx.Common; using System; using System.Collections.Generic; @@ -18,7 +19,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL public long DataSize { get; private set; } - public int Timestamp { get; private set; } + public long Timestamp { get; private set; } public CacheBucket(T Value, long DataSize, LinkedListNode<long> Node) { @@ -26,7 +27,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL this.DataSize = DataSize; this.Node = Node; - Timestamp = Environment.TickCount; + Timestamp = PerformanceCounter.ElapsedMilliseconds; } } @@ -141,7 +142,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL private void ClearCacheIfNeeded() { - int Timestamp = Environment.TickCount; + long Timestamp = PerformanceCounter.ElapsedMilliseconds; int Count = 0; @@ -156,7 +157,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL CacheBucket Bucket = Cache[Node.Value]; - int TimeDelta = RingDelta(Bucket.Timestamp, Timestamp); + long TimeDelta = Bucket.Timestamp - Timestamp; if ((uint)TimeDelta <= (uint)MaxTimeDelta) { @@ -170,17 +171,5 @@ namespace Ryujinx.Graphics.Gal.OpenGL DeleteValueCallback(Bucket.Value); } } - - private int RingDelta(int Old, int New) - { - if ((uint)New < (uint)Old) - { - return New + (~Old + 1); - } - else - { - return New - Old; - } - } } }
\ No newline at end of file |
