mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 22:58:43 +02:00
Fix TextureCache not compressing textures on Android
This commit is contained in:
parent
6be0c43fca
commit
2ba2c4b68a
1 changed files with 5 additions and 6 deletions
|
@ -281,10 +281,12 @@ gpu::TexturePointer TextureCache::getImageTexture(const QString& path, image::Te
|
||||||
auto loader = image::TextureUsage::getTextureLoaderForType(type, options);
|
auto loader = image::TextureUsage::getTextureLoaderForType(type, options);
|
||||||
#ifdef USE_GLES
|
#ifdef USE_GLES
|
||||||
gpu::BackendTarget target = gpu::BackendTarget::GLES32;
|
gpu::BackendTarget target = gpu::BackendTarget::GLES32;
|
||||||
|
bool shouldCompress = true;
|
||||||
#else
|
#else
|
||||||
gpu::BackendTarget target = gpu::BackendTarget::GL45;
|
gpu::BackendTarget target = gpu::BackendTarget::GL45;
|
||||||
|
bool shouldCompress = false;
|
||||||
#endif
|
#endif
|
||||||
return gpu::TexturePointer(loader(std::move(image), path.toStdString(), false, target, false));
|
return gpu::TexturePointer(loader(std::move(image), path.toStdString(), shouldCompress, target, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<Resource> TextureCache::createResource(const QUrl& url, const QSharedPointer<Resource>& fallback,
|
QSharedPointer<Resource> TextureCache::createResource(const QUrl& url, const QSharedPointer<Resource>& fallback,
|
||||||
|
@ -1168,14 +1170,11 @@ void ImageReader::read() {
|
||||||
|
|
||||||
#ifdef USE_GLES
|
#ifdef USE_GLES
|
||||||
constexpr bool shouldCompress = true;
|
constexpr bool shouldCompress = true;
|
||||||
|
gpu::BackendTarget target = gpu::BackendTarget::GLES32;
|
||||||
#else
|
#else
|
||||||
constexpr bool shouldCompress = false;
|
constexpr bool shouldCompress = false;
|
||||||
#endif
|
|
||||||
#ifdef USE_GLES
|
|
||||||
gpu::BackendTarget target = gpu::BackendTarget::GLES32;
|
|
||||||
#else
|
|
||||||
gpu::BackendTarget target = gpu::BackendTarget::GL45;
|
gpu::BackendTarget target = gpu::BackendTarget::GL45;
|
||||||
#endif
|
#endif
|
||||||
texture = image::processImage(std::move(buffer), _url.toString().toStdString(), _maxNumPixels, networkTexture->getTextureType(), shouldCompress, target);
|
texture = image::processImage(std::move(buffer), _url.toString().toStdString(), _maxNumPixels, networkTexture->getTextureType(), shouldCompress, target);
|
||||||
|
|
||||||
if (!texture) {
|
if (!texture) {
|
||||||
|
|
Loading…
Reference in a new issue