mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 22:39:18 +02:00
Fix excessive copying when querying the size of a KTX backed texture
This commit is contained in:
parent
6e6fd608dd
commit
960c29edb7
1 changed files with 3 additions and 4 deletions
|
@ -487,12 +487,11 @@ void Texture::setAutoGenerateMips(bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Size Texture::getStoredMipSize(uint16 level) const {
|
Size Texture::getStoredMipSize(uint16 level) const {
|
||||||
PixelsPointer mipFace = accessStoredMipFace(level);
|
|
||||||
Size size = 0;
|
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);
|
size += getStoredMipFaceSize(level, face);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue