summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2022-11-11 17:55:45 +0100
committerGitHub <noreply@github.com>2022-11-11 17:55:45 +0100
commitf28e5607fec604f998994e5d65931707eafec841 (patch)
treedb600ef4d85f5e7404a74d546f662e05b944b23e /Source/Core
parentbf69a0bfe09fc7252858afc69d2c218ae1f83e88 (diff)
parent37a51f1d091c7db91261e73462d4e67eee5f9252 (diff)
Merge pull request #11263 from tellowkrinkle/NoMipsOption
VideoCommon: Add option to disable mipmaps
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Config/GraphicsSettings.cpp3
-rw-r--r--Source/Core/Core/Config/GraphicsSettings.h3
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp9
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp3
-rw-r--r--Source/Core/VideoCommon/VideoConfig.h3
5 files changed, 20 insertions, 1 deletions
diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp
index beb2e6f017..5a9f7b0954 100644
--- a/Source/Core/Core/Config/GraphicsSettings.cpp
+++ b/Source/Core/Core/Config/GraphicsSettings.cpp
@@ -153,6 +153,9 @@ const Info<u32> GFX_HACK_MISSING_COLOR_VALUE{{System::GFX, "Hacks", "MissingColo
0xFFFFFFFF};
const Info<bool> GFX_HACK_FAST_TEXTURE_SAMPLING{{System::GFX, "Hacks", "FastTextureSampling"},
true};
+#ifdef __APPLE__
+const Info<bool> GFX_HACK_NO_MIPMAPPING{{System::GFX, "Hacks", "NoMipmapping"}, false};
+#endif
// Graphics.GameSpecific
diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h
index 426a038bd5..5e3dbb46ae 100644
--- a/Source/Core/Core/Config/GraphicsSettings.h
+++ b/Source/Core/Core/Config/GraphicsSettings.h
@@ -129,6 +129,9 @@ extern const Info<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES;
extern const Info<bool> GFX_HACK_VERTEX_ROUNDING;
extern const Info<u32> GFX_HACK_MISSING_COLOR_VALUE;
extern const Info<bool> GFX_HACK_FAST_TEXTURE_SAMPLING;
+#ifdef __APPLE__
+extern const Info<bool> GFX_HACK_NO_MIPMAPPING;
+#endif
// Graphics.GameSpecific
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 29f972a67b..f16bcc342a 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -1544,8 +1544,15 @@ TextureCacheBase::GetTexture(const int textureCacheSafetyColorSampleSize,
}
}
+#ifdef __APPLE__
+ const bool no_mips = g_ActiveConfig.bNoMipmapping;
+#else
+ const bool no_mips = false;
+#endif
// how many levels the allocated texture shall have
- const u32 texLevels = hires_tex ? (u32)hires_tex->m_levels.size() : texture_info.GetLevelCount();
+ const u32 texLevels = no_mips ? 1 :
+ hires_tex ? (u32)hires_tex->m_levels.size() :
+ texture_info.GetLevelCount();
// We can decode on the GPU if it is a supported format and the flag is enabled.
// Currently we don't decode RGBA8 textures from TMEM, as that would require copying from both
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index 760e185304..40d5841714 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -140,6 +140,9 @@ void VideoConfig::Refresh()
iEFBAccessTileSize = Config::Get(Config::GFX_HACK_EFB_ACCESS_TILE_SIZE);
iMissingColorValue = Config::Get(Config::GFX_HACK_MISSING_COLOR_VALUE);
bFastTextureSampling = Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING);
+#ifdef __APPLE__
+ bNoMipmapping = Config::Get(Config::GFX_HACK_NO_MIPMAPPING);
+#endif
bPerfQueriesEnable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE);
diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h
index 8b4cc40657..05d86a18f4 100644
--- a/Source/Core/VideoCommon/VideoConfig.h
+++ b/Source/Core/VideoCommon/VideoConfig.h
@@ -143,6 +143,9 @@ struct VideoConfig final
int iSaveTargetId = 0; // TODO: Should be dropped
u32 iMissingColorValue = 0;
bool bFastTextureSampling = false;
+#ifdef __APPLE__
+ bool bNoMipmapping = false; // Used by macOS fifoci to work around an M1 bug
+#endif
// Stereoscopy
StereoMode stereo_mode{};