summaryrefslogtreecommitdiff
path: root/indra/newview/gltfscenemanager.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-05-30 16:28:56 -0500
committerGitHub <noreply@github.com>2024-05-30 16:28:56 -0500
commitd1a8a9d0c39bff726e8c298c5bad309055726a30 (patch)
treeed22bacafc1c42d458cf2c166b6ebb7364a946b5 /indra/newview/gltfscenemanager.cpp
parent0a4d37f22f78ff0b6095237c7c90bfb627464a94 (diff)
#1596 Fix for GLTF uploads failing after loading from .glb file (#1602)
Diffstat (limited to 'indra/newview/gltfscenemanager.cpp')
-rw-r--r--indra/newview/gltfscenemanager.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index a20954d7d1..df922b8f3d 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -131,7 +131,21 @@ void GLTFSceneManager::uploadSelection()
{
mPendingImageUploads++;
- LLPointer<LLImageRaw> raw = image.mTexture->getCachedRawImage();
+ LLPointer<LLImageRaw> raw;
+
+ if (image.mBufferView != INVALID_INDEX)
+ {
+ BufferView& view = asset.mBufferViews[image.mBufferView];
+ Buffer& buffer = asset.mBuffers[view.mBuffer];
+
+ raw = LLViewerTextureManager::getRawImageFromMemory(buffer.mData.data() + view.mByteOffset, view.mByteLength, image.mMimeType);
+
+ image.clearData(asset);
+ }
+ else
+ {
+ raw = image.mTexture->getCachedRawImage();
+ }
if (raw.notNull())
{
@@ -192,8 +206,6 @@ void GLTFSceneManager::uploadSelection()
failure));
upload_new_resource(uploadInfo);
-
- image.clearData(asset);
}
}
}