Use target format bpb when calculating linear mip level size

This commit is contained in:
Billy Laws 2022-09-29 21:22:51 +01:00
parent 849184452c
commit 0f7c04ffb4

View File

@ -64,7 +64,7 @@ namespace skyline::gpu::texture {
for (size_t i{}; i < levelCount; i++) {
size_t linearSize{util::DivideCeil<size_t>(dimensions.width, formatBlockWidth) * formatBpb * util::DivideCeil<size_t>(dimensions.height, formatBlockHeight) * dimensions.depth};
size_t targetLinearSize{targetFormatBpb == 0 ? linearSize : util::DivideCeil<size_t>(dimensions.width, targetFormatBlockWidth) * formatBpb * util::DivideCeil<size_t>(dimensions.height, targetFormatBlockHeight) * dimensions.depth};
size_t targetLinearSize{targetFormatBpb == 0 ? linearSize : util::DivideCeil<size_t>(dimensions.width, targetFormatBlockWidth) * targetFormatBpb * util::DivideCeil<size_t>(dimensions.height, targetFormatBlockHeight) * dimensions.depth};
mipLevels.emplace_back(
dimensions,