From 76eeeadeaadf6f7d7b546382f0daac18a2315f81 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 19 Mar 2012 15:31:10 -0500 Subject: MAINT-771 Add RenderAutoHideSurfaceAreaLimit debug setting for protecting against sculpt based crashers. --- indra/newview/app_settings/settings.xml | 35 ++++++++++++--------------------- indra/newview/llspatialpartition.cpp | 1 + indra/newview/llspatialpartition.h | 2 ++ indra/newview/llvovolume.cpp | 3 +++ indra/newview/pipeline.cpp | 7 ++++++- indra/newview/pipeline.h | 1 + 6 files changed, 26 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 992618ba11..c11f3cf978 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9112,28 +9112,19 @@ Value 0 - RenderUseShaderLOD - - Comment - Whether we want to have different shaders for LOD - Persist - 1 - Type - Boolean - Value - 1 - - RenderUseShaderNearParticles - - Comment - Whether we want to use shaders on near particles - Persist - 1 - Type - Boolean - Value - 0 - + + RenderAutoHideSurfaceAreaLimit + + Comment + Maximum surface area of a set of proximal objects inworld before automatically hiding geometry to prevent system overload. + Persist + 1 + Type + F32 + Value + 0 + + RenderVBOEnable Comment diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5d196a465f..38c7dd8283 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1186,6 +1186,7 @@ void LLSpatialGroup::clearOcclusionState(U32 state, S32 mode) //====================================== LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) : + mObjectBoxSize(1.f), mState(0), mGeometryBytes(0), mSurfaceArea(0.f), diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 6c14ecf452..1a93145cc5 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -378,6 +378,8 @@ public: LLVector4a mObjectBounds[2]; // bounding box (center, size) of objects in this node LLVector4a mViewAngle; LLVector4a mLastUpdateViewAngle; + + F32 mObjectBoxSize; //cached mObjectBounds[1].getLength3() private: U32 mCurUpdatingTime ; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e7c35d8220..080d1f774a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4123,6 +4123,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->mGeometryBytes = 0; group->mSurfaceArea = 0; + //cache object box size since it might be used for determining visibility + group->mObjectBoxSize = group->mObjectBounds[1].getLength3().getF32(); + group->clearDrawMap(); mFaceList.clear(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index fbaded04b0..de7296b2dc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -187,6 +187,7 @@ F32 LLPipeline::RenderShadowFOVCutoff; BOOL LLPipeline::CameraOffset; F32 LLPipeline::CameraMaxCoF; F32 LLPipeline::CameraDoFResScale; +F32 LLPipeline::RenderAutoHideSurfaceAreaLimit; const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f; const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f; @@ -592,6 +593,7 @@ void LLPipeline::init() gSavedSettings.getControl("CameraOffset")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); gSavedSettings.getControl("CameraMaxCoF")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); gSavedSettings.getControl("CameraDoFResScale")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); + gSavedSettings.getControl("RenderAutoHideSurfaceAreaLimit")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); } LLPipeline::~LLPipeline() @@ -1015,6 +1017,7 @@ void LLPipeline::refreshCachedSettings() CameraOffset = gSavedSettings.getBOOL("CameraOffset"); CameraMaxCoF = gSavedSettings.getF32("CameraMaxCoF"); CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale"); + RenderAutoHideSurfaceAreaLimit = gSavedSettings.getF32("RenderAutoHideSurfaceAreaLimit"); updateRenderDeferred(); } @@ -3341,7 +3344,9 @@ void LLPipeline::postSort(LLCamera& camera) { LLSpatialGroup* group = *i; if (sUseOcclusion && - group->isOcclusionState(LLSpatialGroup::OCCLUDED)) + group->isOcclusionState(LLSpatialGroup::OCCLUDED) || + (RenderAutoHideSurfaceAreaLimit > 0.f && + group->mSurfaceArea > RenderAutoHideSurfaceAreaLimit*llmax(group->mObjectBoxSize, 10.f))) { continue; } diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 3c4e389ce0..252fe1346c 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -849,6 +849,7 @@ public: static BOOL CameraOffset; static F32 CameraMaxCoF; static F32 CameraDoFResScale; + static F32 RenderAutoHideSurfaceAreaLimit; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); -- cgit v1.2.3