Permalink
Browse files

Merge pull request #10121 from LunaMoo/d3d11w7

Fix texture conversion.
  • Loading branch information...
unknownbrackets committed Nov 14, 2017
2 parents a0f1276 + 2c27b3b commit 10145989b969f84a219d691b3c1eadc2ff077291
Showing with 4 additions and 11 deletions.
  1. +4 −11 GPU/Common/TextureCacheCommon.cpp
@@ -1190,18 +1190,11 @@ void TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, GETextureForm
memcpy(out + outPitch * y, texptr + bufw * sizeof(u16) * y, w * sizeof(u16));
}
}
} else if (h >= 8) {
} else if (h >= 8 && !expandTo32bit) {
// Note: this is always safe since h must be a power of 2, so a multiple of 8.
if (!expandTo32bit) {
UnswizzleFromMem((u32 *)out, outPitch, texptr, bufw, h, 2);
if (reverseColors) {
ReverseColors(out, out, format, h * outPitch / 2, useBGRA);
}
} else if (expandTo32bit) {
UnswizzleFromMem((u32 *)out, outPitch / 2, texptr, bufw, h, 2);
for (int y = h - 1; y >= 0; --y) {
ConvertFormatToRGBA8888(format, (u32 *)(out + outPitch * y), (const u16 *)(out + outPitch / 2 * y), w);
}
UnswizzleFromMem((u32 *)out, outPitch, texptr, bufw, h, 2);
if (reverseColors) {
ReverseColors(out, out, format, h * outPitch / 2, useBGRA);
}
} else {
// We don't have enough space for all rows in out, so use a temp buffer.

0 comments on commit 1014598

Please sign in to comment.