From 12d49c37d219950ccb22c3979ecb0b34262a7155 Mon Sep 17 00:00:00 2001 From: Xpl0itR Date: Mon, 30 Mar 2020 22:38:52 +0100 Subject: Make max anisotropy configurable (#1043) * Make max anisotropy configurable * Move opengl command to opengl project * Add GUI option --- Ryujinx.Graphics.Gpu/Image/Sampler.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/Sampler.cs') 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)); } /// -- cgit v1.2.3