summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-11-16 23:07:17 +0100
committerGravatar Fernando Sahmkow2021-11-16 23:14:51 +0100
commit282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6 (patch)
tree6be46996d65e1799fa45e2f2bd6b81945b97af70 /src/video_core/renderer_opengl
parentTextureCache: Make a better Anisotropic setter. (diff)
downloadyuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.tar.gz
yuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.tar.xz
yuzu-282e04bffb4962dcc1d8aee2cb0fd2a1a45c86e6.zip
TextureCache: Add automatic anisotropic filtering and refactor code.
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index c2668fee6..1d3f193af 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -1201,13 +1201,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) {
1201 glSamplerParameterfv(handle, GL_TEXTURE_BORDER_COLOR, config.BorderColor().data()); 1201 glSamplerParameterfv(handle, GL_TEXTURE_BORDER_COLOR, config.BorderColor().data());
1202 1202
1203 if (GLAD_GL_ARB_texture_filter_anisotropic || GLAD_GL_EXT_texture_filter_anisotropic) { 1203 if (GLAD_GL_ARB_texture_filter_anisotropic || GLAD_GL_EXT_texture_filter_anisotropic) {
1204 const f32 setting_anisotropic = 1204 const f32 max_anisotropy = std::clamp(config.MaxAnisotropy(), 1.0f, 16.0f);
1205 static_cast<f32>(1U << Settings::values.max_anisotropy.GetValue());
1206 const f32 game_anisotropic = std::clamp(config.MaxAnisotropy(), 1.0f, 16.0f);
1207 const bool aument_anisotropic =
1208 game_anisotropic > 1.0f || config.mipmap_filter == TextureMipmapFilter::Linear;
1209 const f32 max_anisotropy =
1210 aument_anisotropic ? std::max(game_anisotropic, setting_anisotropic) : game_anisotropic;
1211 glSamplerParameterf(handle, GL_TEXTURE_MAX_ANISOTROPY, max_anisotropy); 1205 glSamplerParameterf(handle, GL_TEXTURE_MAX_ANISOTROPY, max_anisotropy);
1212 } else { 1206 } else {
1213 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_anisotropic is required"); 1207 LOG_WARNING(Render_OpenGL, "GL_ARB_texture_filter_anisotropic is required");