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
This commit is contained in:
PixelyIon 2022-01-04 03:12:33 +05:30
parent a9aa16798f
commit a7b90e7825
2 changed files with 3 additions and 3 deletions

View File

@ -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};

View File

@ -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 {