diff --git a/Core/Config.cpp b/Core/Config.cpp index 0764f7b6c2..a3c7be9017 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -821,7 +821,6 @@ static ConfigSetting graphicsSettings[] = { ConfigSetting("ClearFramebuffersOnFirstUseHack", &g_Config.bClearFramebuffersOnFirstUseHack, false, true, true), - ConfigSetting(false), }; diff --git a/Core/Config.h b/Core/Config.h index cfa071a878..5a1a6b57b7 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -186,7 +186,6 @@ public: bool bFullScreenMulti; int iInternalResolution; // 0 = Auto (native), 1 = 1x (480x272), 2 = 2x, 3 = 3x, 4 = 4x and so on. int iAnisotropyLevel; // 0 - 5, powers of 2: 0 = 1x = no aniso - int iMipmapMode; // 0 = default, 1 = performance, 2 = quality int bHighQualityDepth; bool bReplaceTextures; bool bSaveNewTextures; diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index f65a8e4333..9c50471da4 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -201,17 +201,16 @@ void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sCl } } -void TextureCacheCommon::UpdateSamplingParams(TexCacheEntry &entry, SamplerCacheKey &key) { +void TextureCacheCommon::UpdateSamplingParams(int maxLevel, u32 texAddr, SamplerCacheKey &key) { // TODO: Make GetSamplingParams write SamplerCacheKey directly int minFilt; int magFilt; bool sClamp; bool tClamp; float lodBias; - int maxLevel = (entry.status & TexCacheEntry::STATUS_BAD_MIPS) ? 0 : entry.maxLevel; GETexLevelMode mode; - GetSamplingParams(minFilt, magFilt, sClamp, tClamp, lodBias, maxLevel, entry.addr, mode); + GetSamplingParams(minFilt, magFilt, sClamp, tClamp, lodBias, maxLevel, texAddr, mode); key.minFilt = minFilt & 1; key.mipEnable = (minFilt >> 2) & 1; key.mipFilt = (minFilt >> 1) & 1; @@ -227,7 +226,7 @@ void TextureCacheCommon::UpdateSamplingParams(TexCacheEntry &entry, SamplerCache } else { switch (mode) { case GE_TEXLEVEL_MODE_AUTO: - key.maxLevel = entry.maxLevel * 256; + key.maxLevel = maxLevel * 256; key.minLevel = 0; key.lodBias = (int)(lodBias * 256.0f); if (gstate_c.Supports(GPU_SUPPORTS_ANISOTROPY) && g_Config.iAnisotropyLevel > 0) { @@ -244,7 +243,7 @@ void TextureCacheCommon::UpdateSamplingParams(TexCacheEntry &entry, SamplerCache // It's incorrect to use the slope as a bias. Instead it should be passed // into the shader directly as an explicit lod level, with the bias on top. For now, we just kill the // lodBias in this mode, working around #9772. - key.maxLevel = entry.maxLevel * 256; + key.maxLevel = maxLevel * 256; key.minLevel = 0; key.lodBias = 0; break; diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index a59ef9771d..652eba6578 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -285,7 +285,7 @@ protected: u32 EstimateTexMemoryUsage(const TexCacheEntry *entry); void GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, int maxLevel, u32 addr, GETexLevelMode &mode); - void UpdateSamplingParams(TexCacheEntry &entry, SamplerCacheKey &key); // Used by D3D11 and Vulkan. + void UpdateSamplingParams(int maxLevel, u32 texAddr, SamplerCacheKey &key); // Used by D3D11 and Vulkan. void UpdateMaxSeenV(TexCacheEntry *entry, bool throughMode); FramebufferMatchInfo MatchFramebuffer(const TextureDefinition &entry, VirtualFramebuffer *framebuffer, u32 texaddrOffset, FramebufferNotificationChannel channel) const; diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 7953eff1d9..01d102271a 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -240,7 +240,8 @@ void TextureCacheD3D11::BindTexture(TexCacheEntry *entry) { lastBoundTexture = textureView; } SamplerCacheKey key{}; - UpdateSamplingParams(*entry, key); + int maxLevel = (entry->status & TexCacheEntry::STATUS_BAD_MIPS) ? 0 : entry->maxLevel; + UpdateSamplingParams(maxLevel, entry->addr, key); ID3D11SamplerState *state = samplerCache_.GetOrCreateSampler(device_, key); context_->PSSetSamplers(0, 1, &state); } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 5f118f76db..667a972349 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -221,7 +221,7 @@ void TextureCacheDX9::StartFrame() { timesInvalidatedAllThisFrame_ = 0; if (texelsScaledThisFrame_) { - // INFO_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); + VERBOSE_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); } texelsScaledThisFrame_ = 0; if (clearCacheNextFrame_) { diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index b0de874f69..6ee2eabcd8 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -227,7 +227,7 @@ void TextureCacheGLES::StartFrame() { } if (texelsScaledThisFrame_) { - // INFO_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); + VERBOSE_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); } texelsScaledThisFrame_ = 0; if (clearCacheNextFrame_) { diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 3a2da88759..8627099be6 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -492,7 +492,7 @@ void TextureCacheVulkan::EndFrame() { computeShaderManager_.EndFrame(); if (texelsScaledThisFrame_) { - // INFO_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); + VERBOSE_LOG(G3D, "Scaled %i texels", texelsScaledThisFrame_); } } @@ -542,7 +542,8 @@ void TextureCacheVulkan::BindTexture(TexCacheEntry *entry) { entry->vkTex->Touch(); imageView_ = entry->vkTex->GetImageView(); SamplerCacheKey key{}; - UpdateSamplingParams(*entry, key); + int maxLevel = (entry->status & TexCacheEntry::STATUS_BAD_MIPS) ? 0 : entry->maxLevel; + UpdateSamplingParams(maxLevel, entry->addr, key); curSampler_ = samplerCache_.GetOrCreateSampler(key); drawEngine_->SetDepalTexture(VK_NULL_HANDLE); gstate_c.SetUseShaderDepal(false);