summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]indra/newview/app_settings/settings.xml11
-rwxr-xr-x[-rw-r--r--]indra/newview/llmeshrepository.cpp65
-rwxr-xr-x[-rw-r--r--]indra/newview/llmeshrepository.h4
3 files changed, 80 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c4af9e2ab6..75bd29ecd4 100644..100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5545,6 +5545,17 @@
<key>Value</key>
<real>0</real>
</map>
+ <key>MeshUseWholeModelUpload</key>
+ <map>
+ <key>Comment</key>
+ <string>Upload model in its entirety instead of mesh-by-mesh (new caps)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <real>0</real>
+ </map>
<key>MigrateCacheDirectory</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index dd2ffdf7f1..4c04b0ea35 100644..100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1239,6 +1239,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset");
mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice");
+ mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");
mOrigin += gAgent.getAtAxis() * scale.magVec();
}
@@ -1330,6 +1331,70 @@ BOOL LLMeshUploadThread::isDiscarded()
void LLMeshUploadThread::run()
{
+ if (gSavedSettings.getBOOL("MeshUseWholeModelUpload"))
+ {
+ doWholeModelUpload();
+ }
+ else
+ {
+ doIterativeUpload();
+ }
+}
+
+void LLMeshUploadThread::doWholeModelUpload()
+{
+ // Queue up models for hull generation (viewer-side)
+ for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
+ {
+ LLMeshUploadData data;
+ data.mBaseModel = iter->first;
+
+ LLModelInstance& instance = *(iter->second.begin());
+
+ for (S32 i = 0; i < 5; i++)
+ {
+ data.mModel[i] = instance.mLOD[i];
+ }
+
+ //queue up models for hull generation
+ LLModel* physics = NULL;
+
+ if (data.mModel[LLModel::LOD_PHYSICS].notNull())
+ {
+ physics = data.mModel[LLModel::LOD_PHYSICS];
+ }
+ else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
+ {
+ physics = data.mModel[LLModel::LOD_MEDIUM];
+ }
+ else
+ {
+ physics = data.mModel[LLModel::LOD_HIGH];
+ }
+
+ if (!physics)
+ {
+ llerrs << "WTF?" << llendl;
+ }
+
+ DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
+ gMeshRepo.mDecompThread->submitRequest(request);
+ }
+
+ while (!mPhysicsComplete)
+ {
+ apr_sleep(100);
+ }
+
+ bool do_include_textures = false; // not needed for initial cost/validation check.
+ LLSD model_data = wholeModelToLLSD(do_include_textures);
+
+ // Currently a no-op.
+ mFinished = true;
+}
+
+void LLMeshUploadThread::doIterativeUpload()
+{
if(isDiscarded())
{
mFinished = true;
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 5983a282a2..e2faed52cf 100644..100755
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -387,6 +387,7 @@ public:
LLHost mHost;
std::string mUploadObjectAssetCapability;
std::string mNewInventoryCapability;
+ std::string mWholeModelUploadCapability;
std::queue<LLMeshUploadData> mUploadQ;
std::queue<LLMeshUploadData> mConfirmedQ;
@@ -420,6 +421,9 @@ public:
void preStart();
void discard() ;
BOOL isDiscarded();
+
+ void doWholeModelUpload();
+ void doIterativeUpload();
};
class LLMeshRepository