Merge pull request #11263 from tellowkrinkle/NoMipsOption

VideoCommon: Add option to disable mipmaps
This commit is contained in:
JosJuice 2022-11-11 17:55:45 +01:00 committed by GitHub
commit f28e5607fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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{};