From 5c0e4a839db86de4b13b5a4ed2de11408acfeeca Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 29 Sep 2022 21:01:47 +0100 Subject: [PATCH] Fix SW BC2 decoding pitch --- app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp b/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp index f43d00f9..7990173d 100644 --- a/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp +++ b/app/src/main/cpp/skyline/gpu/texture/bc_decoder.cpp @@ -1511,11 +1511,11 @@ namespace bcn { const auto *alpha{reinterpret_cast(src)}; const auto *color{reinterpret_cast(src + 8)}; size_t pitch{R8g8b8a8Bpp * width}; - for (size_t y{}; y < height; y += BlockHeight, dst += BlockHeight * width) { + for (size_t y{}; y < height; y += BlockHeight, dst += BlockHeight * pitch) { uint8_t *dstRow{dst}; for (size_t x{}; x < width; x += BlockWidth, alpha += 2, color += 2, dstRow += BlockWidth * R8g8b8a8Bpp) { - [[clang::always_inline]] color->decode(dstRow, x, y, width, height, width, R8g8b8a8Bpp, false, true); - [[clang::always_inline]] alpha->decode(dstRow, x, y, width, height, width, R8g8b8a8Bpp); + [[clang::always_inline]] color->decode(dstRow, x, y, width, height, pitch, R8g8b8a8Bpp, false, true); + [[clang::always_inline]] alpha->decode(dstRow, x, y, width, height, pitch, R8g8b8a8Bpp); } } }