aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/GpuChannel.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-07-27 21:07:48 -0300
committerGitHub <noreply@github.com>2022-07-27 21:07:48 -0300
commit3c3bcd82fe6dfa8bdc2c9a9f33724ebfacd7dd40 (patch)
tree1945094df81c8de1dd540508a6d59d82b5a18d39 /Ryujinx.Graphics.Gpu/GpuChannel.cs
parenta00c59a46c372ad004cb5b6c9aca97e6f5e9e910 (diff)
Add a sampler pool cache and improve texture pool cache (#3487)1.1.194
* Add a sampler pool cache and improve texture pool cache * Increase disposal timestamp delta more to be on the safe side * Nits * Use abstract class for PoolCache, remove factory callback
Diffstat (limited to 'Ryujinx.Graphics.Gpu/GpuChannel.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/GpuChannel.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/GpuChannel.cs b/Ryujinx.Graphics.Gpu/GpuChannel.cs
index b9d91f93..f3bdd576 100644
--- a/Ryujinx.Graphics.Gpu/GpuChannel.cs
+++ b/Ryujinx.Graphics.Gpu/GpuChannel.cs
@@ -59,9 +59,24 @@ namespace Ryujinx.Graphics.Gpu
{
oldMemoryManager.Physical.BufferCache.NotifyBuffersModified -= BufferManager.Rebind;
oldMemoryManager.Physical.DecrementReferenceCount();
+ oldMemoryManager.MemoryUnmapped -= MemoryUnmappedHandler;
}
memoryManager.Physical.BufferCache.NotifyBuffersModified += BufferManager.Rebind;
+ memoryManager.MemoryUnmapped += MemoryUnmappedHandler;
+
+ // Since the memory manager changed, make sure we will get pools from addresses of the new memory manager.
+ TextureManager.ReloadPools();
+ }
+
+ /// <summary>
+ /// Memory mappings change event handler.
+ /// </summary>
+ /// <param name="sender">Memory manager where the mappings changed</param>
+ /// <param name="e">Information about the region that is being changed</param>
+ private void MemoryUnmappedHandler(object sender, UnmapEventArgs e)
+ {
+ TextureManager.ReloadPools();
}
/// <summary>