Skip to content
Permalink
Browse files
Merge pull request #11263 from tellowkrinkle/NoMipsOption
VideoCommon: Add option to disable mipmaps
  • Loading branch information
JosJuice committed Nov 11, 2022
2 parents bf69a0b + 37a51f1 commit f28e560
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
@@ -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

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

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

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

0 comments on commit f28e560

Please sign in to comment.