mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
Defer mipmap gen to gpu
This commit is contained in:
parent
ec50744aa1
commit
6a6d6dd20f
1 changed files with 0 additions and 8 deletions
|
@ -171,14 +171,6 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
|
||||||
|
|
||||||
if (generateMips) {
|
if (generateMips) {
|
||||||
theTexture->autoGenerateMips(-1);
|
theTexture->autoGenerateMips(-1);
|
||||||
auto levels = theTexture->maxMip();
|
|
||||||
uvec2 size(image.width(), image.height());
|
|
||||||
for (uint8_t i = 1; i <= levels; ++i) {
|
|
||||||
size >>= 1;
|
|
||||||
size = glm::max(size, uvec2(1));
|
|
||||||
image = image.scaled(size.x, size.y, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
|
||||||
theTexture->assignStoredMip(i, formatMip, image.byteCount(), image.constBits());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue