Merge pull request #9883 from jherico/smarter_textures

Don't crash when failing to convert a texture to KTX format
This commit is contained in:
Zach Pomerantz 2017-03-14 12:14:56 -04:00 committed by GitHub
commit a41146451b

View file

@ -524,6 +524,7 @@ void ImageReader::read() {
// Save the image into a KTXFile
auto ktx = gpu::Texture::serialize(*texture);
if (ktx) {
const char* data = reinterpret_cast<const char*>(ktx->_storage->data());
size_t length = ktx->_storage->size();
KTXFilePointer file;
@ -535,6 +536,9 @@ void ImageReader::read() {
auto ktx = file->getKTX();
texture->setKtxBacking(ktx);
}
} else {
qCWarning(modelnetworking) << "Unable to serialize texture to KTX " << _url;
}
}
auto resource = _resource.lock(); // to ensure the resource is still needed