From 021cf914af4d6038ffb0a688daa0c609fc05f2d2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 4 May 2021 23:59:02 +0300 Subject: SL-15159 Removed dead yet expensive code "prim_cost" and "description_label" do not appear to be in use, other cost data not in use --- indra/newview/llfloatermodelpreview.cpp | 7 +--- indra/newview/llfloatermodelpreview.h | 2 +- indra/newview/llmodelpreview.cpp | 73 ++------------------------------- indra/newview/llmodelpreview.h | 5 +-- 4 files changed, 8 insertions(+), 79 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6f5b95b602..960fe133ac 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -342,7 +342,7 @@ void LLFloaterModelPreview::initModelPreview() mModelPreview = new LLModelPreview(tex_width, tex_height, this); mModelPreview->setPreviewTarget(PREVIEW_CAMERA_DISTANCE); - mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5)); + mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3)); mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1)); } @@ -803,9 +803,6 @@ void LLFloaterModelPreview::draw() } } - childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost)); - childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); - if (!isMinimized() && mModelPreview->lodsReady()) { draw3dPreview(); @@ -1545,7 +1542,7 @@ void LLFloaterModelPreview::addStringToLogTab(const std::string& str, bool flash } } -void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost) +void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z) { assert_main_thread(); childSetTextArg("import_dimensions", "[X]", llformat("%.3f", x)); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8a01b0c307..bb8cf1c587 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -90,7 +90,7 @@ public: void clearAvatarTab(); // clears table void updateAvatarTab(bool highlight_overrides); // populates table and data as nessesary - void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); + void setDetails(F32 x, F32 y, F32 z); void setPreviewLOD(S32 lod); void onBrowseLOD(S32 lod); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 252fb7ec98..6b50e1f800 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -253,27 +253,14 @@ LLModelPreview::~LLModelPreview() } } -U32 LLModelPreview::calcResourceCost() +void LLModelPreview::updateDimentionsAndOffsets() { assert_main_thread(); rebuildUploadData(); - //Upload skin is selected BUT check to see if the joints coming in from the asset were malformed. - if (mFMP && mFMP->childGetValue("upload_skin").asBoolean()) - { - bool uploadingJointPositions = mFMP->childGetValue("upload_joints").asBoolean(); - if (uploadingJointPositions && !isRigValidForJointPositionUpload()) - { - mFMP->childDisable("ok_btn"); - } - } - std::set accounted; - U32 num_points = 0; - U32 num_hulls = 0; - F32 debug_scale = mFMP ? mFMP->childGetValue("import_scale").asReal() : 1.f; mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 3.0f; if (mFMP && mFMP->childGetValue("upload_joints").asBoolean()) @@ -285,8 +272,6 @@ U32 LLModelPreview::calcResourceCost() getPreviewAvatar()->addPelvisFixup(mPelvisZOffset, fake_mesh_id); } - F32 streaming_cost = 0.f; - F32 physics_cost = 0.f; for (U32 i = 0; i < mUploadData.size(); ++i) { LLModelInstance& instance = mUploadData[i]; @@ -295,11 +280,6 @@ U32 LLModelPreview::calcResourceCost() { accounted.insert(instance.mModel); - LLModel::Decomposition& decomp = - instance.mLOD[LLModel::LOD_PHYSICS] ? - instance.mLOD[LLModel::LOD_PHYSICS]->mPhysics : - instance.mModel->mPhysics; - //update instance skin info for each lods pelvisZoffset for (int j = 0; jmSkinInfo.mPelvisOffset = mPelvisZOffset; } } - - std::stringstream ostr; - LLSD ret = LLModel::writeModel(ostr, - instance.mLOD[4], - instance.mLOD[3], - instance.mLOD[2], - instance.mLOD[1], - instance.mLOD[0], - decomp, - mFMP->childGetValue("upload_skin").asBoolean(), - mFMP->childGetValue("upload_joints").asBoolean(), - mFMP->childGetValue("lock_scale_if_joint_position").asBoolean(), - TRUE, - FALSE, - instance.mModel->mSubmodelID); - - num_hulls += decomp.mHull.size(); - for (U32 i = 0; i < decomp.mHull.size(); ++i) - { - num_points += decomp.mHull[i].size(); - } - - //calculate streaming cost - LLMatrix4 transformation = instance.mTransform; - - LLVector3 position = LLVector3(0, 0, 0) * transformation; - - LLVector3 x_transformed = LLVector3(1, 0, 0) * transformation - position; - LLVector3 y_transformed = LLVector3(0, 1, 0) * transformation - position; - LLVector3 z_transformed = LLVector3(0, 0, 1) * transformation - position; - F32 x_length = x_transformed.normalize(); - F32 y_length = y_transformed.normalize(); - F32 z_length = z_transformed.normalize(); - LLVector3 scale = LLVector3(x_length, y_length, z_length); - - F32 radius = scale.length()*0.5f*debug_scale; - - LLMeshCostData costs; - if (gMeshRepo.getCostData(ret, costs)) - { - streaming_cost += costs.getRadiusBasedStreamingCost(radius); - } } } F32 scale = mFMP ? mFMP->childGetValue("import_scale").asReal()*2.f : 2.f; - mDetailsSignal(mPreviewScale[0] * scale, mPreviewScale[1] * scale, mPreviewScale[2] * scale, streaming_cost, physics_cost); + mDetailsSignal((F32)(mPreviewScale[0] * scale), (F32)(mPreviewScale[1] * scale), (F32)(mPreviewScale[2] * scale)); updateStatusMessages(); - - return (U32)streaming_cost; } void LLModelPreview::rebuildUploadData() @@ -1694,8 +1630,6 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim } } - mResourceCost = calcResourceCost(); - LLVertexBuffer::unbind(); LLGLSLShader::sNoFixedFunction = no_ff; if (shader) @@ -2533,9 +2467,8 @@ void LLModelPreview::update() if (mDirty && mLodsQuery.empty()) { mDirty = false; - mResourceCost = calcResourceCost(); + updateDimentionsAndOffsets(); refresh(); - updateStatusMessages(); } } diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 3664a27a72..8e59c71a55 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -115,7 +115,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex { LOG_CLASS(LLModelPreview); - typedef boost::signals2::signal details_signal_t; + typedef boost::signals2::signal details_signal_t; typedef boost::signals2::signal model_loaded_signal_t; typedef boost::signals2::signal model_updated_signal_t; @@ -158,7 +158,7 @@ public: void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); void restoreNormals(); - U32 calcResourceCost(); + void updateDimentionsAndOffsets(); void rebuildUploadData(); void saveUploadData(bool save_skinweights, bool save_joint_positions, bool lock_scale_if_joint_position); void saveUploadData(const std::string& filename, bool save_skinweights, bool save_joint_positions, bool lock_scale_if_joint_position); @@ -239,7 +239,6 @@ protected: LLVector3 mPreviewScale; S32 mPreviewLOD; S32 mPhysicsSearchLOD; - U32 mResourceCost; std::string mLODFile[LLModel::NUM_LODS]; bool mLoading; U32 mLoadState; -- cgit v1.2.3