diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index d029bf9be5..c4dccfdf95 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1434,7 +1434,7 @@ inline u32 TfmtRawToFullAlpha(GETextureFormat fmt) { } } -CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, bool reverseColors, bool useBGRA, bool expandTo32bit) { +CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, bool reverseColors, bool expandTo32bit) { u32 alphaSum = 0xFFFFFFFF; u32 fullAlphaMask = 0x0; @@ -1549,7 +1549,7 @@ CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, G // Just check the input's alpha to reuse code. TODO: make a specialized ReverseColors that checks as we go. for (int y = 0; y < h; ++y) { CheckMask16((const u16 *)(texptr + bufw * sizeof(u16) * y), w, &alphaSum); - ReverseColors(out + outPitch * y, texptr + bufw * sizeof(u16) * y, format, w, useBGRA); + ReverseColors(out + outPitch * y, texptr + bufw * sizeof(u16) * y, format, w, false); } } else if (expandTo32bit) { for (int y = 0; y < h; ++y) { @@ -1579,7 +1579,7 @@ CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, G // Just check the swizzled input's alpha to reuse code. TODO: make a specialized ReverseColors that checks as we go. for (int y = 0; y < h; ++y) { CheckMask16((const u16 *)(unswizzled + bufw * sizeof(u16) * y), w, &alphaSum); - ReverseColors(out + outPitch * y, unswizzled + bufw * sizeof(u16) * y, format, w, useBGRA); + ReverseColors(out + outPitch * y, unswizzled + bufw * sizeof(u16) * y, format, w, false); } } else if (expandTo32bit) { // Just check the swizzled input's alpha to reuse code. TODO: make a specialized ConvertFormatToRGBA8888 that checks as we go. @@ -1604,7 +1604,7 @@ CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, G if (reverseColors) { for (int y = 0; y < h; ++y) { CheckMask32((const u32 *)(texptr + bufw * sizeof(u32) * y), w, &alphaSum); - ReverseColors(out + outPitch * y, texptr + bufw * sizeof(u32) * y, format, w, useBGRA); + ReverseColors(out + outPitch * y, texptr + bufw * sizeof(u32) * y, format, w, false); } } else { for (int y = 0; y < h; ++y) { @@ -1626,7 +1626,7 @@ CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, G if (reverseColors) { for (int y = 0; y < h; ++y) { CheckMask32((const u32 *)(unswizzled + bufw * sizeof(u32) * y), w, &alphaSum); - ReverseColors(out + outPitch * y, unswizzled + bufw * sizeof(u32) * y, format, w, useBGRA); + ReverseColors(out + outPitch * y, unswizzled + bufw * sizeof(u32) * y, format, w, false); } } else { for (int y = 0; y < h; ++y) { @@ -1637,13 +1637,13 @@ CheckAlphaResult TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, G break; case GE_TFMT_DXT1: - return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, useBGRA); + return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, false); case GE_TFMT_DXT3: - return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, useBGRA); + return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, false); case GE_TFMT_DXT5: - return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, useBGRA); + return DecodeDXTBlocks(out, outPitch, texaddr, texptr, w, h, bufw, reverseColors, false); default: ERROR_LOG_REPORT(G3D, "Unknown Texture Format %d!!!", format); diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 3464a67841..b0c91be4ff 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -283,7 +283,7 @@ protected: virtual void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) = 0; bool CheckFullHash(TexCacheEntry *entry, bool &doDelete); - CheckAlphaResult DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, bool reverseColors, bool useBGRA, bool expandTo32Bit); + CheckAlphaResult DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, bool reverseColors, bool expandTo32Bit); void UnswizzleFromMem(u32 *dest, u32 destPitch, const u8 *texptr, u32 bufw, u32 height, u32 bytesPerPixel); CheckAlphaResult ReadIndexedTex(u8 *out, int outPitch, int level, const u8 *texptr, int bytesPerIndex, int bufw, bool reverseColors, bool expandTo32Bit); ReplacedTexture &FindReplacement(TexCacheEntry *entry, int &w, int &h); diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 4da2fa6664..4007ea9e97 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -696,7 +696,7 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture & bool expand32 = !gstate_c.Supports(GPU_SUPPORTS_16BIT_FORMATS); - CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, false, expand32); + CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, expand32); entry.SetAlphaStatus(alphaResult, level); if (scaleFactor > 1) { diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index e424408ee8..a1e443bce8 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -621,7 +621,7 @@ void TextureCacheDX9::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &re decPitch = w * bpp; } - CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, false, false); + CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, false); entry.SetAlphaStatus(alphaResult, level); if (scaleFactor > 1) { diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 18359ff341..50bac49ab8 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -649,7 +649,7 @@ void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &r pixelData = (uint8_t *)AllocateAlignedMemory(decPitch * h * pixelSize, 16); - CheckAlphaResult alphaStatus = DecodeTextureLevel(pixelData, decPitch, GETextureFormat(entry.format), clutformat, texaddr, level, bufw, true, false, false); + CheckAlphaResult alphaStatus = DecodeTextureLevel(pixelData, decPitch, GETextureFormat(entry.format), clutformat, texaddr, level, bufw, true, false); entry.SetAlphaStatus(alphaStatus, level); if (scaleFactor > 1) { diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index d22b9d3cb9..08443f7dc3 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -999,7 +999,7 @@ void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePt bool expand32 = !gstate_c.Supports(GPU_SUPPORTS_16BIT_FORMATS) || dstFmt == VK_FORMAT_R8G8B8A8_UNORM; - CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, false, expand32); + CheckAlphaResult alphaResult = DecodeTextureLevel((u8 *)pixelData, decPitch, tfmt, clutformat, texaddr, level, bufw, false, expand32); // WARN_LOG(G3D, "Alpha: full=%d w=%d h=%d level=%d %s/%s", (int)(alphaResult == CHECKALPHA_FULL), w, h, level, GeTextureFormatToString(tfmt), GEPaletteFormatToString(clutformat)); entry.SetAlphaStatus(alphaResult, level);