diff options
author | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 23:16:26 +0200 |
---|---|---|
committer | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-06-15 23:16:26 +0200 |
commit | a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b (patch) | |
tree | 0b3bea548cb1282d45a53365faea13e4321a69f8 /src/video_core/renderer_opengl | |
parent | video_core: Disable AF for non-color image formats (diff) | |
download | yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.gz yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.bz2 yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.lz yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.xz yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.zst yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 8 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 0fa0fc594..58e4e1919 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp @@ -488,7 +488,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { const bool use_fallback_sampler{sampler.HasAddedAnisotropy() && !image_view.SupportsAnisotropy()}; gl_samplers[sampler_binding++] = - use_fallback_sampler ? sampler.HandleWithoutAnisotropy() : sampler.Handle(); + use_fallback_sampler ? sampler.HandleWithDefaultAnisotropy() : sampler.Handle(); } } for (const auto& desc : info.image_descriptors) { diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 7ff54003f..3b446be07 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -1306,8 +1306,10 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) { }; sampler = create_sampler(max_anisotropy); - if (Settings::values.max_anisotropy.GetValue() > 0 && max_anisotropy > 1.0f) { - sampler_without_anisotropy = create_sampler(1.0f); + + const f32 max_anisotropy_default = static_cast<f32>(1U << config.max_anisotropy); + if (max_anisotropy > max_anisotropy_default) { + sampler_default_anisotropy = create_sampler(max_anisotropy_default); } } diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 82756fca7..3676eaaa9 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -313,17 +313,17 @@ public: return sampler.handle; } - [[nodiscard]] GLuint HandleWithoutAnisotropy() const noexcept { - return sampler_without_anisotropy.handle; + [[nodiscard]] GLuint HandleWithDefaultAnisotropy() const noexcept { + return sampler_default_anisotropy.handle; } [[nodiscard]] bool HasAddedAnisotropy() const noexcept { - return static_cast<bool>(sampler_without_anisotropy.handle); + return static_cast<bool>(sampler_default_anisotropy.handle); } private: OGLSampler sampler; - OGLSampler sampler_without_anisotropy; + OGLSampler sampler_default_anisotropy; }; class Framebuffer { |