aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/SamplerPool.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/SamplerPool.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
index 5a84bd84..e205ec48 100644
--- a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
+++ b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
@@ -7,6 +7,8 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary>
class SamplerPool : Pool<Sampler, SamplerDescriptor>
{
+ private float _forcedAnisotropy;
+
/// <summary>
/// Constructs a new instance of the sampler pool.
/// </summary>
@@ -14,7 +16,10 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="physicalMemory">Physical memory where the sampler descriptors are mapped</param>
/// <param name="address">Address of the sampler pool in guest memory</param>
/// <param name="maximumId">Maximum sampler ID of the sampler pool (equal to maximum samplers minus one)</param>
- public SamplerPool(GpuContext context, PhysicalMemory physicalMemory, ulong address, int maximumId) : base(context, physicalMemory, address, maximumId) { }
+ public SamplerPool(GpuContext context, PhysicalMemory physicalMemory, ulong address, int maximumId) : base(context, physicalMemory, address, maximumId)
+ {
+ _forcedAnisotropy = GraphicsConfig.MaxAnisotropy;
+ }
/// <summary>
/// Gets the sampler with the given ID.
@@ -30,6 +35,21 @@ namespace Ryujinx.Graphics.Gpu.Image
if (SequenceNumber != Context.SequenceNumber)
{
+ if (_forcedAnisotropy != GraphicsConfig.MaxAnisotropy)
+ {
+ _forcedAnisotropy = GraphicsConfig.MaxAnisotropy;
+
+ for (int i = 0; i < Items.Length; i++)
+ {
+ if (Items[i] != null)
+ {
+ Items[i].Dispose();
+
+ Items[i] = null;
+ }
+ }
+ }
+
SequenceNumber = Context.SequenceNumber;
SynchronizeMemory();