diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index 5277e789..dbcb2e75 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -272,7 +272,15 @@ namespace Ryujinx.Graphics.Gpu.Image ulong address = descriptor.UnpackAddress(); - MultiRange range = _channel.MemoryManager.GetPhysicalRegions(address, texture.Size); + if (!descriptor.Equals(ref DescriptorCache[request.ID])) + { + // If the pool entry has already been replaced, just remove the texture. + + texture.DecrementReferenceCount(); + continue; + } + + MultiRange range = _channel.MemoryManager.Physical.TextureCache.UpdatePartiallyMapped(_channel.MemoryManager, address, texture); // If the texture is not mapped at all, delete its reference. |