diff options
| author | Xpl0itR <xpl0itr@outlook.com> | 2020-03-30 22:38:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-31 08:38:52 +1100 |
| commit | 12d49c37d219950ccb22c3979ecb0b34262a7155 (patch) | |
| tree | ac6e73776a332e833d0f59d1b72f281eaff07098 /Ryujinx.Graphics.Gpu/Image | |
| parent | 5a52ca5071425e3f9600576679bec609e7cead89 (diff) | |
Make max anisotropy configurable (#1043)
* Make max anisotropy configurable
* Move opengl command to opengl project
* Add GUI option
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/Sampler.cs | 8 |
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> |
