From 5875b79cc426d1d031af200c23429a334811699a Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 11 Mar 2017 23:40:43 -0600 Subject: [PATCH] Compressed textures apparently don't have to have a height multiple of 32 either. --- src/xenia/gpu/texture_info.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xenia/gpu/texture_info.cc b/src/xenia/gpu/texture_info.cc index d23d61115..16f7f4daa 100644 --- a/src/xenia/gpu/texture_info.cc +++ b/src/xenia/gpu/texture_info.cc @@ -212,18 +212,20 @@ void TextureInfo::CalculateTextureSizes2D(const xe_gpu_texture_fetch_t& fetch) { format_info->block_height; // Tiles are 32x32 blocks. All textures must be multiples of tile dimensions. - // ...except linear textures don't seem to need a multiple of 32 for height. + // ...except textures don't seem to need a multiple of 32 for height. uint32_t tile_width = uint32_t(std::ceil(block_width / 32.0f)); uint32_t tile_height = uint32_t(std::ceil(block_height / 32.0f)); size_2d.block_width = tile_width * 32; - size_2d.block_height = format_info->type == FormatType::kCompressed + size_2d.block_height = + /*format_info->type == FormatType::kCompressed ? tile_height * 32 - : block_height; + :*/ block_height; uint32_t bytes_per_block = format_info->block_width * format_info->block_height * format_info->bits_per_pixel / 8; uint32_t byte_pitch = size_2d.block_width * bytes_per_block; + if (!is_tiled) { // Each row must be a multiple of 256 in linear textures. byte_pitch = xe::round_up(byte_pitch, 256);