summaryrefslogtreecommitdiff
path: root/indra/newview/gltfscenemanager.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
committerErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
commit266e96605781960799dc5388cc1ac168432ff106 (patch)
tree5f46ae7d39a8a954ea9f79dc7216cad6aca2ee6a /indra/newview/gltfscenemanager.cpp
parent530ff898b00d1759ab4abb32dcf9767960ce7170 (diff)
parentbf949ce004c25917aabddd1cd24be812713e4602 (diff)
Merge branch '2024.12-ForeverFPS'
Diffstat (limited to 'indra/newview/gltfscenemanager.cpp')
-rw-r--r--indra/newview/gltfscenemanager.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index f362fa51cb..43e8fa3e3c 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -356,8 +356,9 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id)
llassert(obj->getVolume()->getParams().getSculptID() == gltf_id);
llassert(obj->getVolume()->getParams().getSculptType() == LL_SCULPT_TYPE_GLTF);
- if (obj->mGLTFAsset)
- { // object already has a GLTF asset, don't reload it
+ if (obj->mGLTFAsset || obj->mIsGLTFAssetMissing )
+ {
+ // object already has a GLTF asset or load failed, don't reload it
// TODO: below assertion fails on dupliate requests for assets -- possibly need to touch up asset loading state machine
// llassert(std::find(mObjects.begin(), mObjects.end(), obj) != mObjects.end());
@@ -398,16 +399,19 @@ void GLTFSceneManager::onGLTFBinLoadComplete(const LLUUID& id, LLAssetType::ETyp
}
else
{
- LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL;
+ LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << ". Marking as missing." << LL_ENDL;
+ obj->mIsGLTFAssetMissing = true;
obj->mGLTFAsset = nullptr;
}
}
}
+ obj->unref(); // todo: use LLPointer
}
}
else
{
- LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
+ LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << ". Marking as missing." << LL_ENDL;
+ obj->mIsGLTFAssetMissing = true;
obj->unref();
}
});
@@ -446,7 +450,8 @@ void GLTFSceneManager::onGLTFLoadComplete(const LLUUID& id, LLAssetType::EType a
}
else
{
- LL_WARNS("GLTF") << "Buffer URI is not a valid UUID: " << buffer.mUri << LL_ENDL;
+ LL_WARNS("GLTF") << "Buffer URI is not a valid UUID: " << buffer.mUri << " for asset id: " << id << ". Marking as missing." << LL_ENDL;
+ obj->mIsGLTFAssetMissing = true;
obj->unref();
return;
}
@@ -455,7 +460,8 @@ void GLTFSceneManager::onGLTFLoadComplete(const LLUUID& id, LLAssetType::EType a
}
else
{
- LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
+ LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << ". Marking as missing." << LL_ENDL;
+ obj->mIsGLTFAssetMissing = true;
obj->unref();
}
}
@@ -500,7 +506,7 @@ void GLTFSceneManager::update()
LLNewBufferedResourceUploadInfo::uploadFinish_f finish = [this, buffer](LLUUID assetId, LLSD response)
{
LLAppViewer::instance()->postToMainCoro(
- [=]()
+ [=, this]()
{
if (mUploadingAsset)
{
@@ -517,6 +523,7 @@ void GLTFSceneManager::update()
if (mUploadingObject)
{
mUploadingObject->mGLTFAsset = nullptr;
+ mUploadingObject->mIsGLTFAssetMissing = false;
mUploadingObject->setGLTFAsset(assetId);
mUploadingObject->markForUpdate();
mUploadingObject = nullptr;
@@ -975,9 +982,9 @@ void renderAssetDebug(LLViewerObject* obj, Asset* asset)
LLVector4a t;
agent_to_asset.affineTransform(gDebugRaycastStart, t);
- start = glm::make_vec4(t.getF32ptr());
+ start = vec4(t);
agent_to_asset.affineTransform(gDebugRaycastEnd, t);
- end = glm::make_vec4(t.getF32ptr());
+ end = vec4(t);
start.w = end.w = 1.0;