From d4a56c6d949ad982b5d57a5434bd1a4a6c2d457e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 22 May 2015 16:14:57 -0500 Subject: [PATCH] Toss attachments into their own bridge that sets their type to TYPE_AVATAR, and use generic bridge for plain old 'active' volumes. Resolves issue where non-attached ACTIVE flagged linksets would be included in the avatar render type, and thus would vanish when such type was disabled. --- indra/newview/lldrawable.cpp | 12 +++++++++++- indra/newview/llspatialpartition.cpp | 1 + indra/newview/llspatialpartition.h | 15 ++++++++++++++- indra/newview/llviewerregion.cpp | 1 + indra/newview/llviewerregion.h | 1 + indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvovolume.cpp | 15 ++++++++++----- indra/newview/pipeline.cpp | 3 ++- 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index d23c520c7..b447813df 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1056,6 +1056,10 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() { setSpatialBridge(new LLHUDBridge(this)); } + else if (mVObjp->isAttachment()) + { + setSpatialBridge(new LLAttachmentBridge(this)); + } else { setSpatialBridge(new LLVolumeBridge(this)); @@ -1663,12 +1667,18 @@ void LLDrawable::updateFaceSize(S32 idx) LLBridgePartition::LLBridgePartition() : LLSpatialPartition(0, FALSE, 0) { - mDrawableType = LLPipeline::RENDER_TYPE_AVATAR; + mDrawableType = LLPipeline::RENDER_TYPE_VOLUME; mPartitionType = LLViewerRegion::PARTITION_BRIDGE; mLODPeriod = 16; mSlopRatio = 0.25f; } +LLAttachmentPartition::LLAttachmentPartition() +: LLBridgePartition() +{ + mDrawableType = LLPipeline::RENDER_TYPE_AVATAR; +} + LLHUDBridge::LLHUDBridge(LLDrawable* drawablep) : LLVolumeBridge(drawablep) { diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 3cacdce81..0dfbd7707 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -792,6 +792,7 @@ void LLSpatialGroup::shift(const LLVector4a &offset) if (!mSpatialPartition->mRenderByGroup && mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TREE && mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TERRAIN && + mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_ATTACHMENT && mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_BRIDGE) { setState(GEOM_DIRTY); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 29f86656a..d47055057 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -737,6 +737,12 @@ public: virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { LLVolumeGeometryManager::addGeometryCount(group, vertex_count, index_count); } }; +class LLAttachmentBridge : public LLVolumeBridge +{ +public: + LLAttachmentBridge(LLDrawable* drawable); +}; + class LLHUDBridge : public LLVolumeBridge { public: @@ -754,11 +760,18 @@ public: virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } }; +//spatial partition that holds nothing but spatial bridges +class LLAttachmentPartition : public LLBridgePartition +{ +public: + LLAttachmentPartition(); +}; + class LLHUDPartition : public LLBridgePartition { public: LLHUDPartition(); - virtual void shift(const LLVector4a &offset); + virtual void shift(const LLVector4a &offset) { } //HUD objects don't shift with region crossing. That would be silly. }; extern const F32 SG_BOX_SIDE; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index c502eab4f..aae1fc4bb 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -380,6 +380,7 @@ void LLViewerRegion::initPartitions() mImpl->mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS mImpl->mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE + mImpl->mObjectPartition.push_back(new LLAttachmentPartition()); //PARTITION_ATTACHMENT mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 07d4fcca4..c74d9bc5a 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -99,6 +99,7 @@ public: PARTITION_GRASS, PARTITION_VOLUME, PARTITION_BRIDGE, + PARTITION_ATTACHMENT, PARTITION_HUD_PARTICLE, PARTITION_NONE, NUM_PARTITIONS diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 909956610..50d751ad0 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9017,7 +9017,7 @@ void LLVOAvatar::updateSoftwareSkinnedVertices(const LLMeshSkinInfo* skin, const U32 LLVOAvatar::getPartitionType() const { // Avatars merely exist as drawables in the bridge partition - return LLViewerRegion::PARTITION_BRIDGE; + return LLViewerRegion::PARTITION_ATTACHMENT; } //static diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e25bc88b1..8fd7c9d1f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4000,6 +4000,10 @@ U32 LLVOVolume::getPartitionType() const { return LLViewerRegion::PARTITION_HUD; } + else if (isAttachment()) + { + return LLViewerRegion::PARTITION_ATTACHMENT; + } return LLViewerRegion::PARTITION_VOLUME; } @@ -4028,6 +4032,12 @@ LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep) mSlopRatio = 0.25f; } +LLAttachmentBridge::LLAttachmentBridge(LLDrawable* drawablep) + : LLVolumeBridge(drawablep) +{ + mPartitionType = LLViewerRegion::PARTITION_ATTACHMENT; +} + bool can_batch_texture(const LLFace* facep) { static const LLCachedControl alt_batching("SHAltBatching",true); @@ -6390,9 +6400,4 @@ LLHUDPartition::LLHUDPartition() mLODPeriod = 1; } -void LLHUDPartition::shift(const LLVector4a &offset) -{ - //HUD objects don't shift with region crossing. That would be silly. -} - diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9d6f0e02a..09200e702 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6492,6 +6492,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, for (U32 j = 0; j < LLViewerRegion::NUM_PARTITIONS; j++) { if ((j == LLViewerRegion::PARTITION_VOLUME) || + (j == LLViewerRegion::PARTITION_ATTACHMENT) || (j == LLViewerRegion::PARTITION_BRIDGE) || (j == LLViewerRegion::PARTITION_TERRAIN) || (j == LLViewerRegion::PARTITION_TREE) || @@ -6554,7 +6555,7 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, { LLViewerRegion* region = *iter; - LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE); + LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_ATTACHMENT); if (part && hasRenderType(part->mDrawableType)) { LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, face_hit, &position, tex_coord, normal, tangent);