summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2014-01-09 21:17:49 -0700
committerXiaohong Bao <bao@lindenlab.com>2014-01-09 21:17:49 -0700
commit87f852ee67c75ac415ce716157bdd9ba94c60441 (patch)
tree40fbf929b51d056790e52e463f8e5bdbfca53856 /indra/newview
parent6a113325521fa68c634cd900de8352c35fe91268 (diff)
fix for SH-4659:crash at LLOcclusionCullingGroup::doOcclusion line 1150
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llviewerregion.cpp8
-rwxr-xr-xindra/newview/llvocache.cpp9
-rwxr-xr-xindra/newview/llvocache.h2
-rwxr-xr-xindra/newview/pipeline.cpp3
4 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 002dac14a7..3d8afcceb0 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -980,13 +980,15 @@ void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry)
if(entry->hasState(LLVOCacheEntry::IN_VO_TREE))
{
return; //already in the tree.
- }
- entry->setState(LLVOCacheEntry::IN_VO_TREE);
+ }
llassert_always(!entry->getGroup()); //not in octree.
llassert(!entry->getEntry()->hasDrawable()); //not have drawables
- mImpl->mVOCachePartition->addEntry(entry->getEntry());
+ if(mImpl->mVOCachePartition->addEntry(entry->getEntry()))
+ {
+ entry->setState(LLVOCacheEntry::IN_VO_TREE);
+ }
}
void LLViewerRegion::removeFromVOCacheTree(LLVOCacheEntry* entry)
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index aa3594638a..8af6d74ad7 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -609,11 +609,18 @@ LLVOCachePartition::LLVOCachePartition(LLViewerRegion* regionp)
new LLVOCacheGroup(mOctree, this);
}
-void LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry)
+bool LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry)
{
llassert(entry->hasVOCacheEntry());
+ if(!llfinite(entry->getBinRadius()) || !entry->getPositionGroup().isFinite3())
+ {
+ return false; //data corrupted
+ }
+
mOctree->insert(entry);
+
+ return true;
}
void LLVOCachePartition::removeEntry(LLViewerOctreeEntry* entry)
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 928f8c87b9..7396de4709 100755
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -188,7 +188,7 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr
public:
LLVOCachePartition(LLViewerRegion* regionp);
- void addEntry(LLViewerOctreeEntry* entry);
+ bool addEntry(LLViewerOctreeEntry* entry);
void removeEntry(LLViewerOctreeEntry* entry);
/*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion);
void addOccluders(LLViewerOctreeGroup* gp);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c4fa80f0a2..da1048ac78 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2786,7 +2786,8 @@ void LLPipeline::doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderT
void LLPipeline::doOcclusion(LLCamera& camera)
{
- if (LLPipeline::sUseOcclusion > 1 && (sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck))
+ if (LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested &&
+ (sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck))
{
LLVertexBuffer::unbind();