From dce7dde5e6927229ebc1ef7f3fd58f76771062a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 14 Sep 2020 00:03:29 +0200 Subject: [PATCH] More moves --- GPU/Common/TextureCacheCommon.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 2ae3adc900..0df8d251e6 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -150,12 +150,15 @@ SamplerCacheKey TextureCacheCommon::GetSamplingParams(int maxLevel, u32 texAddr) SamplerCacheKey key; int minFilt = gstate.texfilter & 0x7; - int magFilt = gstate.isMagnifyFilteringEnabled(); - bool sClamp = gstate.isTexCoordClampedS(); - bool tClamp = gstate.isTexCoordClampedT(); + key.minFilt = minFilt & 1; + key.mipEnable = (minFilt >> 2) & 1; + key.mipFilt = (minFilt >> 1) & 1; + key.magFilt = gstate.isMagnifyFilteringEnabled(); + key.sClamp = gstate.isTexCoordClampedS(); + key.tClamp = gstate.isTexCoordClampedT(); + key.aniso = false; GETexLevelMode mipMode = gstate.getTexLevelMode(); - bool autoMip = mipMode == GE_TEXLEVEL_MODE_AUTO; // TODO: Slope mipmap bias is still not well understood. @@ -172,18 +175,11 @@ SamplerCacheKey TextureCacheCommon::GetSamplingParams(int maxLevel, u32 texAddr) if (noMip) { // Enforce no mip filtering, for safety. - minFilt &= 1; // no mipmaps yet + key.mipEnable = false; + key.mipFilt = 0; lodBias = 0.0f; } - key.minFilt = minFilt & 1; - key.mipEnable = (minFilt >> 2) & 1; - key.mipFilt = (minFilt >> 1) & 1; - key.magFilt = magFilt & 1; - key.sClamp = sClamp; - key.tClamp = tClamp; - key.aniso = false; - if (!key.mipEnable) { key.maxLevel = 0; key.minLevel = 0;