diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 2972f00ee1..60a799f685 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -29,7 +29,7 @@ bool TextureCacheCommon::SetOffsetTexture(u32 offset) { return false; } -void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, int maxLevel) { +void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, u8 maxLevel) { minFilt = gstate.texfilter & 0x7; magFilt = (gstate.texfilter>>8) & 1; sClamp = gstate.isTexCoordClampedS(); diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 1f45eb9248..4fd5e616de 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -68,6 +68,7 @@ public: int numInvalidated; u32 framesUntilNextFullHash; u8 format; + u8 maxLevel; u16 dim; u16 bufw; union { @@ -77,7 +78,6 @@ public: int invalidHint; u32 fullhash; u32 cluthash; - int maxLevel; float lodBias; // Cache the current filter settings so we can avoid setting it again. @@ -107,13 +107,13 @@ public: SetAlphaStatus(STATUS_ALPHA_SIMPLE); } } - bool Matches(u16 dim2, u8 format2, int maxLevel2); + bool Matches(u16 dim2, u8 format2, u8 maxLevel2); }; protected: - void GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, int maxLevel); + void GetSamplingParams(int &minFilt, int &magFilt, bool &sClamp, bool &tClamp, float &lodBias, u8 maxLevel); }; -inline bool TextureCacheCommon::TexCacheEntry::Matches(u16 dim2, u8 format2, int maxLevel2) { +inline bool TextureCacheCommon::TexCacheEntry::Matches(u16 dim2, u8 format2, u8 maxLevel2) { return dim == dim2 && format == format2 && maxLevel == maxLevel2; } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 35668796e8..ccc07d8794 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -1047,7 +1047,7 @@ void TextureCacheDX9::SetTexture(bool force) { } int bufw = GetTextureBufw(0, texaddr, format); - int maxLevel = gstate.getTextureMaxLevel(); + u8 maxLevel = gstate.getTextureMaxLevel(); u32 texhash = MiniHash((const u32 *)Memory::GetPointer(texaddr)); u32 fullhash = 0; @@ -1294,7 +1294,7 @@ void TextureCacheDX9::SetTexture(bool force) { // Adjust maxLevel to actually present levels.. bool badMipSizes = false; - for (int i = 0; i <= maxLevel; i++) { + for (u32 i = 0; i <= maxLevel; i++) { // If encountering levels pointing to nothing, adjust max level. u32 levelTexaddr = gstate.getTextureAddress(i); if (!Memory::IsValidAddress(levelTexaddr)) { @@ -1368,7 +1368,7 @@ void TextureCacheDX9::SetTexture(bool force) { // Mipmapping is only enabled when texture scaling is disabled. if (maxLevel > 0 && g_Config.iTexScalingLevel == 1) { - for (int i = 1; i <= maxLevel; i++) { + for (u32 i = 1; i <= maxLevel; i++) { LoadTextureLevel(*entry, i, maxLevel, replaceImages, scaleFactor, dstFmt); } } diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 889229fb62..146cc2c989 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1114,7 +1114,7 @@ void TextureCache::SetTexture(bool force) { } int bufw = GetTextureBufw(0, texaddr, format); - int maxLevel = gstate.getTextureMaxLevel(); + u8 maxLevel = gstate.getTextureMaxLevel(); u32 texhash = MiniHash((const u32 *)Memory::GetPointerUnchecked(texaddr)); u32 fullhash = 0; @@ -1362,7 +1362,7 @@ void TextureCache::SetTexture(bool force) { // Adjust maxLevel to actually present levels.. bool badMipSizes = false; - for (int i = 0; i <= maxLevel; i++) { + for (u32 i = 0; i <= maxLevel; i++) { // If encountering levels pointing to nothing, adjust max level. u32 levelTexaddr = gstate.getTextureAddress(i); if (!Memory::IsValidAddress(levelTexaddr)) {