From a7b90e7825b892d93b3d521fcae5704261737189 Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Tue, 4 Jan 2022 03:12:33 +0530 Subject: [PATCH] Change Texture Pitch Unit to Bytes from Pixels The pitch of the texture should always be supplied in terms of bytes as it denotes alignment on a byte boundary rather than a pixel one, it is also always utilized in terms of bytes rather than pixels so this avoids an unnecessary conversion. Note: GBP stride unit was assumed to be pixels earlier but is likely bytes which is why there are no changes to the supplied value there, if this is not the case it'll be fixed in the future --- app/src/main/cpp/skyline/gpu/texture/copy.h | 4 ++-- app/src/main/cpp/skyline/gpu/texture/texture.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/texture/copy.h b/app/src/main/cpp/skyline/gpu/texture/copy.h index f5fdbdd4..8b25ad14 100644 --- a/app/src/main/cpp/skyline/gpu/texture/copy.h +++ b/app/src/main/cpp/skyline/gpu/texture/copy.h @@ -103,7 +103,7 @@ namespace skyline::gpu { */ void CopyPitchLinearToLinear(GuestTexture &guest, u8 *guestInput, u8 *linearOutput) { auto sizeLine{guest.format->GetSize(guest.dimensions.width, 1)}; //!< The size of a single line of pixel data - auto sizeStride{guest.format->GetSize(guest.tileConfig.pitch, 1)}; //!< The size of a single stride of pixel data + auto sizeStride{guest.tileConfig.pitch}; //!< The size of a single stride of pixel data auto inputLine{guestInput}; auto outputLine{linearOutput}; @@ -120,7 +120,7 @@ namespace skyline::gpu { */ void CopyLinearToPitchLinear(GuestTexture &guest, u8 *linearInput, u8 *guestOutput) { auto sizeLine{guest.format->GetSize(guest.dimensions.width, 1)}; //!< The size of a single line of pixel data - auto sizeStride{guest.format->GetSize(guest.tileConfig.pitch, 1)}; //!< The size of a single stride of pixel data + auto sizeStride{guest.tileConfig.pitch}; //!< The size of a single stride of pixel data auto inputLine{linearInput}; auto outputLine{guestOutput}; diff --git a/app/src/main/cpp/skyline/gpu/texture/texture.h b/app/src/main/cpp/skyline/gpu/texture/texture.h index 08fdb6b6..d177aa10 100644 --- a/app/src/main/cpp/skyline/gpu/texture/texture.h +++ b/app/src/main/cpp/skyline/gpu/texture/texture.h @@ -210,7 +210,7 @@ namespace skyline::gpu { u8 blockHeight; //!< The height of the blocks in GOBs u8 blockDepth; //!< The depth of the blocks in GOBs }; - u32 pitch; //!< The pitch of the texture if it's pitch linear + u32 pitch; //!< The pitch of the texture in bytes }; constexpr bool operator==(const TileConfig &other) const {