diff options
author | Antti Määttä <antti.maatta@qt.io> | 2020-10-02 10:20:14 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2020-10-06 06:47:19 +0300 |
commit | d0e28c072e402fa1e7dcac639cbc96a8caf2f0d5 (patch) | |
tree | 5217c7f0c2711b2e5d3d9ad077c8c499d2910dcc /src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp | |
parent | 58c0ba0f94df44c4ef24af864cb63d163fedfa1c (diff) |
Fix crash when slide change occurs
The buffer manager needs to use resolved paths for each image loading
function. Also convert to use QString to avoid unnecessary string
conversions. Also fix image loading task to use resolved paths.
Task-number: QT3DS-4177
Change-Id: I79fae56a8f49ccbdcaed1fa9eb9a9d875583d0dd
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp')
-rw-r--r-- | src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp b/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp index 634e3c0..eee0c0b 100644 --- a/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp +++ b/src/runtimerender/resourcemanager/Qt3DSRenderLoadedTexture.cpp @@ -944,14 +944,12 @@ SLoadedTexture *SLoadedTexture::Load(const QString &path, NVFoundationBase &inFo } else if (path.endsWith(QLatin1String("ktx"), Qt::CaseInsensitive)) { // We need to flip y coordinate in shader as it cannot be done at load time for // compressed textures. - bufferManager->SetInvertImageUVCoords(bufferManager->GetStringTable().RegisterStr(path), - inFlipCompressed); + bufferManager->SetInvertImageUVCoords(path, inFlipCompressed); theLoadedImage = LoadKTX(*theStream, inFlipY, inFoundation, renderContextType); } else if (path.endsWith(QLatin1String("astc"), Qt::CaseInsensitive)) { // We need to flip y coordinate in shader as it cannot be done at load time for // compressed textures. - bufferManager->SetInvertImageUVCoords(bufferManager->GetStringTable().RegisterStr(path), - inFlipCompressed); + bufferManager->SetInvertImageUVCoords(path, inFlipCompressed); theLoadedImage = LoadASTC(fileName, inFlipY, inFoundation, renderContextType); } else { qCWarning(INTERNAL_ERROR, "Unrecognized image extension: %s", qPrintable(path)); |