From 3346281be35ab6fa3a46c7f166bb1f7da066d5e3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 18 Sep 2017 19:51:44 +0100 Subject: SL-790 - Adding UI checks for actions that would increase the animated object attachment count --- indra/llcommon/indra_constants.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fda84aa5a8..99ad5f2473 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -154,6 +154,7 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants const S32 MAX_AGENT_ATTACHMENTS = 38; +const S32 MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS = 1; const U8 ATTACHMENT_ADD = 0x80; // god levels -- cgit v1.3 From a6068419e7fe1a5a0eda007b2e989769c0a92262 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 22 Sep 2017 18:04:03 +0100 Subject: SL-794, SL-790 - viewer-side enforcement in UI for various animated object limits that are also enforced on the server. --- indra/llcommon/indra_constants.h | 1 - indra/newview/llmeshrepository.cpp | 27 ++++++++++++++++++ indra/newview/llmeshrepository.h | 1 + indra/newview/llselectmgr.cpp | 29 +++++++++++++++++++ indra/newview/llselectmgr.h | 3 ++ indra/newview/llviewerobject.cpp | 33 +++++++++++++++++++++- indra/newview/llviewerobject.h | 3 ++ indra/newview/llvoavatar.cpp | 21 +++++++++++++- indra/newview/llvoavatar.h | 1 + indra/newview/llvovolume.cpp | 26 ++++++++++++----- indra/newview/llvovolume.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 23 +++++++++++++++ 12 files changed, 159 insertions(+), 10 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 99ad5f2473..fda84aa5a8 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -154,7 +154,6 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; // attachment constants const S32 MAX_AGENT_ATTACHMENTS = 38; -const S32 MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS = 1; const U8 ATTACHMENT_ADD = 0x80; // god levels diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index c2a0393170..92c2be4a8b 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4021,6 +4021,33 @@ void LLMeshRepository::uploadError(LLSD& args) mUploadErrorQ.push(args); } +F32 LLMeshRepository::getEstTrianglesHigh(LLUUID mesh_id) +{ + F32 triangles_high = 0.f; + if (mThread && mesh_id.notNull()) + { + LLMutexLock lock(mThread->mHeaderMutex); + LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); + if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) + { + LLSD& header = iter->second; + if (header.has("404") + || !header.has("lowest_lod") + || (header.has("version") && header["version"].asInteger() > MAX_MESH_VERSION)) + { + return 0.f; + } + + S32 bytes_high = header["high_lod"]["size"].asInteger(); + F32 METADATA_DISCOUNT = (F32) gSavedSettings.getU32("MeshMetaDataDiscount"); //discount 128 bytes to cover the cost of LLSD tags and compression domain overhead + F32 MINIMUM_SIZE = (F32) gSavedSettings.getU32("MeshMinimumByteSize"); //make sure nothing is "free" + F32 bytes_per_triangle = (F32) gSavedSettings.getU32("MeshBytesPerTriangle"); + triangles_high = llmax((F32) bytes_high-METADATA_DISCOUNT, MINIMUM_SIZE)/bytes_per_triangle; + } + } + return triangles_high; +} + F32 LLMeshRepository::getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { if (mThread && mesh_id.notNull()) diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 23af837f6f..28f037b85e 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -472,6 +472,7 @@ public: static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events + F32 getEstTrianglesHigh(LLUUID mesh_id); F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 3e8d8883e0..d3f240ac91 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -663,6 +663,10 @@ void LLSelectMgr::confirmUnlinkObjects(const LLSD& notification, const LLSD& res // otherwise. this allows the handle_link method to more finely check // the selection and give an error message when the uer has a // reasonable expectation for the link to work, but it will fail. +// +// AXON - additional check that if the selection includes at least one +// animated object, the total mesh triangle count cannot exceed the +// designated limit. bool LLSelectMgr::enableLinkObjects() { bool new_value = false; @@ -687,6 +691,10 @@ bool LLSelectMgr::enableLinkObjects() new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } + if (!LLSelectMgr::getInstance()->getSelection()->checkAnimatedObjectEstTris()) + { + new_value = false; + } return new_value; } @@ -7421,6 +7429,27 @@ bool LLObjectSelection::applyToObjects(LLSelectedObjectFunctor* func) return result; } +bool LLObjectSelection::checkAnimatedObjectEstTris() +{ + F32 est_tris = 0; + F32 max_tris = 0; + S32 anim_count = 0; + for (root_iterator iter = root_begin(); iter != root_end(); ) + { + root_iterator nextiter = iter++; + LLViewerObject* object = (*nextiter)->getObject(); + if (!object) + continue; + if (object->isAnimatedObject()) + { + anim_count++; + } + est_tris += object->recursiveGetEstTrianglesHigh(); + max_tris = llmax((F32)max_tris,(F32)object->getAnimatedObjectMaxTris()); + } + return anim_count==0 || est_tris <= max_tris; +} + bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool firstonly) { bool result = firstonly ? false : true; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index fc4b920c51..4e79cb003d 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -339,6 +339,9 @@ public: // returns TRUE is any node is currenly worn as an attachment BOOL isAttachment(); + // AXON validate a potential link against limits + bool checkAnimatedObjectEstTris(); + // Apply functors to various subsets of the selected objects // If firstonly is FALSE, returns the AND of all apply() calls. // Else returns TRUE immediately if any apply() call succeeds (i.e. OR with early exit) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 34e7bc0fad..0140a63e73 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3580,6 +3580,38 @@ F32 LLViewerObject::getLinksetPhysicsCost() return mLinksetPhysicsCost; } +F32 LLViewerObject::recursiveGetEstTrianglesHigh() const +{ + F32 est_tris = getEstTrianglesHigh(); + for (child_list_t::const_iterator iter = mChildList.begin(); + iter != mChildList.end(); iter++) + { + const LLViewerObject* child = *iter; + est_tris += child->recursiveGetEstTrianglesHigh(); + } + return est_tris; +} + +S32 LLViewerObject::getAnimatedObjectMaxTris() const +{ + S32 max_tris = 0; + LLSD features; + if (getRegion()) + { + getRegion()->getSimulatorFeatures(features); + if (features.has("AnimatedObjects")) + { + max_tris = features["AnimatedObjects"]["AnimatedObjectMaxTris"].asInteger(); + } + } + return max_tris; +} + +F32 LLViewerObject::getEstTrianglesHigh() const +{ + return 0.f; +} + F32 LLViewerObject::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const { return 0.f; @@ -3698,7 +3730,6 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */) } } - void LLViewerObject::setLineWidthForWindowSize(S32 window_width) { if (window_width < 700) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index c79ff7bb74..a1a7eed002 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -357,6 +357,9 @@ public: virtual void setScale(const LLVector3 &scale, BOOL damped = FALSE); + S32 getAnimatedObjectMaxTris() const; + F32 recursiveGetEstTrianglesHigh() const; + virtual F32 getEstTrianglesHigh() const; virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const; virtual U32 getTriangleCount(S32* vcount = NULL) const; virtual U32 getHighLODTriangleCount(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5e0c5d6858..ac5d1b335c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6602,13 +6602,32 @@ U32 LLVOAvatar::getNumAnimatedObjectAttachments() const return num_attachments; } +//----------------------------------------------------------------------------- +// getMaxAnimatedObjectAttachments() +// Gets from simulator feature if available, otherwise 0. +//----------------------------------------------------------------------------- +S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const +{ + S32 max_attach = 0; + LLSD features; + if (getRegion()) + { + getRegion()->getSimulatorFeatures(features); + if (features.has("AnimatedObjects")) + { + max_attach = features["AnimatedObjects"]["MaxAgentAnimatedObjectAttachments"].asInteger(); + } + } + return max_attach; +} + //----------------------------------------------------------------------------- // canAttachMoreAnimatedObjects() // Returns true if we can attach more animated objects. //----------------------------------------------------------------------------- BOOL LLVOAvatar::canAttachMoreAnimatedObjects(U32 n) const { - return (getNumAnimatedObjectAttachments() + n) <= MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS; + return (getNumAnimatedObjectAttachments() + n) <= getMaxAnimatedObjectAttachments(); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 1a87a62946..5a40a45eae 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -778,6 +778,7 @@ public: LLBBox getHUDBBox() const; void resetHUDAttachments(); BOOL canAttachMoreObjects(U32 n=1) const; + S32 getMaxAnimatedObjectAttachments() const; BOOL canAttachMoreAnimatedObjects(U32 n=1) const; protected: U32 getNumAttachments() const; // O(N), not O(1) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 403bff5a9e..07032ca0ae 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3349,22 +3349,25 @@ bool LLVOVolume::canBeAnimatedObject() const { return false; } -// AXON remove this check if animated object attachments are allowed -#if 0 - if (isAttachment()) - { - return false; - } -#endif if (!getVolume()) { return false; } + if (!isRootEdit()) + { + return false; + } const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(getVolume()->getParams().getSculptID(), this); if (!skin) { return false; } + F32 est_tris = recursiveGetEstTrianglesHigh(); + if (est_tris > getAnimatedObjectMaxTris()) + { + LL_INFOS() << "est_tris " << est_tris << " exceeds limit " << getAnimatedObjectMaxTris() << LL_ENDL; + return false; + } return true; } @@ -3833,6 +3836,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const return (U32)shame; } +F32 LLVOVolume::getEstTrianglesHigh() const +{ + if (isMesh()) + { + return gMeshRepo.getEstTrianglesHigh(getVolume()->getParams().getSculptID()); + } + return 0.f; +} + F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const { F32 radius = getScale().length()*0.5f; diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index c972d7770e..5891b36da8 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -134,6 +134,7 @@ public: /*virtual*/ const LLMatrix4 getRenderMatrix() const; typedef std::map texture_cost_t; U32 getRenderCost(texture_cost_t &textures) const; + /*virtual*/ F32 getEstTrianglesHigh() const; F32 getStreamingCost(S32* bytes, S32* visible_bytes, F32* unscaled_value) const; /*virtual*/ F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL) { return getStreamingCost(bytes, visible_bytes, NULL); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 50013656ca..0223d20f0f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10620,6 +10620,29 @@ You are not allowed to change this shape. Operation would cause the number of attached animated objects to exceed the limit. + + fail +Can't link these objects because the resulting animated object would exceed the size limit. + + + + fail +Can't make this object into an animated object because it would exceed the size limit. + + + + fail +Server error: cannot complete this operation because mesh data is not loaded. + Date: Tue, 3 Oct 2017 22:26:00 +0100 Subject: SL-808 - more work on arc display. area calculations still have some issues, especially for animated objects. --- indra/llcommon/llstring.cpp | 19 ++++++++++++++ indra/llcommon/llstring.h | 3 +++ indra/newview/llviewerobject.cpp | 36 +++++++++++++++++++++++++ indra/newview/llviewerobject.h | 1 + indra/newview/llvoavatar.cpp | 13 ++++++--- indra/newview/llvoavatar.h | 1 + indra/newview/llvovolume.cpp | 57 ++++++++++++++++++++++++---------------- 7 files changed, 104 insertions(+), 26 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index c45db3b185..9a02fecd72 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -869,6 +869,25 @@ std::string LLStringOps::getDatetimeCode (std::string key) } } +std::string LLStringOps::getReadableNumber(F64 num) +{ + if (fabs(num)>=1e9) + { + return llformat("%.2lfB", num / 1e9); + } + else if (fabs(num)>=1e6) + { + return llformat("%.2lfM", num / 1e6); + } + else if (fabs(num)>=1e3) + { + return llformat("%.2lfK", num / 1e3); + } + else + { + return llformat("%.2lf", num); + } +} namespace LLStringFn { diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index abe5fda603..627ca05f14 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -211,6 +211,9 @@ public: static bool getPacificDaylightTime(void) { return sPacificDaylightTime;} static std::string getDatetimeCode (std::string key); + + // Express a value like 1234567 as "1.23M" + static std::string getReadableNumber(F64 num); }; /** diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 94e1390c42..17e3d68c72 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3643,6 +3643,42 @@ U32 LLViewerObject::recursiveGetTriangleCount(S32* vcount) const return total_tris; } +// This is using the stored surface area for each volume (which +// defaults to 1.0 for the case of everything except a sculpt) and +// then scaling it linearly based on the largest dimension in the +// prim's scale. Should revisit at some point. +F32 LLViewerObject::recursiveGetScaledSurfaceArea() const +{ + F32 area = 0.f; + const LLDrawable* drawable = mDrawable; + if (drawable) + { + const LLVOVolume* volume = drawable->getVOVolume(); + if (volume) + { + if (volume->getVolume()) + { + const LLVector3& scale = volume->getScale(); + area += volume->getVolume()->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]); + } + LLViewerObject::const_child_list_t children = volume->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator child_iter = children.begin(); + child_iter != children.end(); + ++child_iter) + { + LLViewerObject* child_obj = *child_iter; + LLVOVolume *child = dynamic_cast( child_obj ); + if (child && child->getVolume()) + { + const LLVector3& scale = child->getScale(); + area += child->getVolume()->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]); + } + } + } + } + return area; +} + void LLViewerObject::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) { LLVector4a center; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index a84b6da96c..e2deb89e55 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -363,6 +363,7 @@ public: virtual F32 getStreamingCost(S32* bytes = NULL, S32* visible_bytes = NULL, F32* unscaled_value = NULL) const; virtual U32 getTriangleCount(S32* vcount = NULL) const; virtual U32 getHighLODTriangleCount(); + F32 recursiveGetScaledSurfaceArea() const; U32 recursiveGetTriangleCount(S32* vcount = NULL) const; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d5301c38ba..e849e14a5b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -620,6 +620,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLViewerObject(id, pcode, regionp), mSpecialRenderMode(0), mAttachmentSurfaceArea(0.f), + mDirectAttachmentSurfaceArea(0.f), mAttachmentVisibleTriangleCount(0), mAttachmentEstTriangleCount(0.f), mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), @@ -9230,12 +9231,14 @@ void LLVOAvatar::idleUpdateRenderComplexity() mText->addLine(info_line, info_color, info_style); // Triangle count - mText->addLine(llformat("Tris %u",mAttachmentVisibleTriangleCount), info_color, info_style); - mText->addLine(llformat("Est Tris %f",mAttachmentEstTriangleCount), info_color, info_style); + mText->addLine(std::string("VisTris ") + LLStringOps::getReadableNumber(mAttachmentVisibleTriangleCount), + info_color, info_style); + mText->addLine(std::string("EstMaxTris ") + LLStringOps::getReadableNumber(mAttachmentEstTriangleCount), + info_color, info_style); // Attachment Surface Area static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 1000.0f); - info_line = llformat("%.0f m^2", mAttachmentSurfaceArea); + info_line = llformat("%.0f m^2 (%.0f)", mAttachmentSurfaceArea, mDirectAttachmentSurfaceArea); if (max_render_cost != 0 && max_attachment_area != 0) // zero means don't care, so don't bother coloring based on this { @@ -9288,6 +9291,7 @@ void LLVOAvatar::accountRenderComplexityForObject( { mAttachmentVisibleTriangleCount += attached_object->recursiveGetTriangleCount(); mAttachmentEstTriangleCount += attached_object->recursiveGetEstTrianglesMax(); + mDirectAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); textures.clear(); const LLDrawable* drawable = attached_object->mDrawable; @@ -9441,7 +9445,8 @@ void LLVOAvatar::calculateUpdateRenderComplexity() mAttachmentVisibleTriangleCount = 0; mAttachmentEstTriangleCount = 0.f; - + mDirectAttachmentSurfaceArea = 0.f; + // A standalone animated object needs to be accounted for // using its associated volume. Attached animated objects // will be covered by the subsequent loop over attachments. diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 5f7d23050e..f9a1d7b424 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -438,6 +438,7 @@ public: private: F32 mAttachmentSurfaceArea; //estimated surface area of attachments + F32 mDirectAttachmentSurfaceArea; //estimated surface area of attachments U32 mAttachmentVisibleTriangleCount; F32 mAttachmentEstTriangleCount; bool shouldAlphaMask(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7fec240d1b..981ec6ec33 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4905,8 +4905,6 @@ static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj) void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { - - if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -4927,13 +4925,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->mBuilt = 1.f; - LLVOAvatar* pAvatarVO = NULL; - LLVOAvatar *attached_av = NULL; + LLVOAvatar *rigged_av = NULL; + LLVOAvatar *attached_av = NULL; LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge(); + LLViewerObject *vobj = NULL; + LLVOVolume *vol_obj = NULL; if (bridge) { - LLViewerObject* vobj = bridge->mDrawable->getVObj(); + vobj = bridge->mDrawable->getVObj(); + vol_obj = dynamic_cast(vobj); if (bridge->mAvatar.isNull()) { if (vobj) @@ -4941,17 +4942,25 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bridge->mAvatar = vobj->getAvatar(); } } - if (vobj) - { - attached_av = vobj->getAvatarAncestor(); - } - pAvatarVO = bridge->mAvatar; + rigged_av = bridge->mAvatar; } + if (vobj) + { + attached_av = vobj->getAvatarAncestor(); + } - if (attached_av) - { - attached_av->subtractAttachmentArea( group->mSurfaceArea ); - } + if (attached_av) + { + attached_av->subtractAttachmentArea( group->mSurfaceArea ); + } + if (rigged_av && (rigged_av != attached_av)) + { + rigged_av->subtractAttachmentArea( group->mSurfaceArea ); + } + if (vol_obj) + { + vol_obj->updateVisualComplexity(); + } group->mGeometryBytes = 0; group->mSurfaceArea = 0; @@ -5046,7 +5055,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } if (vobj->getControlAvatar()) { - pAvatarVO = vobj->getControlAvatar(); + rigged_av = vobj->getControlAvatar(); } } else @@ -5066,13 +5075,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bool is_rigged = false; // AXON handle NPC case - if (rigged && pAvatarVO && !vobj->isAnimatedObject()) + if (rigged && rigged_av && !vobj->isAnimatedObject()) { - pAvatarVO->addAttachmentOverridesForObject(vobj); - if (!LLApp::isExiting() && pAvatarVO->isSelf() && debugLoggingEnabled("AvatarAttachments")) + rigged_av->addAttachmentOverridesForObject(vobj); + if (!LLApp::isExiting() && rigged_av->isSelf() && debugLoggingEnabled("AvatarAttachments")) { bool verbose = true; - pAvatarVO->showAttachmentOverrides(verbose); + rigged_av->showAttachmentOverrides(verbose); } } @@ -5527,10 +5536,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) mFaceList.clear(); - if (attached_av) - { + if (attached_av) + { attached_av->addAttachmentArea( group->mSurfaceArea ); - } + } + if (rigged_av && (rigged_av != attached_av)) + { + rigged_av->addAttachmentArea( group->mSurfaceArea ); + } } static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh"); -- cgit v1.3 From 3a8b1bf1e4b30e8efb1fe161706c8d5f41fccad8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Jan 2018 16:35:56 +0000 Subject: SL-859 - exceptionally verbose logging of object state updates, likely temporary --- indra/llcommon/llcallstack.h | 7 ++++++ indra/newview/llviewerobject.cpp | 15 +++++++++--- indra/newview/llviewerobjectlist.cpp | 44 ++++++++++++++++++++++++++++----- indra/newview/llviewerregion.cpp | 47 +++++++++++++++++++++++++++++------- indra/newview/llviewerregion.h | 1 + indra/newview/llvovolume.cpp | 5 ++++ 6 files changed, 100 insertions(+), 19 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 1f7a7689d7..5acf04a49f 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -78,3 +78,10 @@ struct LLContextStatus }; LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); + +#define dumpStack(tag) \ + if (debugLoggingEnabled(tag)) \ + { \ + LLCallStack cs; \ + LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ + } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 0d515b28d0..5e88f9635f 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -105,6 +105,7 @@ #include "llfloaterperms.h" #include "llvocache.h" #include "llcleanup.h" +#include "llcallstack.h" //#define DEBUG_UPDATE_TYPE @@ -142,6 +143,9 @@ static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object"); // static LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, S32 flags) { + LL_DEBUGS("AnimatedObjects") << "creating " << id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + LLViewerObject *res = NULL; LL_RECORD_BLOCK_TIME(FTM_CREATE_OBJECT); @@ -1107,6 +1111,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { LL_DEBUGS_ONCE("SceneLoadTiming") << "Received viewer object data" << LL_ENDL; + LL_DEBUGS("AnimatedObjects") << " mesgsys " << mesgsys << " dp " << dp << " id " << getID() << " update_type " << (S32) update_type << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + U32 retval = 0x0; // If region is removed from the list it is also deleted. @@ -1161,10 +1168,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, F32 time_dilation = 1.f; if(mesgsys != NULL) { - U16 time_dilation16; - mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16); - time_dilation = ((F32) time_dilation16) / 65535.f; - mRegionp->setTimeDilation(time_dilation); + U16 time_dilation16; + mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16); + time_dilation = ((F32) time_dilation16) / 65535.f; + mRegionp->setTimeDilation(time_dilation); } // this will be used to determine if we've really changed position diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 27cab9d575..6aac777007 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -68,6 +68,7 @@ #include "u64.h" #include "llviewertexturelist.h" #include "lldatapacker.h" +#include "llcallstack.h" #ifdef LL_USESYSTEMLIBS #include #else @@ -241,6 +242,10 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, } // ignore returned flags + LL_DEBUGS("AnimatedObjects") << "uuid " << objectp->mID << " calling processUpdateMessage " + << objectp << " just_created " << just_created << " from_cache " << from_cache << " msg " << msg << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + objectp->processUpdateMessage(msg, user_data, i, update_type, dpp); if (objectp->isDead()) @@ -352,7 +357,10 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!objectp) { objectp = createObjectFromCache(pcode, regionp, fullid, entry->getLocalID()); - + + LL_DEBUGS("AnimatedObjects") << "uuid " << fullid << " created objectp " << objectp << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; @@ -471,6 +479,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, compressed_dp.reset(); uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data); + LL_DEBUGS("AnimatedObjects") << "got binary data from message to compressed_dpbuffer" << LL_ENDL; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i); compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length); @@ -520,6 +529,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << LL_ENDL; mNumUnknownUpdates++; } + else + { + LL_DEBUGS("AnimatedObjects") << "Non-full, non-compressed update, obj " << local_id << ", global ID " << fullid << " from " << mesgsys->getSender() << LL_ENDL; + } } else // OUT_FULL only? { @@ -528,11 +541,19 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i); msg_size += sizeof(LLUUID); msg_size += sizeof(U32); - // LL_INFOS() << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << LL_ENDL; + LL_DEBUGS("AnimatedObjects") << "Full Update, obj " << local_id << ", global ID " << fullid << " from " << mesgsys->getSender() << LL_ENDL; } objectp = findObject(fullid); - LL_DEBUGS("AnimatedObjects") << "processObjectUpdate for uuid " << fullid << " objectp " << objectp << LL_ENDL; + if (compressed) + { + LL_DEBUGS("AnimatedObjects") << "uuid " << fullid << " received compressed data from message (earlier in function)" << LL_ENDL; + } + LL_DEBUGS("AnimatedObjects") << "uuid " << fullid << " objectp " << objectp + << " update_cache " << (S32) update_cache << " compressed " << compressed + << " update_type " << update_type << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + if(update_cache) { objectp = regionp->updateCacheEntry(local_id, objectp, update_type); @@ -607,7 +628,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, #endif objectp = createObject(pcode, regionp, fullid, local_id, gMessageSystem->getSender()); + LL_DEBUGS("AnimatedObjects") << "creating object " << fullid << " result " << objectp << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; @@ -702,12 +726,17 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys, mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i); mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i); msg_size += sizeof(U32) * 2; - + + LL_DEBUGS("AnimatedObjects") << "got probe for id " << id << " crc " << crc << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + // Lookup data packer and add this id to cache miss lists if necessary. U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE; if(!regionp->probeCache(id, crc, flags, cache_miss_type)) { // Cache Miss. + LL_DEBUGS("AnimatedObjects") << "cache miss for id " << id << " crc " << crc << " miss type " << (S32) cache_miss_type << LL_ENDL; + recorder.cacheMissEvent(id, update_type, cache_miss_type, msg_size); continue; // no data packer, skip this object @@ -1974,8 +2003,9 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L { llassert_always(uuid.notNull()); - LL_DEBUGS("AnimatedObjects") << "createObjectFromCache creating " << uuid << LL_ENDL; - + LL_DEBUGS("AnimatedObjects") << "creating " << uuid << " local_id " << local_id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + LLViewerObject *objectp = LLViewerObject::createObject(uuid, pcode, regionp); if (!objectp) { @@ -2009,7 +2039,9 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe { fullid = uuid; } + LL_DEBUGS("AnimatedObjects") << "createObject creating " << fullid << LL_ENDL; + dumpStack("AnimatedObjectsStack"); LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); if (!objectp) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2da4f8e427..efaa327af6 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -78,6 +78,7 @@ #include "llcoros.h" #include "lleventcoro.h" #include "llcorehttputil.h" +#include "llcallstack.h" #ifdef LL_WINDOWS #pragma warning(disable:4355) @@ -1252,7 +1253,7 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time) LLPointer group = *group_iter; if(group->getNumRefs() < 3 || //group to be deleted !group->getOctreeNode() || group->isEmpty()) //group empty -{ + { continue; } @@ -2136,6 +2137,24 @@ void LLViewerRegion::getInfo(LLSD& info) info["Region"]["Handle"]["y"] = (LLSD::Integer)y; } +void LLViewerRegion::requestSimulatorFeatures() +{ + // kick off a request for simulator features + std::string url = getCapability("SimulatorFeatures"); + if (!url.empty()) + { + std::string coroname = + LLCoros::instance().launch("LLViewerRegionImpl::requestSimulatorFeatureCoro", + boost::bind(&LLViewerRegionImpl::requestSimulatorFeatureCoro, mImpl, url, getHandle())); + + LL_INFOS("AppInit", "SimulatorFeatures") << "Launching " << coroname << " requesting simulator features from " << url << LL_ENDL; + } + else + { + LL_WARNS("AppInit", "SimulatorFeatures") << "SimulatorFeatures cap not set" << LL_ENDL; + } +} + boost::signals2::connection LLViewerRegion::setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb) { return mSimulatorFeaturesReceivedSignal.connect(cb); @@ -2213,7 +2232,7 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) { LLViewerRegion* old_regionp = ((LLDrawable*)entry->getEntry()->getDrawable())->getRegion(); if(old_regionp != this && old_regionp) -{ + { LLViewerObject* obj = ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj(); if(obj) { @@ -2376,12 +2395,18 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB // we've seen this object before if (entry->getCRC() == crc) { + LL_DEBUGS("AnimatedObjects") << " got dupe for local_id " << local_id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + // Record a hit entry->recordDupe(); result = CACHE_UPDATE_DUPE; } else //CRC changed { + LL_DEBUGS("AnimatedObjects") << " got update for local_id " << local_id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + // Update the cache entry entry->updateEntry(crc, dp); @@ -2392,6 +2417,9 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB } else { + LL_DEBUGS("AnimatedObjects") << " got first notification for local_id " << local_id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); + // we haven't seen this object before // Create new entry and add to map result = CACHE_UPDATE_ADDED; @@ -2496,7 +2524,7 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss // Record a hit mRegionCacheHitCount++; entry->recordHit(); - cache_miss_type = CACHE_MISS_TYPE_NONE; + cache_miss_type = CACHE_MISS_TYPE_NONE; entry->setUpdateFlags(flags); if(entry->isState(LLVOCacheEntry::ACTIVE)) @@ -2519,12 +2547,14 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss // LL_INFOS() << "CRC miss for " << local_id << LL_ENDL; addCacheMiss(local_id, CACHE_MISS_TYPE_CRC); + cache_miss_type = CACHE_MISS_TYPE_CRC; } } else { // LL_INFOS() << "Cache miss for " << local_id << LL_ENDL; addCacheMiss(local_id, CACHE_MISS_TYPE_FULL); + cache_miss_type = CACHE_MISS_TYPE_FULL; } return false; @@ -2561,6 +2591,9 @@ void LLViewerRegion::requestCacheMisses() msg->nextBlockFast(_PREHASH_ObjectData); msg->addU8Fast(_PREHASH_CacheMissType, (*iter).mType); msg->addU32Fast(_PREHASH_ID, (*iter).mID); + + LL_DEBUGS("AnimatedObjects") << "Requesting cache missed object " << (*iter).mID << LL_ENDL; + blocks++; if (blocks >= 255) @@ -2955,12 +2988,8 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u } else if (name == "SimulatorFeatures") { - // kick off a request for simulator features - std::string coroname = - LLCoros::instance().launch("LLViewerRegionImpl::requestSimulatorFeatureCoro", - boost::bind(&LLViewerRegionImpl::requestSimulatorFeatureCoro, mImpl, url, getHandle())); - - LL_INFOS("AppInit", "SimulatorFeatures") << "Launching " << coroname << " requesting simulator features from " << url << LL_ENDL; + mImpl->mCapabilities["SimulatorFeatures"] = url; + requestSimulatorFeatures(); } else { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 69fb9c4d4e..69fa42c1c8 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -305,6 +305,7 @@ public: bool meshUploadEnabled() const; // has region received its simulator features list? Requires an additional query after caps received. + void requestSimulatorFeatures(); void setSimulatorFeaturesReceived(bool); bool simulatorFeaturesReceived() const; boost::signals2::connection setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index aa50122ff0..3d1cfcfa6b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -83,6 +83,7 @@ #include "llanimationstates.h" #include "llinventorytype.h" #include "llviewerinventory.h" +#include "llcallstack.h" const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; @@ -308,6 +309,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, U32 block_num, EObjectUpdateType update_type, LLDataPacker *dp) { + LLColor4U color; const S32 teDirtyBits = (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR|TEM_CHANGE_MEDIA); @@ -321,6 +323,9 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); sculpt_id = sculpt_params->getSculptTexture(); sculpt_type = sculpt_params->getSculptType(); + + LL_DEBUGS("AnimatedObjects") << "uuid " << mID << " set sculpt_id " << sculpt_id << LL_ENDL; + dumpStack("AnimatedObjectsStack"); } if (!dp) -- cgit v1.3 From 430f9420cf0094635b0b0428a29ff7dfaf5718e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Jun 2018 22:18:15 +0100 Subject: SL-915 - more on dynamic extent tracking, possible fix for 32-bit crash issues --- indra/llcommon/llerror.cpp | 9 +++-- indra/llmath/llrigginginfo.cpp | 78 ++++++++++++++++++++++++++++++++++++---- indra/llmath/llrigginginfo.h | 32 +++++++++++++++-- indra/llmath/llvolume.cpp | 12 +++---- indra/llmath/llvolume.h | 2 +- indra/newview/llskinningutil.cpp | 54 ++++++++++++++++++++++++---- indra/newview/llskinningutil.h | 1 + indra/newview/llviewerobject.h | 2 +- indra/newview/llvoavatar.cpp | 61 ++++++++++++++++--------------- indra/newview/llvoavatar.h | 4 +-- indra/newview/llvovolume.cpp | 52 +++++++++++++++++++++++---- 11 files changed, 245 insertions(+), 62 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f31a054139..916555a71d 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -51,6 +51,10 @@ #include "llstl.h" #include "lltimer.h" +//#if LL_WINDOWS +//#pragma optimize("", off) +//#endif + namespace { #if LL_WINDOWS void debugger_print(const std::string& s) @@ -361,6 +365,7 @@ namespace } } + LL_INFOS("LogControlFile") << "logging reconfiguring from " << filename() << LL_ENDL; LLError::configure(configuration); LL_INFOS("LogControlFile") << "logging reconfigured from " << filename() << LL_ENDL; return true; @@ -1292,7 +1297,7 @@ namespace LLError #if LL_WINDOWS // VC80 was optimizing the error away. - #pragma optimize("", off) +// #pragma optimize("", off) #endif void crashAndLoop(const std::string& message) { @@ -1310,7 +1315,7 @@ namespace LLError exit(EXIT_FAILURE); } #if LL_WINDOWS - #pragma optimize("", on) +// #pragma optimize("", on) #endif std::string utcTime() diff --git a/indra/llmath/llrigginginfo.cpp b/indra/llmath/llrigginginfo.cpp index 925179c2ba..73e1b096cb 100644 --- a/indra/llmath/llrigginginfo.cpp +++ b/indra/llmath/llrigginginfo.cpp @@ -27,6 +27,10 @@ #include "llmath.h" #include "llrigginginfo.h" +//#if LL_WINDOWS +//#pragma optimize("", off) +//#endif + //----------------------------------------------------------------------------- // LLJointRiggingInfo //----------------------------------------------------------------------------- @@ -80,17 +84,79 @@ void LLJointRiggingInfo::merge(const LLJointRiggingInfo& other) } } -void mergeRigInfoTab(joint_rig_info_tab& dst, const joint_rig_info_tab& src) +LLJointRiggingInfoTab::LLJointRiggingInfoTab(): + mRigInfoPtr(NULL), + mSize(0) +{ +} + +LLJointRiggingInfoTab::~LLJointRiggingInfoTab() +{ + clear(); +} + +// This doesn't preserve data if the size changes. In practice +// this doesn't matter because the size is always either +// LL_CHARACTER_MAX_ANIMATED_JOINTS or 0. +void LLJointRiggingInfoTab::resize(S32 size) +{ + if (size != mSize) + { + clear(); + if (size > 0) + { + mRigInfoPtr = new LLJointRiggingInfo[size]; + mSize = size; + } + } +} + +void LLJointRiggingInfoTab::clear() { + if (mRigInfoPtr) + { + delete[](mRigInfoPtr); + mRigInfoPtr = NULL; + mSize = 0; + } +} + +void showDetails(const LLJointRiggingInfoTab& src, const std::string& str) +{ + S32 count_rigged = 0; + S32 count_box = 0; + LLVector4a zero_vec; + zero_vec.clear(); + for (S32 i=0; i dst.size()) + if (src.size() > size()) { - dst.resize(src.size()); + resize(src.size()); } - S32 size = llmin(src.size(), dst.size()); - for (S32 i=0; i joint_rig_info_tab; +// Using direct memory management instead of std::vector<> to avoid alignment issues. +class LLJointRiggingInfoTab +{ +public: + LLJointRiggingInfoTab(); + ~LLJointRiggingInfoTab(); + void resize(S32 size); + void clear(); + S32 size() const { return mSize; } + void merge(const LLJointRiggingInfoTab& src); + LLJointRiggingInfo& operator[](S32 i) { return mRigInfoPtr[i]; } + const LLJointRiggingInfo& operator[](S32 i) const { return mRigInfoPtr[i]; }; +private: + // Not implemented + LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src); + LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src); -void mergeRigInfoTab(joint_rig_info_tab& dst, const joint_rig_info_tab& src); + LLJointRiggingInfo *mRigInfoPtr; + S32 mSize; +}; #endif diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 8f08394ce9..2654e204c2 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4644,7 +4644,6 @@ LLVolumeFace::LLVolumeFace() : mNumVertices(0), mNumAllocatedVertices(0), mNumIndices(0), - mJointRiggingInfoTabPtr(NULL), mPositions(NULL), mNormals(NULL), mTangents(NULL), @@ -4676,7 +4675,6 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mTangents(NULL), mTexCoords(NULL), mIndices(NULL), - mJointRiggingInfoTabPtr(NULL), mWeights(NULL), mWeightsScrubbed(FALSE), mOctree(NULL) @@ -4791,9 +4789,6 @@ void LLVolumeFace::freeData() ll_aligned_free_16(mWeights); mWeights = NULL; - free(mJointRiggingInfoTabPtr); - mJointRiggingInfoTabPtr = NULL; - delete mOctree; mOctree = NULL; } @@ -4955,7 +4950,7 @@ void LLVolumeFace::optimize(F32 angle_cutoff) // if (new_face.mNumVertices <= mNumVertices) { - llassert(new_face.mNumIndices == mNumIndices); + llassert(new_face.mNumIndices == mNumIndices); swapData(new_face); } @@ -6292,6 +6287,9 @@ void LLVolumeFace::resizeVertices(S32 num_verts) mNumVertices = num_verts; mNumAllocatedVertices = num_verts; + + // Force update + mJointRiggingInfoTab.clear(); } void LLVolumeFace::pushVertex(const LLVolumeFace::VertexData& cv) @@ -6413,6 +6411,8 @@ void LLVolumeFace::fillFromLegacyData(std::vector& v, } } +// AXON appendFace/appendFaces not used - referenced by corresponding functions in +// LLModel but these are not called anywhere. void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMatrix4& norm_mat_in) { U16 offset = mNumVertices; diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index d518bcf3ef..f92b43e77d 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -962,7 +962,7 @@ public: // Which joints are rigged to, and the bounding box of any rigged // vertices per joint. - joint_rig_info_tab *mJointRiggingInfoTabPtr; + LLJointRiggingInfoTab mJointRiggingInfoTab; LLOctreeNode* mOctree; diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 14abe9d89a..6484775c40 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -34,6 +34,10 @@ #include "llvolume.h" #include "llrigginginfo.h" +//#if LL_WINDOWS +//#pragma optimize("", off) +//#endif + void LLSkinningUtil::initClass() { } @@ -211,15 +215,36 @@ void LLSkinningUtil::getPerVertexSkinMatrix( llassert(valid_weights); } +// AXON need to remember this has been done +void LLSkinningUtil::initJointNums(LLMeshSkinInfo* skin, LLVOAvatar *avatar) +{ + for (U32 j = 0; j < skin->mJointNames.size(); ++j) + { + LLJoint *joint = NULL; + if (skin->mJointNums[j] == -1) + { + joint = avatar->getJoint(skin->mJointNames[j]); + if (joint) + { + skin->mJointNums[j] = joint->getJointNum(); + } + } + } +} + void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *avatar, LLVolumeFace& vol_face) { + // AXON cast + initJointNums(const_cast(skin), avatar); S32 num_verts = vol_face.mNumVertices; if (num_verts>0 && vol_face.mWeights && (skin->mJointNames.size()>0)) { - if (!vol_face.mJointRiggingInfoTabPtr) + if (vol_face.mJointRiggingInfoTab.size()==0) { - vol_face.mJointRiggingInfoTabPtr = new joint_rig_info_tab(LL_CHARACTER_MAX_ANIMATED_JOINTS); - joint_rig_info_tab& rig_info_tab = *vol_face.mJointRiggingInfoTabPtr; + std::set active_joints; + S32 active_verts = 0; + vol_face.mJointRiggingInfoTab.resize(LL_CHARACTER_MAX_ANIMATED_JOINTS); + LLJointRiggingInfoTab &rig_info_tab = vol_face.mJointRiggingInfoTab; for (S32 i=0; imJointNums[joint_index]; - if (joint_num != -1) + if (joint_num >= 0 && joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS) { rig_info_tab[joint_num].setIsRiggedTo(true); + active_joints.insert(joint_num); + active_verts++; - // AXON can precompute that matMuls. + // AXON can precompute these matMuls. LLMatrix4a bind_shape; bind_shape.loadu(skin->mBindShapeMatrix); LLMatrix4a inv_bind; @@ -246,8 +273,21 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a } } } - LL_DEBUGS("RigSpammish") << "updated rigging info for vf " << &vol_face - << " num_verts " << vol_face.mNumVertices << LL_ENDL; + LL_DEBUGS("RigSpammish") << "built rigging info for vf " << &vol_face + << " num_verts " << vol_face.mNumVertices + << " active joints " << active_joints.size() + << " active verts " << active_verts + << LL_ENDL; } } + if (vol_face.mJointRiggingInfoTab.size()!=0) + { + LL_DEBUGS("RigSpammish") << "we have rigging info for vf " << &vol_face + << " num_verts " << vol_face.mNumVertices << LL_ENDL; + } + else + { + LL_DEBUGS("RigSpammish") << "no rigging info for vf " << &vol_face + << " num_verts " << vol_face.mNumVertices << LL_ENDL; + } } diff --git a/indra/newview/llskinningutil.h b/indra/newview/llskinningutil.h index 47e12f8adc..e730ef014b 100644 --- a/indra/newview/llskinningutil.h +++ b/indra/newview/llskinningutil.h @@ -42,6 +42,7 @@ namespace LLSkinningUtil void checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin); void scrubSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin); void getPerVertexSkinMatrix(F32* weights, LLMatrix4a* mat, bool handle_bad_scale, LLMatrix4a& final_mat, U32 max_joints); + void initJointNums(LLMeshSkinInfo* skin, LLVOAvatar *avatar); void updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *avatar, LLVolumeFace& vol_face); }; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index eac3f1bbe8..d6c8b76147 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -881,7 +881,7 @@ public: virtual void updateRiggingInfo() {} - joint_rig_info_tab mJointRiggingInfoTab; + LLJointRiggingInfoTab mJointRiggingInfoTab; private: LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93e470e0fb..8c3a180570 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -671,7 +671,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCachedInMuteList(false), mIsControlAvatar(false), mIsUIAvatar(false), - mEnableDefaultMotions(true) + mEnableDefaultMotions(true), + mRiggingInfoNeedsUpdate(true) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -1279,8 +1280,12 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax) } } +static LLTrace::BlockTimerStatHandle FTM_AVATAR_EXTENT_UPDATE("Avatar Update Extent"); + void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { + LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE); + S32 box_detail = gSavedSettings.getS32("AvatarBoundingBoxComplexity"); LLVector4a buffer(0.0); LLVector4a pos; @@ -1364,7 +1369,13 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) // Stretch bounding box by rigged mesh joint boxes if (box_detail>=3) { - updateRiggingInfo(); + // AXON try to cache unless something has changed about attached rigged meshes. + // Needs more logic based on volume states. + //if (mRiggingInfoNeedsUpdate) + { + updateRiggingInfo(); + mRiggingInfoNeedsUpdate = false; + } for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { LLJoint *joint = getJoint(joint_num); @@ -5854,8 +5865,6 @@ void LLVOAvatar::clearAttachmentOverrides() { LLScopedContextString str("clearAttachmentOverrides " + getFullname()); - mActiveOverrideMeshes.clear(); - for (S32 i=0; i=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; if ( fullRig && !mesh_overrides_loaded ) { - mActiveOverrideMeshes.insert(mesh_id); - for ( int i=0; imJointNames[i].c_str(); @@ -6174,6 +6184,8 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setupdateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, attached_object->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(attached_object->mJointRiggingInfoTab); //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; @@ -9504,7 +9504,7 @@ void LLVOAvatar::updateRiggingInfo() { LLViewerObject *childp = *it; childp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(childp->mJointRiggingInfoTab); //LL_INFOS() << "after merge rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; } } @@ -9515,9 +9515,8 @@ void LLVOAvatar::updateRiggingInfo() LLVOVolume *volp = control_av->mRootVolp; if (volp && !volp->isAttachment()) { - volp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, volp->mJointRiggingInfoTab); - LL_DEBUGS("RigSpammish") << getFullname() << " after cav update rig tab:" << LL_ENDL; + mJointRiggingInfoTab.merge(volp->mJointRiggingInfoTab); + LL_DEBUGS("RigSpammish") << getFullname() << " mRootVolp " << control_av->mRootVolp << " after cav update rig tab:" << LL_ENDL; S32 joint_count, box_count; showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count); LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; @@ -9529,7 +9528,7 @@ void LLVOAvatar::updateRiggingInfo() { LLViewerObject *childp = *it; childp->updateRiggingInfo(); - mergeRigInfoTab(mJointRiggingInfoTab, childp->mJointRiggingInfoTab); + mJointRiggingInfoTab.merge(childp->mJointRiggingInfoTab); LL_DEBUGS("RigSpammish") << getFullname() << " after cav child update rig tab:" << LL_ENDL; S32 joint_count, box_count; @@ -9547,6 +9546,12 @@ void LLVOAvatar::updateRiggingInfo() LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; } +// virtual +void LLVOAvatar::onActiveOverrideMeshesChanged() +{ + mRiggingInfoNeedsUpdate = true; +} + U32 LLVOAvatar::getPartitionType() const { // Avatars merely exist as drawables in the bridge partition diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 59f88490d0..924b361f59 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -219,10 +219,10 @@ public: // virtual void updateRiggingInfo(); + bool mRiggingInfoNeedsUpdate; std::set mActiveOverrideMeshes; - - + virtual void onActiveOverrideMeshesChanged(); /*virtual*/ const LLUUID& getID() const; /*virtual*/ void addDebugText(const std::string& text); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 2f2a28daff..70c4efb5b8 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3597,26 +3597,64 @@ void LLVOVolume::updateRiggingInfo() { const LLMeshSkinInfo* skin = getSkinInfo(); LLVOAvatar *avatar = getAvatar(); - if (skin && avatar && getLOD()>mLastRiggingInfoLOD) + LLVolume *volume = getVolume(); + if (skin && avatar && volume) { - LLVolume *volume = getVolume(); - if (volume) + LL_DEBUGS("RigSpammish") << "starting, vovol " << this << " lod " << getLOD() << " last " << mLastRiggingInfoLOD << LL_ENDL; + // AXON SPAM + for (S32 f = 0; f < volume->getNumVolumeFaces(); ++f) { + LLVolumeFace& vol_face = volume->getVolumeFace(f); + if (vol_face.mJointRiggingInfoTab.size()>0) + { + LL_DEBUGS("RigSpammish") << "vovol " << this << " lod " << getLOD() << " face " << f << " vf " << &vol_face << " has rig info" << LL_ENDL; + } + else + { + LL_DEBUGS("RigSpammish") << "vovol " << this << " lod " << getLOD() << " face " << f << " vf " << &vol_face << " needs update" << LL_ENDL; + } + } + // We maintain rigging info based on the highest LOD + // handled so far. Need to update if either the LOD is + // the same but some faces need to be updated, or if + // the LOD has increased. + bool any_face_needs_rebuild = false; + if (getLOD()==mLastRiggingInfoLOD) + { + // See if any volume face needs its rigging info built. + for (S32 f = 0; f < volume->getNumVolumeFaces(); ++f) + { + LLVolumeFace& vol_face = volume->getVolumeFace(f); + if (vol_face.mJointRiggingInfoTab.size()==0) + { + // AXON this is overkill since some faces don't contain any valid weights/rigged verts. + any_face_needs_rebuild = true; + break; + } + } + } + + //if (getLOD()>mLastRiggingInfoLOD || + // (getLOD()==mLastRiggingInfoLOD && any_face_needs_rebuild)) + if (getLOD()==3) + { + // Rigging info has changed mJointRiggingInfoTab.clear(); for (S32 f = 0; f < volume->getNumVolumeFaces(); ++f) { LLVolumeFace& vol_face = volume->getVolumeFace(f); LLSkinningUtil::updateRiggingInfo(skin, avatar, vol_face); - if (vol_face.mJointRiggingInfoTabPtr) + if (vol_face.mJointRiggingInfoTab.size()>0) { - mergeRigInfoTab(mJointRiggingInfoTab, *vol_face.mJointRiggingInfoTabPtr); + mJointRiggingInfoTab.merge(vol_face.mJointRiggingInfoTab); } } // Keep the highest LOD info available. - // AXON would this ever need to be forced to refresh? Set to -1 if so. mLastRiggingInfoLOD = getLOD(); LL_DEBUGS("RigSpammish") << "updated rigging info for LLVOVolume " - << this << " lod " << mLastRiggingInfoLOD << LL_ENDL; + << this << " lod " << mLastRiggingInfoLOD + << " any faces rebuilt? " << any_face_needs_rebuild + << LL_ENDL; } } } -- cgit v1.3 From 887638c4d274d067f44d97128b34fde837ab69a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 11 Jun 2018 13:55:34 +0100 Subject: SL-915 - fix for crash when logcontrol file reloaded --- indra/llcommon/llerror.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 916555a71d..f81030b0e7 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -29,6 +29,7 @@ #include "llerror.h" #include "llerrorcontrol.h" +#include "llsdutil.h" #include #ifdef __GNUC__ @@ -51,10 +52,6 @@ #include "llstl.h" #include "lltimer.h" -//#if LL_WINDOWS -//#pragma optimize("", off) -//#endif - namespace { #if LL_WINDOWS void debugger_print(const std::string& s) @@ -365,7 +362,6 @@ namespace } } - LL_INFOS("LogControlFile") << "logging reconfiguring from " << filename() << LL_ENDL; LLError::configure(configuration); LL_INFOS("LogControlFile") << "logging reconfigured from " << filename() << LL_ENDL; return true; @@ -408,7 +404,7 @@ namespace i != callSites.end(); ++i) { - (*i)->invalidate(); + (*i)->invalidate(); } callSites.clear(); @@ -1523,18 +1519,16 @@ namespace LLError bool debugLoggingEnabled(const std::string& tag) { - const char* tags[] = {tag.c_str()}; - ::size_t tag_count = 1; - LLError::CallSite _site(LLError::LEVEL_DEBUG, __FILE__, __LINE__, - typeid(_LL_CLASS_TO_LOG), __FUNCTION__, false, tags, tag_count); - if (LL_UNLIKELY(_site.shouldLog())) - { - return true; - } - else + LogLock lock; + if (!lock.ok()) { return false; } + + LLError::SettingsConfigPtr s = LLError::Settings::getInstance()->getSettingsConfig(); + LLError::ELevel level = LLError::LEVEL_DEBUG; + bool res = checkLevelMap(s->mTagLevelMap, tag, level); + return res; } -- cgit v1.3 From edf6795edaa4ec822ac0e2bc906c71606b84b5c8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Jun 2018 21:49:24 +0100 Subject: SL-915, MAINT-8554 - cleanup/reorg, added encroachment fix info to DebugAnimatedObjects output --- indra/llcommon/llerror.cpp | 4 +- indra/llmath/llrigginginfo.cpp | 4 -- indra/llmath/llvolume.cpp | 95 --------------------------------------- indra/llmath/llvolume.h | 2 - indra/llmath/v3math.cpp | 36 +++++++++++++++ indra/llmath/v3math.h | 2 + indra/llprimitive/llmodel.cpp | 34 -------------- indra/llprimitive/llmodel.h | 3 -- indra/newview/llcontrolavatar.cpp | 55 +++++------------------ indra/newview/llmeshrepository.h | 1 - indra/newview/llskinningutil.cpp | 4 -- indra/newview/llvoavatar.cpp | 84 +++++----------------------------- indra/newview/llvoavatar.h | 5 ++- 13 files changed, 65 insertions(+), 264 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f81030b0e7..d0e7c06f36 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1293,7 +1293,7 @@ namespace LLError #if LL_WINDOWS // VC80 was optimizing the error away. -// #pragma optimize("", off) + #pragma optimize("", off) #endif void crashAndLoop(const std::string& message) { @@ -1311,7 +1311,7 @@ namespace LLError exit(EXIT_FAILURE); } #if LL_WINDOWS -// #pragma optimize("", on) + #pragma optimize("", on) #endif std::string utcTime() diff --git a/indra/llmath/llrigginginfo.cpp b/indra/llmath/llrigginginfo.cpp index 885acb7670..0de07950c1 100644 --- a/indra/llmath/llrigginginfo.cpp +++ b/indra/llmath/llrigginginfo.cpp @@ -27,10 +27,6 @@ #include "llmath.h" #include "llrigginginfo.h" -//#if LL_WINDOWS -//#pragma optimize("", off) -//#endif - //----------------------------------------------------------------------------- // LLJointRiggingInfo //----------------------------------------------------------------------------- diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 2654e204c2..ba284574c8 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -6411,101 +6411,6 @@ void LLVolumeFace::fillFromLegacyData(std::vector& v, } } -// AXON appendFace/appendFaces not used - referenced by corresponding functions in -// LLModel but these are not called anywhere. -void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMatrix4& norm_mat_in) -{ - U16 offset = mNumVertices; - - S32 new_count = face.mNumVertices + mNumVertices; - - if (new_count > 65536) - { - LL_ERRS() << "Cannot append face -- 16-bit overflow will occur." << LL_ENDL; - } - - if (face.mNumVertices == 0) - { - LL_ERRS() << "Cannot append empty face." << LL_ENDL; - } - - U32 old_vsize = mNumVertices*16; - U32 new_vsize = new_count * 16; - U32 old_tcsize = (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF; - U32 new_tcsize = (new_count*sizeof(LLVector2)+0xF) & ~0xF; - U32 new_size = new_vsize * 2 + new_tcsize; - - //allocate new buffer space - LLVector4a* old_buf = mPositions; - mPositions = (LLVector4a*) ll_aligned_malloc<64>(new_size); - mNormals = mPositions + new_count; - mTexCoords = (LLVector2*) (mNormals+new_count); - - mNumAllocatedVertices = new_count; - - LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) old_buf, old_vsize); - LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) (old_buf+mNumVertices), old_vsize); - LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) (old_buf+mNumVertices*2), old_tcsize); - - mNumVertices = new_count; - - //get destination address of appended face - LLVector4a* dst_pos = mPositions+offset; - LLVector2* dst_tc = mTexCoords+offset; - LLVector4a* dst_norm = mNormals+offset; - - //get source addresses of appended face - const LLVector4a* src_pos = face.mPositions; - const LLVector2* src_tc = face.mTexCoords; - const LLVector4a* src_norm = face.mNormals; - - //load aligned matrices - LLMatrix4a mat, norm_mat; - mat.loadu(mat_in); - norm_mat.loadu(norm_mat_in); - - for (U32 i = 0; i < face.mNumVertices; ++i) - { - //transform appended face position and store - mat.affineTransform(src_pos[i], dst_pos[i]); - - //transform appended face normal and store - norm_mat.rotate(src_norm[i], dst_norm[i]); - dst_norm[i].normalize3fast(); - - //copy appended face texture coordinate - dst_tc[i] = src_tc[i]; - - if (offset == 0 && i == 0) - { //initialize bounding box - // VFExtents change - mExtents[0] = mExtents[1] = dst_pos[i]; - } - else - { - //stretch bounding box - // VFExtents change - update_min_max(mExtents[0], mExtents[1], dst_pos[i]); - } - } - LL_DEBUGS("RiggedBox") << "appendFace got extents " << mExtents[0] << ", " << mExtents[1] << " from dst_pos " << LL_ENDL; - - - new_count = mNumIndices + face.mNumIndices; - - //allocate new index buffer - mIndices = (U16*) ll_aligned_realloc_16(mIndices, (new_count*sizeof(U16)+0xF) & ~0xF, (mNumIndices*sizeof(U16)+0xF) & ~0xF); - - //get destination address into new index buffer - U16* dst_idx = mIndices+mNumIndices; - mNumIndices = new_count; - - for (U32 i = 0; i < face.mNumIndices; ++i) - { //copy indices, offsetting by old vertex count - dst_idx[i] = face.mIndices[i]+offset; - } -} - BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) { LL_CHECK_MEMORY diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index f92b43e77d..1d6d35c432 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -872,8 +872,6 @@ public: BOOL create(LLVolume* volume, BOOL partial_build = FALSE); void createTangents(); - void appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& normal_tranform); - void resizeVertices(S32 num_verts); void allocateTangents(S32 num_verts); void allocateWeights(S32 num_verts); diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index e7107dee16..b04c67d926 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -369,3 +369,39 @@ BOOL LLVector3::parseVector3(const std::string& buf, LLVector3* value) return FALSE; } + +// Displacement from query point to nearest neighbor point on bounding box. +// Returns zero vector for points within or on the box. +LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box) +{ + LLVector3 offset; + for (S32 k=0; k<3; k++) + { + offset[k] = 0; + if (pos[k] < box[0][k]) + { + offset[k] = pos[k] - box[0][k]; + } + else if (pos[k] > box[1][k]) + { + offset[k] = pos[k] - box[1][k]; + } + } + return offset; +} + +bool box_valid_and_non_zero(const LLVector3* box) +{ + if (!box[0].isFinite() || !box[1].isFinite()) + { + return false; + } + LLVector3 zero_vec; + zero_vec.clear(); + if ((box[0] != zero_vec) || (box[1] != zero_vec)) + { + return true; + } + return false; +} + diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index f3fbce4843..6f857d7061 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -163,6 +163,8 @@ LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Retu LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec) LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec) LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b +LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box); // Displacement from query point to nearest point on bounding box. +bool box_valid_and_non_zero(const LLVector3* box); inline LLVector3::LLVector3(void) { diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 2a55838a4b..a0e835c577 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -401,40 +401,6 @@ void LLModel::setVolumeFaceData( LLVector4a::memcpyNonAliased16((F32*) face.mIndices, (F32*) ind.get(), size); } -void LLModel::appendFaces(LLModel *model, LLMatrix4 &transform, LLMatrix4& norm_mat) -{ - if (mVolumeFaces.empty()) - { - setNumVolumeFaces(1); - } - - LLVolumeFace& face = mVolumeFaces[mVolumeFaces.size()-1]; - - - for (S32 i = 0; i < model->getNumFaces(); ++i) - { - face.appendFace(model->getVolumeFace(i), transform, norm_mat); - } - -} - -void LLModel::appendFace(const LLVolumeFace& src_face, std::string src_material, LLMatrix4& mat, LLMatrix4& norm_mat) -{ - S32 rindex = getNumVolumeFaces()-1; - if (rindex == -1 || - mVolumeFaces[rindex].mNumVertices + src_face.mNumVertices >= 65536) - { //empty or overflow will occur, append new face - LLVolumeFace cur_face; - cur_face.appendFace(src_face, mat, norm_mat); - addFace(cur_face); - mMaterialList.push_back(src_material); - } - else - { //append to existing end face - mVolumeFaces.rbegin()->appendFace(src_face, mat, norm_mat); - } -} - void LLModel::addFace(const LLVolumeFace& face) { if (face.mNumVertices == 0) diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index d7f006753f..cf3288489a 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -158,9 +158,6 @@ public: EModelStatus getStatus() const {return mStatus;} static std::string getStatusString(U32 status) ; - void appendFaces(LLModel* model, LLMatrix4& transform, LLMatrix4& normal_transform); - void appendFace(const LLVolumeFace& src_face, std::string src_material, LLMatrix4& mat, LLMatrix4& norm_mat); - void setNumVolumeFaces(S32 count); void setVolumeFaceData( S32 f, diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 8291df7705..36e728f26d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -34,10 +34,6 @@ #include "llmeshrepository.h" #include "llviewerregion.h" -#if LL_WINDOWS - #pragma optimize("", off) -#endif - LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), mPlaying(false), @@ -68,41 +64,6 @@ void LLControlAvatar::initInstance() hideSkirt(); } -// AXON move to math -bool box_valid_and_non_zero(const LLVector3* box) -{ - if (!box[0].isFinite() || !box[1].isFinite()) - { - return false; - } - LLVector3 zero_vec; - zero_vec.clear(); - if ((box[0] != zero_vec) || (box[1] != zero_vec)) - { - return true; - } - return false; -} - -// AXON move to math -LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box) -{ - LLVector3 offset; - for (S32 k=0; k<3; k++) - { - offset[k] = 0; - if (pos[k] < box[0][k]) - { - offset[k] = pos[k] - box[0][k]; - } - else if (pos[k] > box[1][k]) - { - offset[k] = pos[k] - box[1][k]; - } - } - return offset; -} - void LLControlAvatar::matchVolumeTransform() { if (mRootVolp) @@ -157,11 +118,11 @@ void LLControlAvatar::matchVolumeTransform() F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET); pos_box_offset *= target_dist/offset_dist; } - LL_DEBUGS("FixBox") << getFullname() << " fixup needed for offset " - << pos_box_offset[0] << "," << pos_box_offset[1] << "," << pos_box_offset[2] - << " current fixup " - << mPositionConstraintFixup[0] << "," << mPositionConstraintFixup[1] << "," << mPositionConstraintFixup[2] - << " dist " << offset_dist << LL_ENDL; + //LL_DEBUGS("FixBox") << getFullname() << " fixup needed for offset " + // << pos_box_offset[0] << "," << pos_box_offset[1] << "," << pos_box_offset[2] + // << " current fixup " + // << mPositionConstraintFixup[0] << "," << mPositionConstraintFixup[1] << "," << mPositionConstraintFixup[2] + // << " dist " << offset_dist << LL_ENDL; } mPositionConstraintFixup = pos_box_offset; @@ -380,6 +341,12 @@ void LLControlAvatar::updateDebugText() addDebugText(llformat("flags %s", animated_object_flag_string.c_str())); addDebugText(llformat("tris %d (est %.1f, streaming %.1f), verts %d", total_tris, est_tris, est_streaming_tris, total_verts)); addDebugText(llformat("pxarea %s rank %d", LLStringOps::getReadableNumber(getPixelArea()).c_str(), getVisibilityRank())); + if (mPositionConstraintFixup.length() > 0.0f) + { + addDebugText(llformat("pos fix (%.1f %.1f %.1f)", + mPositionConstraintFixup[0], mPositionConstraintFixup[1], mPositionConstraintFixup[2])); + } + #if 0 std::string region_name = "no region"; if (mRootVolp->getRegion()) diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index df8f5c5ff4..cb3903b1d0 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -652,7 +652,6 @@ public: extern LLMeshRepository gMeshRepo; -// AXON make sure this is consistent with the final simulator-side values. const F32 ANIMATED_OBJECT_BASE_COST = 15.0f; const F32 ANIMATED_OBJECT_COST_PER_KTRI = 1.5f; diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index db9877f302..0878cee1a3 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -34,10 +34,6 @@ #include "llvolume.h" #include "llrigginginfo.h" -//#if LL_WINDOWS -//#pragma optimize("", off) -//#endif - void LLSkinningUtil::initClass() { } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6896632597..728155382f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1346,7 +1346,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) attachment_iter != attachment->mAttachedObjects.end(); ++attachment_iter) { - // AXON is this right? Don't we need to look at children of attached_object as well? + // AXON Don't we need to look at children of attached_object as well? const LLViewerObject* attached_object = (*attachment_iter); if (attached_object && !attached_object->isHUDAttachment()) { @@ -1389,10 +1389,11 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { // AXON try to cache unless something has changed about attached rigged meshes. // Needs more logic based on volume states. + //if (mRiggingInfoTab.needsUpdate()) { updateRiggingInfo(); - mJointRiggingInfoTab.setNeedsUpdate(false); + //mJointRiggingInfoTab.setNeedsUpdate(false); } for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) { @@ -1403,12 +1404,6 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) rig_info = &mJointRiggingInfoTab[joint_num]; } - // FIXME TEMP HACK FOR TESTING - //if (joint) - //{ - // rig_info.setIsRiggedTo(true); - //} - if (joint && rig_info && rig_info->isRiggedTo()) { LLViewerJointAttachment *as_joint_attach = dynamic_cast(joint); @@ -1574,7 +1569,7 @@ void LLVOAvatar::renderBones() } else { - if (jointIsRiggedTo(jointp->getName())) + if (jointIsRiggedTo(jointp)) { occ_color = RIGGED_COLOR_OCCLUDED; visible_color = RIGGED_COLOR_VISIBLE; @@ -2702,7 +2697,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) { ext[0].load3(mLastAnimExtents[0].mV); ext[1].load3(mLastAnimExtents[1].mV); - // AXON just do this once per frame + // Expensive. Just call this once per frame, in updateSpatialExtents(); //calculateSpatialExtents(ext[0], ext[1]); LLVector4a diff; diff.setSub(ext[1], mImpostorExtents[1]); @@ -5827,73 +5822,17 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) return false; } -// AXON update to use LLRiggingInfo -bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name) +bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const { - LLJoint *joint = getJoint(joint_name); if (joint) { - LLJointRiggingInfoTab& tab = mJointRiggingInfoTab; + const LLJointRiggingInfoTab& tab = mJointRiggingInfoTab; S32 joint_num = joint->getJointNum(); if (joint_num < tab.size() && tab[joint_num].isRiggedTo()) { return true; } } - return false; -#if 0 - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) - { - LLViewerJointAttachment* attachment = iter->second; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && jointIsRiggedTo(joint_name, attached_object)) - { - return true; - } - } - } - return false; -#endif -} - -// AXON update to use LLRiggingInfo -bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo) -{ - // Process all children - LLViewerObject::const_child_list_t& children = vo->getChildren(); - for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); - it != children.end(); ++it) - { - LLViewerObject *childp = *it; - if (jointIsRiggedTo(joint_name,childp)) - { - return true; - } - } - - const LLVOVolume *vobj = dynamic_cast(vo); - if (!vobj) - { - return false; - } - - const LLMeshSkinInfo* pSkinData = vobj->getSkinInfo(); - - if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) - { - if (std::find(pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), joint_name) != - pSkinData->mJointNames.end()) - { - return true; - } - } - return false; } @@ -9554,10 +9493,9 @@ void showRigInfoTabExtents(LLVOAvatar *avatar, LLJointRiggingInfoTab& tab, S32& } } -// AXON move to member -void getAssociatedVolumes(LLVOAvatar *av, std::vector& volumes) +void LLVOAvatar::getAssociatedVolumes(std::vector& volumes) { - for ( LLVOAvatar::attachment_map_t::iterator iter = av->mAttachmentPoints.begin(); iter != av->mAttachmentPoints.end(); ++iter ) + for ( LLVOAvatar::attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter ) { LLViewerJointAttachment* attachment = iter->second; LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_end = attachment->mAttachedObjects.end(); @@ -9584,7 +9522,7 @@ void getAssociatedVolumes(LLVOAvatar *av, std::vector& volumes) } } } - LLControlAvatar *control_av = dynamic_cast(av); + LLControlAvatar *control_av = dynamic_cast(this); if (control_av) { LLVOVolume *volp = control_av->mRootVolp; @@ -9612,7 +9550,7 @@ void LLVOAvatar::updateRiggingInfo() LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL; mJointRiggingInfoTab.clear(); std::vector volumes; - getAssociatedVolumes(this, volumes); + getAssociatedVolumes(volumes); for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it) { LLVOVolume *vol = *it; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d80f0ad713..25c89f96d7 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -208,8 +208,7 @@ public: void addAttachmentOverridesForObject(LLViewerObject *vo, std::set* meshes_seen = NULL, bool recursive = true); void removeAttachmentOverridesForObject(const LLUUID& mesh_id); void removeAttachmentOverridesForObject(LLViewerObject *vo); - bool jointIsRiggedTo(const std::string& joint_name); - bool jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo); + bool jointIsRiggedTo(const LLJoint *joint) const; void clearAttachmentOverrides(); void rebuildAttachmentOverrides(); void updateAttachmentOverrides(); @@ -217,6 +216,8 @@ public: void getAttachmentOverrideNames(std::set& pos_names, std::set& scale_names) const; + void getAssociatedVolumes(std::vector& volumes); + // virtual void updateRiggingInfo(); -- cgit v1.3 From 91dfd7e06c8e1e5499ffd4137053b4b238b7eb45 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 31 Jul 2018 14:02:42 +0100 Subject: SL-944 - disabled a not-very-useful assert that greatly slows the RWD build --- indra/llcommon/llmemory.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 5b17d9e3a4..f04ae5f5cb 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -60,6 +60,12 @@ class LLMutex ; LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #ifdef SHOW_ASSERT +// This is incredibly expensive - in profiling Windows RWD builds, 30% +// of CPU time was in aligment checks. +//#define ASSERT_ALIGNMENT +#endif + +#ifdef ASSERT_ALIGNMENT #define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(uintptr_t(ptr),((U32)alignment)) #else #define ll_assert_aligned(ptr,alignment) -- cgit v1.3 From 9c6678b5e76c485ae915b539327069b43185e16f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 24 Aug 2018 21:55:07 +0100 Subject: SL-944 - logcontrol options to control which log recorders get used. This can be useful for performance reasons when especially verbose debug logging is needed. --- indra/llcommon/llerror.cpp | 99 +++++++++++++++++++++++++++++-- indra/llcommon/llerrorcontrol.h | 6 ++ indra/newview/app_settings/logcontrol.xml | 15 +++++ 3 files changed, 115 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index ba71f4ddfb..3e4dd708a8 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -89,7 +89,12 @@ namespace { { closelog(); } - + + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x01; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -119,6 +124,13 @@ namespace { { LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; } + else + { + if (!LLError::getAlwaysFlush()) + { + mFile.sync_with_stdio(false); + } + } mWantsTime = true; mWantsTags = true; } @@ -128,12 +140,28 @@ namespace { mFile.close(); } + virtual bool enabled() override + { +#ifdef LL_RELEASE_FOR_DOWNLOAD + return 1; +#else + return LLError::getEnabledLogTypesMask() & 0x02; +#endif + } + bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, const std::string& message) { - mFile << message << std::endl; + if (LLError::getAlwaysFlush()) + { + mFile << message << std::endl; + } + else + { + mFile << message << "\n"; + } } private: @@ -149,6 +177,11 @@ namespace { mWantsTime = timestamp; } + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x04; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -209,6 +242,11 @@ namespace { public: RecordToFixedBuffer(LLLineBuffer* buffer) : mBuffer(buffer) { } + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x08; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -226,6 +264,11 @@ namespace { RecordToWinDebug() {} + virtual bool enabled() override + { + return LLError::getEnabledLogTypesMask() & 0x10; + } + virtual void recordMessage(LLError::ELevel level, const std::string& message) { @@ -413,7 +456,11 @@ namespace LLError bool mPrintLocation; LLError::ELevel mDefaultLevel; - + + bool mLogAlwaysFlush; + + U32 mEnabledLogTypesMask; + LevelMap mFunctionLevelMap; LevelMap mClassLevelMap; LevelMap mFileLevelMap; @@ -454,6 +501,8 @@ namespace LLError : LLRefCount(), mPrintLocation(false), mDefaultLevel(LLError::LEVEL_DEBUG), + mLogAlwaysFlush(true), + mEnabledLogTypesMask(0xFFFFFFFF), mFunctionLevelMap(), mClassLevelMap(), mFileLevelMap(), @@ -613,6 +662,8 @@ namespace LLError::Settings::getInstance()->reset(); LLError::setDefaultLevel(LLError::LEVEL_INFO); + LLError::setAlwaysFlush(true); + LLError::setEnabledLogTypesMask(0xFFFFFFFF); LLError::setFatalFunction(LLError::crashAndLoop); LLError::setTimeFunction(LLError::utcTime); @@ -686,6 +737,30 @@ namespace LLError return s->mDefaultLevel; } + void setAlwaysFlush(bool flush) + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + s->mLogAlwaysFlush = flush; + } + + bool getAlwaysFlush() + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + return s->mLogAlwaysFlush; + } + + void setEnabledLogTypesMask(U32 mask) + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + s->mEnabledLogTypesMask = mask; + } + + U32 getEnabledLogTypesMask() + { + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); + return s->mEnabledLogTypesMask; + } + void setFunctionLevel(const std::string& function_name, ELevel level) { Globals::getInstance()->invalidateCallSites(); @@ -766,7 +841,15 @@ namespace LLError setPrintLocation(config["print-location"]); setDefaultLevel(decodeLevel(config["default-level"])); - + if (config.has("log-always-flush")) + { + setAlwaysFlush(config["log-always-flush"]); + } + if (config.has("enabled-log-types-mask")) + { + setEnabledLogTypesMask(config["enabled-log-types-mask"].asInteger()); + } + LLSD sets = config["settings"]; LLSD::array_const_iterator a, end; for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a) @@ -910,7 +993,12 @@ namespace ++i) { LLError::RecorderPtr r = *i; - + + if (!r->enabled()) + { + continue; + } + std::ostringstream message_stream; if (show_time && r->wantsTime() && s->mTimeFunction != NULL) @@ -1039,6 +1127,7 @@ namespace { namespace LLError { + bool Log::shouldLog(CallSite& site) { LogLock lock; diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index caf2ba72c2..1730f0c640 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -74,6 +74,10 @@ namespace LLError LL_COMMON_API void setPrintLocation(bool); LL_COMMON_API void setDefaultLevel(LLError::ELevel); LL_COMMON_API ELevel getDefaultLevel(); + LL_COMMON_API void setAlwaysFlush(bool flush); + LL_COMMON_API bool getAlwaysFlush(); + LL_COMMON_API void setEnabledLogTypesMask(U32 mask); + LL_COMMON_API U32 getEnabledLogTypesMask(); LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel); LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel); LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel); @@ -140,6 +144,8 @@ namespace LLError virtual void recordMessage(LLError::ELevel, const std::string& message) = 0; // use the level for better display, not for filtering + virtual bool enabled() { return true; } + bool wantsTime(); bool wantsTags(); bool wantsLevel(); diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index ae57e125bb..08741327a5 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -3,6 +3,21 @@ default-level INFO print-location false + log-always-flush true + + enabled-log-types-mask 0xFFFFFFFF settings -- cgit v1.3 From 9ae973ec5b271b99d192644cc094ef2d1e3ded2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Aug 2018 14:22:42 +0100 Subject: SL-944 - mac build error fix: wants override to be used throughout a class if it is used at all --- indra/llcommon/llerror.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3e4dd708a8..843244ce92 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -96,7 +96,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { int syslogPriority = LOG_CRIT; switch (level) { @@ -152,7 +152,7 @@ namespace { bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { if (LLError::getAlwaysFlush()) { @@ -183,7 +183,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { if (ANSI_PROBE == mUseANSI) mUseANSI = (checkANSI() ? ANSI_YES : ANSI_NO); @@ -248,7 +248,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { mBuffer->addLine(message); } @@ -270,7 +270,7 @@ namespace { } virtual void recordMessage(LLError::ELevel level, - const std::string& message) + const std::string& message) override { debugger_print(message); } -- cgit v1.3 From d6cec8d68de437a3ccc66739cdabc9de6631dddc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Sep 2018 16:00:43 +0100 Subject: SL-944 - enabled log types consistent notation in xml and cpp --- indra/llcommon/llerror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 843244ce92..0d19287dd9 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -502,7 +502,7 @@ namespace LLError mPrintLocation(false), mDefaultLevel(LLError::LEVEL_DEBUG), mLogAlwaysFlush(true), - mEnabledLogTypesMask(0xFFFFFFFF), + mEnabledLogTypesMask(255), mFunctionLevelMap(), mClassLevelMap(), mFileLevelMap(), -- cgit v1.3