mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 21:33:00 +02:00
fix issues while testing the ktxStorage
This commit is contained in:
parent
262d7c3b79
commit
e8835b34f4
4 changed files with 10 additions and 4 deletions
|
@ -142,8 +142,12 @@ void GL45Texture::copyMipFaceFromTexture(uint16_t sourceMip, uint16_t targetMip,
|
|||
}
|
||||
auto size = _gpuObject.evalMipDimensions(sourceMip);
|
||||
auto mipData = _gpuObject.accessStoredMipFace(sourceMip, face);
|
||||
GLTexelFormat texelFormat = GLTexelFormat::evalGLTexelFormat(_gpuObject.getTexelFormat(), _gpuObject.getStoredMipFormat());
|
||||
copyMipFaceLinesFromTexture(targetMip, face, size, 0, texelFormat.format, texelFormat.type, mipData->readData());
|
||||
if (mipData) {
|
||||
GLTexelFormat texelFormat = GLTexelFormat::evalGLTexelFormat(_gpuObject.getTexelFormat(), _gpuObject.getStoredMipFormat());
|
||||
copyMipFaceLinesFromTexture(targetMip, face, size, 0, texelFormat.format, texelFormat.type, mipData->readData());
|
||||
} else {
|
||||
qCDebug(gpugllogging) << "Missing mipData level=" << sourceMip << " face=" << (int)face << " for texture " << _gpuObject.source().c_str();
|
||||
}
|
||||
}
|
||||
|
||||
void GL45Texture::syncSampler() const {
|
||||
|
|
|
@ -294,7 +294,7 @@ namespace ktx {
|
|||
};
|
||||
|
||||
using Storage = storage::Storage;
|
||||
using StoragePointer = std::unique_ptr<Storage>;
|
||||
using StoragePointer = std::shared_ptr<Storage>;
|
||||
|
||||
// Header
|
||||
struct Header {
|
||||
|
|
|
@ -106,6 +106,7 @@ gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bo
|
|||
std::string cleanedName = name;
|
||||
cleanedName = cleanedName.substr(cleanedName.find_last_of((char) '//') + 1);
|
||||
std::string cacheFilename(ktxCacheFolder.toStdString());
|
||||
cacheFilename += "/";
|
||||
cacheFilename += cleanedName;
|
||||
cacheFilename += ".ktx";
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@ FileStoragePointer FileStorage::create(const QString& filename, size_t size, con
|
|||
}
|
||||
}
|
||||
file.close();
|
||||
return FileStoragePointer(new FileStorage(filename));
|
||||
//return FileStoragePointer(new FileStorage(filename));
|
||||
return std::make_shared<FileStorage>(filename);
|
||||
}
|
||||
|
||||
FileStorage::FileStorage(const QString& filename) : _file(filename) {
|
||||
|
|
Loading…
Reference in a new issue