[Vulkan] Don't try to get mip 0's offset when there is only one mip.

This commit is contained in:
gibbed 2018-05-12 00:52:02 -05:00
parent a510bc3c78
commit 9926bf1cf6
1 changed files with 5 additions and 0 deletions

View File

@ -416,6 +416,11 @@ uint32_t TextureInfo::GetMipLocation(const TextureInfo& src, uint32_t mip,
uint32_t* offset_x, uint32_t* offset_y) {
if (mip == 0) {
// Short-circuit. Mip 0 is always stored in guest_address.
if (src.mip_levels <= 1) {
// Only <= 1 mip level, it can't possibly be offset.
*offset_x = *offset_y = 0;
return src.guest_address;
}
GetPackedTileOffset(src, offset_x, offset_y);
return src.guest_address;
}