[Vulkan] Fix following mips for compressed textures.

This commit is contained in:
gibbed 2018-05-12 20:19:58 -05:00
parent 7a1167fd66
commit 9b64e67e14
2 changed files with 12 additions and 8 deletions

View File

@ -452,12 +452,10 @@ uint32_t TextureInfo::GetMipByteSize(const TextureInfo& src, uint32_t mip) {
xe::round_up(logical_height, src.format_info()->block_height) /
src.format_info()->block_height;
if (mip == 0) {
// Texture dimensions must be a multiple of tile
// dimensions (32x32 blocks).
block_width = xe::round_up(block_width, 32);
block_height = xe::round_up(block_height, 32);
}
// Texture dimensions must be a multiple of tile
// dimensions (32x32 blocks).
block_width = xe::round_up(block_width, 32);
block_height = xe::round_up(block_height, 32);
uint32_t byte_pitch = block_width * bytes_per_block;

View File

@ -905,8 +905,14 @@ bool TextureCache::ConvertTexture2D(uint8_t* dest,
void* host_address = memory_->TranslatePhysical(address);
// Pitch of the source texture in blocks.
uint32_t block_width = mip == 0 ? src.size.block_width
: xe::next_pow2(src.size.block_width) >> mip;
uint32_t block_width;
if (mip == 0) {
block_width = src.size.block_width;
} else {
block_width = xe::next_pow2(src.size.block_width) >> mip;
block_width = xe::round_up(block_width, 32);
}
uint32_t logical_width = src.size.logical_width >> mip;
uint32_t logical_height = src.size.logical_height >> mip;
uint32_t input_width = src.size.input_width >> mip;