summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-02-24 01:01:17 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-02-28 03:34:00 +0100
commit7ee606517875f0d12d4c75c5c807f4b6a8ffcf58 (patch)
treee0c23b4c540868b9c44b383dd5ea963fd3a748f3 /src/video_core
parentMerge pull request #3430 from bunnei/split-presenter (diff)
downloadyuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar.gz
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar.bz2
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar.lz
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar.xz
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.tar.zst
yuzu-7ee606517875f0d12d4c75c5c807f4b6a8ffcf58.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_sampler_cache.cpp2
-rw-r--r--src/video_core/textures/texture.h24
2 files changed, 24 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_sampler_cache.cpp b/src/video_core/renderer_opengl/gl_sampler_cache.cpp
index 3ded5ecea..5c174879a 100644
--- a/src/video_core/renderer_opengl/gl_sampler_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_sampler_cache.cpp
@@ -38,7 +38,7 @@ OGLSampler SamplerCacheOpenGL::CreateSampler(const Tegra::Texture::TSCEntry& tsc
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY, tsc.GetMaxAnisotropy());
} else if (GLAD_GL_EXT_texture_filter_anisotropic) {
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, tsc.GetMaxAnisotropy());
- } else if (tsc.GetMaxAnisotropy() != 1) {
+ } else {
LOG_WARNING(Render_OpenGL, "Anisotropy not supported by host GPU driver");
}
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 8e82c6748..07098c70d 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -8,6 +8,7 @@
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_types.h"
+#include "core/settings.h"
namespace Tegra::Texture {
@@ -294,6 +295,14 @@ enum class TextureMipmapFilter : u32 {
Linear = 3,
};
+enum class Anisotropy {
+ Default,
+ Filter2x,
+ Filter4x,
+ Filter8x,
+ Filter16x,
+};
+
struct TSCEntry {
union {
struct {
@@ -328,7 +337,20 @@ struct TSCEntry {
};
float GetMaxAnisotropy() const {
- return static_cast<float>(1U << max_anisotropy);
+ switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) {
+ case Anisotropy::Default:
+ return static_cast<float>(1U << max_anisotropy);
+ case Anisotropy::Filter2x:
+ return static_cast<float>(2U << max_anisotropy);
+ case Anisotropy::Filter4x:
+ return static_cast<float>(4U << max_anisotropy);
+ case Anisotropy::Filter8x:
+ return static_cast<float>(8U << max_anisotropy);
+ case Anisotropy::Filter16x:
+ return static_cast<float>(16U << max_anisotropy);
+ default:
+ return static_cast<float>(1U << max_anisotropy);
+ }
}
float GetMinLod() const {