mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-27 21:41:50 +01:00
Fix deswizzling non-pow2 block size formats
We need to use DivideCeil to avoid rounding off part of the texture. Fixes texture in Nier Automata: Game of the YoRHa edition.
This commit is contained in:
parent
27de42f8df
commit
8fa83fdf13
@ -97,13 +97,13 @@ namespace skyline::gpu::texture {
|
||||
size_t formatBlockWidth, size_t formatBlockHeight, size_t formatBpb,
|
||||
size_t gobBlockHeight, size_t gobBlockDepth,
|
||||
u8 *blockLinear, u8 *linear) {
|
||||
size_t robWidthUnalignedBytes{(dimensions.width / formatBlockWidth) * formatBpb};
|
||||
size_t robWidthUnalignedBytes{util::DivideCeil<size_t>(dimensions.width, formatBlockWidth) * formatBpb};
|
||||
size_t robWidthBytes{util::AlignUp(robWidthUnalignedBytes, GobWidth)};
|
||||
size_t robWidthBlocks{robWidthUnalignedBytes / GobWidth};
|
||||
|
||||
size_t blockHeight{gobBlockHeight};
|
||||
size_t robHeight{GobHeight * blockHeight};
|
||||
size_t surfaceHeightLines{dimensions.height / formatBlockHeight};
|
||||
size_t surfaceHeightLines{util::DivideCeil<size_t>(dimensions.height, formatBlockHeight)};
|
||||
size_t surfaceHeightRobs{surfaceHeightLines / robHeight}; //!< The height of the surface in ROBs excluding padding ROBs
|
||||
|
||||
size_t blockDepth{std::min<size_t>(dimensions.depth, gobBlockDepth)};
|
||||
|
Loading…
Reference in New Issue
Block a user