mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 04:42:20 +02:00
Fix uncompressed textures for android
This commit is contained in:
parent
40a7634a53
commit
e418339876
2 changed files with 7 additions and 1 deletions
|
@ -476,7 +476,6 @@ void copyCompressedTexGPUMem(const gpu::Texture& texture, GLenum texTarget, GLui
|
|||
void GLESVariableAllocationTexture::copyTextureMipsInGPUMem(GLuint srcId, GLuint destId, uint16_t srcMipOffset, uint16_t destMipOffset, uint16_t populatedMips) {
|
||||
uint16_t numMips = _gpuObject.getNumMips();
|
||||
withPreservedTexture([&] {
|
||||
qDebug() << "[TEXTURE] is compressed: " << _texelFormat.isCompressed();
|
||||
if (_texelFormat.isCompressed()) {
|
||||
copyCompressedTexGPUMem(_gpuObject, _target, srcId, destId, numMips, srcMipOffset, destMipOffset, populatedMips);
|
||||
} else {
|
||||
|
|
|
@ -689,6 +689,7 @@ void generateMips(gpu::Texture* texture, QImage&& image, const std::atomic<bool>
|
|||
}
|
||||
#else
|
||||
texture->setAutoGenerateMips(true);
|
||||
texture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -727,9 +728,15 @@ gpu::TexturePointer TextureUsage::process2DTextureColorFromImage(QImage&& srcIma
|
|||
bool validAlpha = image.hasAlphaChannel();
|
||||
bool alphaAsMask = false;
|
||||
|
||||
#ifndef ANDROID
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
#else
|
||||
if (image.format() != QImage::Format_RGBA8888) {
|
||||
image = image.convertToFormat(QImage::Format_RGBA8888);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (validAlpha) {
|
||||
processTextureAlpha(image, validAlpha, alphaAsMask);
|
||||
|
|
Loading…
Reference in a new issue