summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-01-15 08:02:37 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-01-15 08:13:33 +0100
commitfe494a0ccdddc8e7a7f54ca93de090100fc3fb8a (patch)
treea4c0f339d33ec9a90f15b88c4d1fada864f73adc /src/video_core/textures
parentMerge pull request #5352 from ReinUsesLisp/remove-tester (diff)
downloadyuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar.gz
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar.bz2
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar.lz
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar.xz
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.tar.zst
yuzu-fe494a0ccdddc8e7a7f54ca93de090100fc3fb8a.zip
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/decoders.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 9f5181318..62685a183 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -49,7 +49,7 @@ void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixe
// We can configure here a custom pitch
// As it's not exposed 'width * bpp' will be the expected pitch.
const u32 pitch = width * bytes_per_pixel;
- const u32 stride = Common::AlignBits(width, stride_alignment) * bytes_per_pixel;
+ const u32 stride = Common::AlignUpLog2(width, stride_alignment) * bytes_per_pixel;
const u32 gobs_in_x = Common::DivCeilLog2(stride, GOB_SIZE_X_SHIFT);
const u32 block_size = gobs_in_x << (GOB_SIZE_SHIFT + block_height + block_depth);
@@ -217,9 +217,9 @@ void SwizzleKepler(const u32 width, const u32 height, const u32 dst_x, const u32
std::size_t CalculateSize(bool tiled, u32 bytes_per_pixel, u32 width, u32 height, u32 depth,
u32 block_height, u32 block_depth) {
if (tiled) {
- const u32 aligned_width = Common::AlignBits(width * bytes_per_pixel, GOB_SIZE_X_SHIFT);
- const u32 aligned_height = Common::AlignBits(height, GOB_SIZE_Y_SHIFT + block_height);
- const u32 aligned_depth = Common::AlignBits(depth, GOB_SIZE_Z_SHIFT + block_depth);
+ const u32 aligned_width = Common::AlignUpLog2(width * bytes_per_pixel, GOB_SIZE_X_SHIFT);
+ const u32 aligned_height = Common::AlignUpLog2(height, GOB_SIZE_Y_SHIFT + block_height);
+ const u32 aligned_depth = Common::AlignUpLog2(depth, GOB_SIZE_Z_SHIFT + block_depth);
return aligned_width * aligned_height * aligned_depth;
} else {
return width * height * depth * bytes_per_pixel;