aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Sampler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Sampler.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Sampler.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Sampler.cs b/Ryujinx.Graphics.Gpu/Image/Sampler.cs
index 45f5f519..827d6077 100644
--- a/Ryujinx.Graphics.Gpu/Image/Sampler.cs
+++ b/Ryujinx.Graphics.Gpu/Image/Sampler.cs
@@ -40,7 +40,11 @@ namespace Ryujinx.Graphics.Gpu.Image
float maxLod = descriptor.UnpackMaxLod();
float mipLodBias = descriptor.UnpackMipLodBias();
- float maxAnisotropy = descriptor.UnpackMaxAnisotropy();
+ float maxRequestedAnisotropy = GraphicsConfig.MaxAnisotropy >= 0 && GraphicsConfig.MaxAnisotropy <= 16 ? GraphicsConfig.MaxAnisotropy : descriptor.UnpackMaxAnisotropy();
+ float maxSupportedAnisotropy = context.Capabilities.MaxSupportedAnisotropy;
+
+ if (maxRequestedAnisotropy > maxSupportedAnisotropy)
+ maxRequestedAnisotropy = maxSupportedAnisotropy;
HostSampler = context.Renderer.CreateSampler(new SamplerCreateInfo(
minFilter,
@@ -54,7 +58,7 @@ namespace Ryujinx.Graphics.Gpu.Image
minLod,
maxLod,
mipLodBias,
- maxAnisotropy));
+ maxRequestedAnisotropy));
}
/// <summary>