From 80b05b6f0d3dab08e7df9b8c3fac4536c5933932 Mon Sep 17 00:00:00 2001 From: Techjar Date: Tue, 3 Jul 2018 06:19:07 -0400 Subject: [PATCH] Make arbitrary mipmap detection toggle invalidate the texture cache We want this setting to invalidate the cache because it may affect the appearance of textures in the rendered scene, therefore one would expect changing it while the game is running to have the expected effect immediately. --- .../Config/Graphics/EnhancementsWidget.cpp | 12 ++++++------ Source/Core/VideoCommon/TextureCacheBase.cpp | 4 +++- Source/Core/VideoCommon/TextureCacheBase.h | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp index d15e910c10..d5f2927208 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp @@ -349,12 +349,12 @@ void EnhancementsWidget::AddDescriptions() "some games as \"deflickering\" or \"smoothing\". Disabling the filter has no " "effect on performance, but may result in a sharper image, and causes few " "graphical issues.\n\nIf unsure, leave this checked."); - static const char TR_ARBITRARY_MIPMAP_DETECTION_DESCRIPTION[] = - QT_TR_NOOP("Enables detection of arbitrary mipmaps, which some games use for special " - "distance-based effects.\nMay have false positives that result in blurry textures " - "at increased internal resolution, such as in games that use very low resolution " - "mipmaps.\nDisabling this can also reduce stutter in games that " - "frequently load new textures.\n\nIf unsure, leave this checked."); + static const char TR_ARBITRARY_MIPMAP_DETECTION_DESCRIPTION[] = QT_TR_NOOP( + "Enables detection of arbitrary mipmaps, which some games use for special distance-based " + "effects. May have false positives that result in blurry textures at increased internal " + "resolution, such as in games that use very low resolution mipmaps.\nDisabling this can also " + "reduce stutter in games that frequently load new textures.\nThis feature is not compatible " + "with GPU Texture Decoding.\n\nIf unsure, leave this checked."); AddDescription(m_ir_combo, TR_INTERNAL_RESOLUTION_DESCRIPTION); AddDescription(m_aa_combo, TR_ANTIALIAS_DESCRIPTION); diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 4a8807954e..8881ad2457 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -126,7 +126,8 @@ void TextureCacheBase::OnConfigChanged(VideoConfig& config) config.bTexFmtOverlayCenter != backup_config.texfmt_overlay_center || config.bHiresTextures != backup_config.hires_textures || config.bEnableGPUTextureDecoding != backup_config.gpu_texture_decoding || - config.bDisableCopyToVRAM != backup_config.disable_vram_copies) + config.bDisableCopyToVRAM != backup_config.disable_vram_copies || + config.bArbitraryMipmapDetection != backup_config.arbitrary_mipmap_detection) { Invalidate(); @@ -230,6 +231,7 @@ void TextureCacheBase::SetBackupConfig(const VideoConfig& config) backup_config.efb_mono_depth = config.bStereoEFBMonoDepth; backup_config.gpu_texture_decoding = config.bEnableGPUTextureDecoding; backup_config.disable_vram_copies = config.bDisableCopyToVRAM; + backup_config.arbitrary_mipmap_detection = config.bArbitraryMipmapDetection; } TextureCacheBase::TCacheEntry* diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index c4a17efc88..1c84662065 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -357,6 +357,7 @@ private: bool efb_mono_depth; bool gpu_texture_decoding; bool disable_vram_copies; + bool arbitrary_mipmap_detection; }; BackupConfig backup_config = {}; };