diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2021-10-29 15:11:42 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2021-10-29 15:11:42 -0700 |
commit | 1be8a8d10bd3542b0b5c2943a508509c5cfcf3ef (patch) | |
tree | a4bd2bdddb24ae0b443878b0337e77787d3fea40 /indra/llappearance | |
parent | 61bca72d37f695ee15897ddc3b9215c969ecf648 (diff) | |
parent | 68b75be652575ff301172b7b19522d4f0494bdf0 (diff) |
Fix merge conflict
Diffstat (limited to 'indra/llappearance')
-rw-r--r-- | indra/llappearance/llavatarappearance.cpp | 2 | ||||
-rw-r--r-- | indra/llappearance/lldriverparam.h | 114 | ||||
-rw-r--r-- | indra/llappearance/llpolymorph.cpp | 4 | ||||
-rw-r--r-- | indra/llappearance/llpolymorph.h | 29 | ||||
-rw-r--r-- | indra/llappearance/llpolyskeletaldistortion.cpp | 4 | ||||
-rw-r--r-- | indra/llappearance/llpolyskeletaldistortion.h | 30 | ||||
-rw-r--r-- | indra/llappearance/lltexlayer.cpp | 21 | ||||
-rw-r--r-- | indra/llappearance/lltexlayerparams.cpp | 3 | ||||
-rw-r--r-- | indra/llappearance/lltexlayerparams.h | 31 |
9 files changed, 78 insertions, 160 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 90dfa04f28..2d6d2a10d2 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1590,7 +1590,7 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num ) delete_and_clear_array(mCollisionVolumes); mNumCollisionVolumes = 0; - mCollisionVolumes = new(std::nothrow) LLAvatarJointCollisionVolume[num]; + mCollisionVolumes = new LLAvatarJointCollisionVolume[num]; if (!mCollisionVolumes) { LL_WARNS() << "Failed to allocate collision volumes" << LL_ENDL; diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index f278dcc2e2..a6261b507b 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -77,73 +77,63 @@ protected: //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLDriverParam : public LLViewerVisualParam +class alignas(16) LLDriverParam : public LLViewerVisualParam { + LL_ALIGN_NEW private: - // Hide the default constructor. Force construction with LLAvatarAppearance. - LLDriverParam() {} + // Hide the default constructor. Force construction with LLAvatarAppearance. + LLDriverParam() {} public: - LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable = NULL); - ~LLDriverParam(); - - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - - // Special: These functions are overridden by child classes - LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; } - // This sets mInfo and calls initialization functions - BOOL setInfo(LLDriverParamInfo *info); - - LLAvatarAppearance* getAvatarAppearance() { return mAvatarAppearance; } - const LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; } - - void updateCrossDrivenParams(LLWearableType::EType driven_type); - - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; - - // LLVisualParam Virtual functions - /*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param. - /*virtual*/ void setWeight(F32 weight); - /*virtual*/ void setAnimationTarget( F32 target_value); - /*virtual*/ void stopAnimating(); - /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); - /*virtual*/ void resetDrivenParams(); - - // LLViewerVisualParam Virtual functions - /*virtual*/ F32 getTotalDistortion(); - /*virtual*/ const LLVector4a& getAvgDistortion(); - /*virtual*/ F32 getMaxDistortion(); - /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh); - /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh); - /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh); - - S32 getDrivenParamsCount() const; - const LLViewerVisualParam* getDrivenParam(S32 index) const; - - typedef std::vector<LLDrivenEntry> entry_list_t; - entry_list_t& getDrivenList() { return mDriven; } + LLDriverParam(LLAvatarAppearance* appearance, LLWearable* wearable = NULL); + ~LLDriverParam(); + + // Special: These functions are overridden by child classes + LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; } + // This sets mInfo and calls initialization functions + BOOL setInfo(LLDriverParamInfo* info); + + LLAvatarAppearance* getAvatarAppearance() { return mAvatarAppearance; } + const LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; } + + void updateCrossDrivenParams(LLWearableType::EType driven_type); + + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; + + // LLVisualParam Virtual functions + /*virtual*/ void apply(ESex sex) {} // apply is called separately for each driven param. + /*virtual*/ void setWeight(F32 weight); + /*virtual*/ void setAnimationTarget(F32 target_value); + /*virtual*/ void stopAnimating(); + /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); + /*virtual*/ void resetDrivenParams(); + + // LLViewerVisualParam Virtual functions + /*virtual*/ F32 getTotalDistortion(); + /*virtual*/ const LLVector4a& getAvgDistortion(); + /*virtual*/ F32 getMaxDistortion(); + /*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh* poly_mesh); + /*virtual*/ const LLVector4a* getFirstDistortion(U32* index, LLPolyMesh** poly_mesh); + /*virtual*/ const LLVector4a* getNextDistortion(U32* index, LLPolyMesh** poly_mesh); + + S32 getDrivenParamsCount() const; + const LLViewerVisualParam* getDrivenParam(S32 index) const; + + typedef std::vector<LLDrivenEntry> entry_list_t; + entry_list_t& getDrivenList() { return mDriven; } void setDrivenList(entry_list_t& driven_list) { mDriven = driven_list; } protected: - LLDriverParam(const LLDriverParam& pOther); - F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); - void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight); - - - LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder - entry_list_t mDriven; - LLViewerVisualParam* mCurrentDistortionParam; - // Backlink only; don't make this an LLPointer. - LLAvatarAppearance* mAvatarAppearance; - LLWearable* mWearablep; -} LL_ALIGN_POSTFIX(16); + LLDriverParam(const LLDriverParam& pOther); + F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); + void setDrivenWeight(LLDrivenEntry* driven, F32 driven_weight); + + + LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder + entry_list_t mDriven; + LLViewerVisualParam* mCurrentDistortionParam; + // Backlink only; don't make this an LLPointer. + LLAvatarAppearance* mAvatarAppearance; + LLWearable* mWearablep; +}; #endif // LL_LLDRIVERPARAM_H diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index ce7010984a..16b5f1e204 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -539,8 +539,6 @@ F32 LLPolyMorphTarget::getMaxDistortion() //----------------------------------------------------------------------------- // apply() //----------------------------------------------------------------------------- -static LLTrace::BlockTimerStatHandle FTM_APPLY_MORPH_TARGET("Apply Morph"); - void LLPolyMorphTarget::apply( ESex avatar_sex ) { if (!mMorphData || mNumMorphMasksPending > 0) @@ -548,7 +546,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) return; } - LL_RECORD_BLOCK_TIME(FTM_APPLY_MORPH_TARGET); + LL_PROFILE_ZONE_SCOPED; mLastSex = avatar_sex; diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index c6133cd831..29cd373636 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -41,24 +41,14 @@ class LLWearable; //----------------------------------------------------------------------------- // LLPolyMorphData() //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLPolyMorphData +class alignas(16) LLPolyMorphData { + LL_ALIGN_NEW public: LLPolyMorphData(const std::string& morph_name); ~LLPolyMorphData(); LLPolyMorphData(const LLPolyMorphData &rhs); - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - BOOL loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh); const std::string& getName() { return mName; } @@ -76,7 +66,7 @@ public: F32 mTotalDistortion; // vertex distortion summed over entire morph F32 mMaxDistortion; // maximum single vertex distortion in a given morph - LL_ALIGN_16(LLVector4a mAvgDistortion); // average vertex distortion, to infer directionality of the morph + LLVector4a mAvgDistortion; // average vertex distortion, to infer directionality of the morph LLPolyMeshSharedData* mMesh; private: @@ -154,8 +144,9 @@ protected: // These morph targets must be topologically consistent with a given Polymesh // (share face sets) //----------------------------------------------------------------------------- -class LLPolyMorphTarget : public LLViewerVisualParam +class alignas(16) LLPolyMorphTarget : public LLViewerVisualParam { + LL_ALIGN_NEW public: LLPolyMorphTarget(LLPolyMesh *poly_mesh); ~LLPolyMorphTarget(); @@ -184,16 +175,6 @@ public: void applyVolumeChanges(F32 delta_weight); // SL-315 - for resetSkeleton() - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - protected: LLPolyMorphTarget(const LLPolyMorphTarget& pOther); diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index ae38c25dbf..360f17508f 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -188,11 +188,9 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) //----------------------------------------------------------------------------- // apply() //----------------------------------------------------------------------------- -static LLTrace::BlockTimerStatHandle FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion"); - void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { - LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY); + LL_PROFILE_ZONE_SCOPED; F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index ab1a132d19..585d85f055 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -62,9 +62,9 @@ struct LLPolySkeletalBoneInfo BOOL mHasPositionDeformation; }; -LL_ALIGN_PREFIX(16) -class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo +class alignas(16) LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo { + LL_ALIGN_NEW friend class LLPolySkeletalDistortion; public: @@ -73,19 +73,6 @@ public: /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); - - - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - - protected: typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t; bone_info_list_t mBoneInfoList; @@ -95,19 +82,10 @@ protected: // LLPolySkeletalDeformation // A set of joint scale data for deforming the avatar mesh //----------------------------------------------------------------------------- -class LLPolySkeletalDistortion : public LLViewerVisualParam +class alignas(16) LLPolySkeletalDistortion : public LLViewerVisualParam { + LL_ALIGN_NEW public: - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - LLPolySkeletalDistortion(LLAvatarAppearance *avatarp); ~LLPolySkeletalDistortion(); diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index e5039141de..26e0ae9086 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -522,10 +522,9 @@ const LLTexLayerSetBuffer* LLTexLayerSet::getComposite() const return mComposite; } -static LLTrace::BlockTimerStatHandle FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha"); void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height, LLRenderTarget* bound_target) { - LL_RECORD_BLOCK_TIME(FTM_GATHER_MORPH_MASK_ALPHA); + LL_PROFILE_ZONE_SCOPED; memset(data, 255, width * height); for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) @@ -538,10 +537,9 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S renderAlphaMaskTextures(origin_x, origin_y, width, height, bound_target, true); } -static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures"); void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target, bool forceClear) { - LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_TEXTURES); + LL_PROFILE_ZONE_SCOPED; const LLTexLayerSetInfo *info = getInfo(); bool use_shaders = LLGLSLShader::sNoFixedFunction; @@ -1433,7 +1431,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) addAlphaMask(data, originX, originY, width, height, bound_target); } -static LLTrace::BlockTimerStatHandle FTM_RENDER_MORPH_MASKS("renderMorphMasks"); void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, LLRenderTarget* bound_target, bool force_render) { if (!force_render && !hasMorph()) @@ -1441,7 +1438,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL; return; } - LL_RECORD_BLOCK_TIME(FTM_RENDER_MORPH_MASKS); + LL_PROFILE_ZONE_SCOPED; BOOL success = TRUE; llassert( !mParamAlphaList.empty() ); @@ -1639,10 +1636,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } } -static LLTrace::BlockTimerStatHandle FTM_ADD_ALPHA_MASK("addAlphaMask"); void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target) { - LL_RECORD_BLOCK_TIME(FTM_ADD_ALPHA_MASK); + LL_PROFILE_ZONE_SCOPED; S32 size = width * height; const U8* alphaData = getAlphaData(); if (!alphaData && hasAlphaParams()) @@ -1983,10 +1979,9 @@ void LLTexLayerStaticImageList::deleteCachedImages() // Returns an LLImageTGA that contains the encoded data from a tga file named file_name. // Caches the result to speed identical subsequent requests. -static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TGA("getImageTGA"); LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name) { - LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TGA); + LL_PROFILE_ZONE_SCOPED; const char *namekey = mImageNames.addString(file_name); image_tga_map_t::const_iterator iter = mStaticImageListTGA.find(namekey); if( iter != mStaticImageListTGA.end() ) @@ -2013,10 +2008,9 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name) // Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name. // Caches the result to speed identical subsequent requests. -static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TEXTURE("getTexture"); LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask) { - LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TEXTURE); + LL_PROFILE_ZONE_SCOPED; LLPointer<LLGLTexture> tex; const char *namekey = mImageNames.addString(file_name); @@ -2063,10 +2057,9 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, // Reads a .tga file, decodes it, and puts the decoded data in image_raw. // Returns TRUE if successful. -static LLTrace::BlockTimerStatHandle FTM_LOAD_IMAGE_RAW("loadImageRaw"); BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw) { - LL_RECORD_BLOCK_TIME(FTM_LOAD_IMAGE_RAW); + LL_PROFILE_ZONE_SCOPED; BOOL success = FALSE; std::string path; path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name); diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index ff682d6906..ce5c7142d5 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -261,10 +261,9 @@ BOOL LLTexLayerParamAlpha::getSkip() const } -static LLTrace::BlockTimerStatHandle FTM_TEX_LAYER_PARAM_ALPHA("alpha render"); BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) { - LL_RECORD_BLOCK_TIME(FTM_TEX_LAYER_PARAM_ALPHA); + LL_PROFILE_ZONE_SCOPED; BOOL success = TRUE; if (!mTexLayer) diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 0cb2dedbff..e2440998b3 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -63,23 +63,14 @@ protected: // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LL_ALIGN_PREFIX(16) -class LLTexLayerParamAlpha : public LLTexLayerParam +class alignas(16) LLTexLayerParamAlpha : public LLTexLayerParam { + LL_ALIGN_NEW public: LLTexLayerParamAlpha( LLTexLayerInterface* layer ); LLTexLayerParamAlpha( LLAvatarAppearance* appearance ); /*virtual*/ ~LLTexLayerParamAlpha(); - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; // LLVisualParam Virtual functions @@ -146,9 +137,9 @@ private: // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL_ALIGN_PREFIX(16) -class LLTexLayerParamColor : public LLTexLayerParam +class alignas(16) LLTexLayerParamColor : public LLTexLayerParam { + LL_ALIGN_NEW public: enum EColorOperation { @@ -161,16 +152,6 @@ public: LLTexLayerParamColor( LLTexLayerInterface* layer ); LLTexLayerParamColor( LLAvatarAppearance* appearance ); - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - /* virtual */ ~LLTexLayerParamColor(); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; @@ -198,8 +179,8 @@ protected: virtual void onGlobalColorChanged() {} private: - LL_ALIGN_16(LLVector4a mAvgDistortionVec); -} LL_ALIGN_POSTFIX(16); + LLVector4a mAvgDistortionVec; +}; class LLTexLayerParamColorInfo : public LLViewerVisualParamInfo { |