summaryrefslogtreecommitdiff
path: root/src/video_core/textures/decoders.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-25 00:29:18 -0400
committerGravatar GitHub2018-10-25 00:29:18 -0400
commitf7a173de6c574a5117bfe70df3635247ae28edb0 (patch)
tree5f00562a0143fdca73c0c2bec0daaf62b4d15cad /src/video_core/textures/decoders.cpp
parentMerge pull request #1575 from lioncash/qstring (diff)
parentFixed Layered Textures Loading and Cubemaps (diff)
downloadyuzu-f7a173de6c574a5117bfe70df3635247ae28edb0.tar.gz
yuzu-f7a173de6c574a5117bfe70df3635247ae28edb0.tar.xz
yuzu-f7a173de6c574a5117bfe70df3635247ae28edb0.zip
Merge pull request #1524 from FernandoS27/layers-fix
rasterizer: Fix Layered Textures Loading and Cubemaps
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
-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 da7989db9..550ca856c 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -319,13 +319,13 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
319std::size_t CalculateSize(bool tiled, u32 bytes_per_pixel, u32 width, u32 height, u32 depth, 319std::size_t CalculateSize(bool tiled, u32 bytes_per_pixel, u32 width, u32 height, u32 depth,
320 u32 block_height, u32 block_depth) { 320 u32 block_height, u32 block_depth) {
321 if (tiled) { 321 if (tiled) {
322 const u32 gobs_in_x = 64 / bytes_per_pixel; 322 const u32 gobs_in_x = 64;
323 const u32 gobs_in_y = 8; 323 const u32 gobs_in_y = 8;
324 const u32 gobs_in_z = 1; 324 const u32 gobs_in_z = 1;
325 const u32 aligned_width = Common::AlignUp(width, gobs_in_x); 325 const u32 aligned_width = Common::AlignUp(width * bytes_per_pixel, gobs_in_x);
326 const u32 aligned_height = Common::AlignUp(height, gobs_in_y * block_height); 326 const u32 aligned_height = Common::AlignUp(height, gobs_in_y * block_height);
327 const u32 aligned_depth = Common::AlignUp(depth, gobs_in_z * block_depth); 327 const u32 aligned_depth = Common::AlignUp(depth, gobs_in_z * block_depth);
328 return aligned_width * aligned_height * aligned_depth * bytes_per_pixel; 328 return aligned_width * aligned_height * aligned_depth;
329 } else { 329 } else {
330 return width * height * depth * bytes_per_pixel; 330 return width * height * depth * bytes_per_pixel;
331 } 331 }