summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-10-18 21:04:33 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-23 20:27:36 +0200
commite0ea2f5f6e7c177cf0944b32acb7e24234953951 (patch)
tree1563c34d93a0549323a156e501df0f436ab42ef6 /src/video_core/textures
parentMerge pull request #1531 from ogniK5377/hid-fixes (diff)
downloadyuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar.gz
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar.bz2
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar.lz
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar.xz
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.tar.zst
yuzu-e0ea2f5f6e7c177cf0944b32acb7e24234953951.zip
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/decoders.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index f1b40e7f5..56c61b60c 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -320,13 +320,13 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
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 gobs_in_x = 64 / bytes_per_pixel;
+ const u32 gobs_in_x = 64;
const u32 gobs_in_y = 8;
const u32 gobs_in_z = 1;
- const u32 aligned_width = Common::AlignUp(width, gobs_in_x);
+ const u32 aligned_width = Common::AlignUp(width * bytes_per_pixel, gobs_in_x);
const u32 aligned_height = Common::AlignUp(height, gobs_in_y * block_height);
const u32 aligned_depth = Common::AlignUp(depth, gobs_in_z * block_depth);
- return aligned_width * aligned_height * aligned_depth * bytes_per_pixel;
+ return aligned_width * aligned_height * aligned_depth;
} else {
return width * height * depth * bytes_per_pixel;
}