mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +02:00
Remove pointer to file in NetworkTexture
This commit is contained in:
parent
4d3fc39ab6
commit
54fc8085f3
2 changed files with 4 additions and 9 deletions
|
@ -732,13 +732,11 @@ void NetworkTexture::handleFinishedInitialLoad() {
|
||||||
Q_ARG(int, 0),
|
Q_ARG(int, 0),
|
||||||
Q_ARG(int, 0));
|
Q_ARG(int, 0));
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
_file = file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newKtxDescriptor = memKtx->toDescriptor();
|
auto newKtxDescriptor = memKtx->toDescriptor();
|
||||||
|
|
||||||
texture = gpu::Texture::unserialize(_file->getFilepath(), newKtxDescriptor);
|
texture = gpu::Texture::unserialize(file->getFilepath(), newKtxDescriptor);
|
||||||
texture->setKtxBacking(file->getFilepath());
|
texture->setKtxBacking(file->getFilepath());
|
||||||
texture->setSource(filename);
|
texture->setSource(filename);
|
||||||
|
|
||||||
|
@ -933,11 +931,11 @@ void ImageReader::read() {
|
||||||
const char* data = reinterpret_cast<const char*>(memKtx->_storage->data());
|
const char* data = reinterpret_cast<const char*>(memKtx->_storage->data());
|
||||||
size_t length = memKtx->_storage->size();
|
size_t length = memKtx->_storage->size();
|
||||||
auto& ktxCache = textureCache->_ktxCache;
|
auto& ktxCache = textureCache->_ktxCache;
|
||||||
networkTexture->_file = ktxCache.writeFile(data, KTXCache::Metadata(hash, length)); //
|
auto file = ktxCache.writeFile(data, KTXCache::Metadata(hash, length));
|
||||||
if (!networkTexture->_file) {
|
if (!file) {
|
||||||
qCWarning(modelnetworking) << _url << "file cache failed";
|
qCWarning(modelnetworking) << _url << "file cache failed";
|
||||||
} else {
|
} else {
|
||||||
texture->setKtxBacking(networkTexture->_file->getFilepath());
|
texture->setKtxBacking(file->getFilepath());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCWarning(modelnetworking) << "Unable to serialize texture to KTX " << _url;
|
qCWarning(modelnetworking) << "Unable to serialize texture to KTX " << _url;
|
||||||
|
|
|
@ -101,9 +101,6 @@ private:
|
||||||
bool _sourceIsKTX { false };
|
bool _sourceIsKTX { false };
|
||||||
KTXResourceState _ktxResourceState { PENDING_INITIAL_LOAD };
|
KTXResourceState _ktxResourceState { PENDING_INITIAL_LOAD };
|
||||||
|
|
||||||
// TODO Can this be removed?
|
|
||||||
KTXFilePointer _file;
|
|
||||||
|
|
||||||
// The current mips that are currently being requested w/ _ktxMipRequest
|
// The current mips that are currently being requested w/ _ktxMipRequest
|
||||||
std::pair<uint16_t, uint16_t> _ktxMipLevelRangeInFlight{ NULL_MIP_LEVEL, NULL_MIP_LEVEL };
|
std::pair<uint16_t, uint16_t> _ktxMipLevelRangeInFlight{ NULL_MIP_LEVEL, NULL_MIP_LEVEL };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue