Fix excessive copying when querying the size of a KTX backed texture

This commit is contained in:
Brad Davis 2017-04-21 09:46:04 -07:00
parent 6e6fd608dd
commit 960c29edb7

View file

@ -487,12 +487,11 @@ void Texture::setAutoGenerateMips(bool enable) {
}
Size Texture::getStoredMipSize(uint16 level) const {
PixelsPointer mipFace = accessStoredMipFace(level);
Size size = 0;
if (mipFace && mipFace->getSize()) {
for (int face = 0; face < getNumFaces(); face++) {
for (int face = 0; face < getNumFaces(); face++) {
if (isStoredMipFaceAvailable(level, face)) {
size += getStoredMipFaceSize(level, face);
}
}
}
return size;
}