diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/lltrace.h | 23 | ||||
-rwxr-xr-x | indra/llui/llnotifications.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/lltextureview.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llviewerassetstats.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.h | 5 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 42 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.cpp | 84 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.h | 97 | ||||
-rwxr-xr-x | indra/newview/llviewertexturelist.cpp | 8 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 73 | ||||
-rwxr-xr-x | indra/newview/llvocache.h | 7 | ||||
-rwxr-xr-x | indra/newview/llworld.cpp | 6 |
15 files changed, 222 insertions, 180 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 36a3eb8fe8..72ef51c232 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -44,29 +44,6 @@ namespace LLTrace { class Recording; -typedef LLUnit<F64, LLUnits::Bytes> Bytes; -typedef LLUnit<F64, LLUnits::Kibibytes> Kibibytes; -typedef LLUnit<F64, LLUnits::Mibibytes> Mibibytes; -typedef LLUnit<F64, LLUnits::Gibibytes> Gibibytes; -typedef LLUnit<F64, LLUnits::Bits> Bits; -typedef LLUnit<F64, LLUnits::Kibibits> Kibibits; -typedef LLUnit<F64, LLUnits::Mibibits> Mibibits; -typedef LLUnit<F64, LLUnits::Gibibits> Gibibits; - -typedef LLUnit<F64, LLUnits::Seconds> Seconds; -typedef LLUnit<F64, LLUnits::Milliseconds> Milliseconds; -typedef LLUnit<F64, LLUnits::Minutes> Minutes; -typedef LLUnit<F64, LLUnits::Hours> Hours; -typedef LLUnit<F64, LLUnits::Milliseconds> Milliseconds; -typedef LLUnit<F64, LLUnits::Microseconds> Microseconds; -typedef LLUnit<F64, LLUnits::Nanoseconds> Nanoseconds; - -typedef LLUnit<F64, LLUnits::Meters> Meters; -typedef LLUnit<F64, LLUnits::Kilometers> Kilometers; -typedef LLUnit<F64, LLUnits::Centimeters> Centimeters; -typedef LLUnit<F64, LLUnits::Millimeters> Millimeters; - - template<typename T> T storage_value(T val) { return val; } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 37b0a52036..7932299281 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1207,6 +1207,9 @@ LLNotifications::LLNotifications() mIgnoreAllNotifications(false) { LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); + + // touch the instance tracker for notification channels, so that it will still be around in our destructor + LLInstanceTracker<LLNotificationChannel, std::string>::instanceCount(); } diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 18df9a7b54..72ed3d4485 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -512,8 +512,8 @@ void LLGLTexMemBar::draw() LLUnit<S32, LLUnits::Mibibytes> total_mem = LLViewerTexture::sTotalTextureMemory; LLUnit<S32, LLUnits::Mibibytes> max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ; - F32 cache_max_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; + F32 cache_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getUsage()).value() ; + F32 cache_max_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); LLUnit<F32, LLUnits::Bytes> total_texture_downloaded = gTotalTextureData; diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index af82b61dc8..80412c215f 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -233,7 +233,7 @@ namespace LLViewerAssetStatsFF &sDequeuedAssetRequestsOther }; - static LLTrace::EventStatHandle<LLTrace::Seconds> sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", + static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp", "Time spent responding to temporary texture asset http requests"), sResponseAssetRequestsTempTextureUDP ("assetresponsetimestemptextureudp", "Time spent responding to temporary texture asset udp requests"), @@ -250,7 +250,7 @@ namespace LLViewerAssetStatsFF sResponsedAssetRequestsOther ("assetresponsetimesother", "Time spent responding to other asset requests"); - static LLTrace::EventStatHandle<LLTrace::Seconds>* sResponse[EVACCount] = { + static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >* sResponse[EVACCount] = { &sResponseAssetRequestsTempTextureHTTP, &sResponseAssetRequestsTempTextureUDP, &sResponseAssetRequestsNonTempTextureHTTP, @@ -540,7 +540,7 @@ void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, { const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); - record(*sResponse[int(eac)], LLTrace::Microseconds(duration)); + record(*sResponse[int(eac)], LLUnit<F64, LLUnits::Microseconds>(duration)); } void init() diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6362ccfba6..4e514ddfd1 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1026,11 +1026,6 @@ U32 LLViewerObject::extractSpatialExtents(LLDataPackerBinaryBuffer *dp, LLVector { U32 parent_id = 0; LLViewerObject::unpackParentID(dp, parent_id); - if(parent_id > 0) - { - //is a child, no need to decode further. - return parent_id; - } LLViewerObject::unpackVector3(dp, scale, "Scale"); LLViewerObject::unpackVector3(dp, pos, "Pos"); @@ -2262,7 +2257,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) ) { - record(LLStatViewer::AGENT_POSITION_SNAP, LLTrace::Meters(diff.length())); + record(LLStatViewer::AGENT_POSITION_SNAP, LLUnit<F64, LLUnits::Meters>(diff.length())); } } diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index d631985e82..7b3186d40a 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -978,7 +978,7 @@ void LLOcclusionCullingGroup::clearOcclusionState(U32 state, S32 mode) static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion"); static LLFastTimer::DeclareTimer FTM_OCCLUSION_WAIT("Occlusion Wait"); -BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera) +BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera, const LLVector4a* bounds) { if (camera->getOrigin().isExactlyZero()) { @@ -989,7 +989,6 @@ BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera) LLVector4a fudge; fudge.splat(vel); - const LLVector4a* bounds = getBounds(); const LLVector4a& c = bounds[0]; LLVector4a r; r.setAdd(bounds[1], fudge); @@ -1022,6 +1021,11 @@ BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera) return TRUE; } +U32 LLOcclusionCullingGroup::getLastOcclusionIssuedTime() +{ + return mOcclusionIssued[LLViewerCamera::sCurCameraID]; +} + void LLOcclusionCullingGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) @@ -1120,12 +1124,23 @@ static LLFastTimer::DeclareTimer FTM_OCCLUSION_SET_BUFFER("Set Buffer"); static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW_WATER("Draw Water"); static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW("Draw"); -void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera) +void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector3* region_agent) { if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1) { + //move mBounds to the agent space if necessary + LLVector4a bounds[2]; + bounds[0] = mBounds[0]; + bounds[1] = mBounds[1]; + if(region_agent != NULL) + { + LLVector4a shift((*region_agent)[0], (*region_agent)[1], (*region_agent)[2]); + bounds[0].sub(shift); + bounds[1].sub(shift); + } + // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension - if (earlyFail(camera)) + if (earlyFail(camera, bounds)) { LLFastTimer t(FTM_OCCLUSION_EARLY_FAIL); setOcclusionState(LLOcclusionCullingGroup::DISCARD_QUERY); @@ -1179,10 +1194,10 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera) LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; llassert(shader); - shader->uniform3fv(LLShaderMgr::BOX_CENTER, 1, mBounds[0].getF32ptr()); - shader->uniform3f(LLShaderMgr::BOX_SIZE, mBounds[1][0]+SG_OCCLUSION_FUDGE, - mBounds[1][1]+SG_OCCLUSION_FUDGE, - mBounds[1][2]+SG_OCCLUSION_FUDGE); + shader->uniform3fv(LLShaderMgr::BOX_CENTER, 1, bounds[0].getF32ptr()); + shader->uniform3f(LLShaderMgr::BOX_SIZE, bounds[1][0]+SG_OCCLUSION_FUDGE, + bounds[1][1]+SG_OCCLUSION_FUDGE, + bounds[1][2]+SG_OCCLUSION_FUDGE); if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER) { @@ -1196,7 +1211,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera) } else { - gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0])); + gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, bounds[0])); } } else @@ -1209,7 +1224,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera) } else { - gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0])); + gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, bounds[0])); } } diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 7f2ca6ed2d..980a67367c 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -316,10 +316,11 @@ public: void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE); void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE); void checkOcclusion(); //read back last occlusion query (if any) - void doOcclusion(LLCamera* camera); //issue occlusion query + void doOcclusion(LLCamera* camera, const LLVector3* region_agent = NULL); //issue occlusion query BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; } BOOL needsUpdate(); + U32 getLastOcclusionIssuedTime(); //virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child); @@ -331,7 +332,7 @@ protected: void releaseOcclusionQueryObjectNames(); private: - BOOL earlyFail(LLCamera* camera); + BOOL earlyFail(LLCamera* camera, const LLVector4a* bounds); protected: U32 mOcclusionState[LLViewerCamera::NUM_CAMERAS]; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 64b25f4b0b..d27b37d029 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -910,19 +910,19 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d return; } + bool is_orphan = false; + LLVOCacheEntry* parent = NULL; if(entry->getParentID() > 0) //is a child { - LLVOCacheEntry* parent = getCacheEntry(entry->getParentID()); - if(parent) - { - parent->addChild(entry); - } - else //parent is not in the cache, put into the orphan list. + parent = getCacheEntry(entry->getParentID()); + if(!parent) { + is_orphan = true; mOrphanMap[entry->getParentID()].push_back(entry->getLocalID()); } } - else //insert to vo cache tree. + + if(!is_orphan)//insert to vo cache tree. { //shift to the local regional space from agent space const LLVector3 pos = drawablep->getVObj()->getPositionRegion(); @@ -931,6 +931,11 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d shift.setSub(vec, entry->getPositionGroup()); entry->shift(shift); + if(parent) //is a child + { + entry->shift(parent->getPositionGroup()); + parent->addChild(entry); + } addToVOCacheTree(entry); } @@ -965,10 +970,6 @@ void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry) { return; } - if(entry->getParentID() > 0) - { - return; //no child prim in cache octree. - } llassert(!entry->getEntry()->hasDrawable()); @@ -992,7 +993,7 @@ void LLViewerRegion::removeFromVOCacheTree(LLVOCacheEntry* entry) //add the visible entries void LLViewerRegion::addVisibleCacheEntry(LLVOCacheEntry* entry) { - if(mDead || !entry) + if(mDead || !entry || !entry->getEntry()) { return; } @@ -1102,7 +1103,8 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) if(vo_entry->getParentID() > 0) //is a child { - //child visibility depends on its parent. + //child visibility depends on its parent, force its parent to be visible + addVisibleCacheEntry(getCacheEntry(vo_entry->getParentID())); continue; } @@ -1832,21 +1834,22 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) //1, find the parent in cache LLVOCacheEntry* parent = getCacheEntry(parent_id); - //2, parent is not in the cache, put into the orphan list. - if(!parent) + //2, parent is not in the cache or not probed, put into the orphan list. + if(!parent || !parent->getEntry()) { //check if parent is non-cacheable and already created - if(isNonCacheableObjectCreated(parent_id)) + if(!parent && isNonCacheableObjectCreated(parent_id)) { //parent is visible, so is the child. addVisibleCacheEntry(entry); } else { + entry->setBoundingInfo(pos, scale); mOrphanMap[parent_id].push_back(entry->getLocalID()); } } - else //parent in cache + else //parent in cache octree or probed { if(!parent->isState(LLVOCacheEntry::INACTIVE)) { @@ -1855,6 +1858,9 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) } else { + entry->setBoundingInfo(pos, scale); + entry->shift(parent->getPositionGroup()); + addToVOCacheTree(entry); parent->addChild(entry); } } @@ -1884,6 +1890,8 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) LLVOCacheEntry* child = getCacheEntry((*orphans)[i]); if(child) { + child->shift(entry->getPositionGroup()); + addToVOCacheTree(child); entry->addChild(child); } } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 7ddee48b38..3d4c75cec3 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,17 +89,17 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"), NUM_NEW_OBJECTS("numnewobjectsstat"); -LLTrace::CountStatHandle<LLTrace::Kibibits> KBIT("kbitstat"), - LAYERS_KBIT("layerskbitstat"), - OBJECT_KBIT("objectkbitstat"), - ASSET_KBIT("assetkbitstat"), - TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbitstat"), - ACTUAL_OUT_KBIT("actualoutkbitstat"); - -LLTrace::CountStatHandle<LLTrace::Seconds> SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), - LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); +LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibits> > KBIT("kbitstat"), + LAYERS_KBIT("layerskbitstat"), + OBJECT_KBIT("objectkbitstat"), + ASSET_KBIT("assetkbitstat"), + TEXTURE_KBIT("texturekbitstat"), + ACTUAL_IN_KBIT("actualinkbitstat"), + ACTUAL_OUT_KBIT("actualoutkbitstat"); + +LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> > SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DILATION), SIM_FPS("simfps", "", LL_SIM_STAT_FPS), @@ -141,15 +141,15 @@ LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), static LLTrace::SampleStatHandle<S64> CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle<LLTrace::Bytes> GL_TEX_MEM("gltexmemstat"), - GL_BOUND_MEM("glboundmemstat"), - RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"), - DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), - MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); +LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> > GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"); +LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -164,18 +164,18 @@ SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement<LLTrace::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), - SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement<LLUnit<F64, LLUnits::Bytes> > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), + SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle<LLTrace::Milliseconds> FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), SIM_PING("simpingstat"); -LLTrace::EventStatHandle<LLTrace::Meters> AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle<LLTrace::Milliseconds> REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), FRAME_STACKTIME("framestacktime", "FRAME_SECS"), UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -183,12 +183,12 @@ LLTrace::EventStatHandle<LLTrace::Milliseconds> REGION_CROSSING_TIME("regioncros REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle<LLTrace::Seconds> AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), - TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), - MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), - FPS_10_TIME("fps10time", "Seconds below 10 FPS"), - FPS_8_TIME("fps8time", "Seconds below 8 FPS"), - FPS_2_TIME("fps2time", "Seconds below 2 FPS"); +LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"); } @@ -211,7 +211,7 @@ void LLViewerStats::resetStats() void LLViewerStats::updateFrameStats(const F64 time_diff) { - LLTrace::Seconds time_diff_seconds(time_diff); + LLUnit<F64, LLUnits::Seconds> time_diff_seconds(time_diff); if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff_seconds); @@ -249,15 +249,15 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, LLTrace::Milliseconds(mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, LLUnit<F64, LLUnits::Milliseconds> (mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - sample(LLStatViewer::FRAMETIME_SLEW, LLTrace::Milliseconds(average_frametime - time_diff)); + sample(LLStatViewer::FRAMETIME_SLEW, LLUnit<F64, LLUnits::Milliseconds> (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - sample(LLStatViewer::DELTA_BANDWIDTH, LLTrace::Bits(delta_bandwidth)); - sample(LLStatViewer::MAX_BANDWIDTH, LLTrace::Bits(max_bandwidth)); + sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -347,13 +347,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - sample(LLStatViewer::SIM_PING, LLTrace::Milliseconds(cdp->getPingDelay())); + sample(LLStatViewer::SIM_PING, LLUnit<F64, LLUnits::Milliseconds> (cdp->getPingDelay())); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - sample(LLStatViewer::SIM_PING, LLTrace::Seconds(10)); + sample(LLStatViewer::SIM_PING, LLUnit<F64, LLUnits::Seconds>(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -363,10 +363,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_KBIT, LLTrace::Bits(layer_bits)); + add(LLStatViewer::LAYERS_KBIT, LLUnit<F64, LLUnits::Bits>(layer_bits)); add(LLStatViewer::OBJECT_KBIT, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_KBIT, LLTrace::Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_KBIT, LLUnit<F64, LLUnits::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -403,7 +403,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); + gTotalTextureData = LLUnit<F64, LLUnits::Bytes>(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); texture_stats_timer.reset(); } } @@ -552,9 +552,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLTrace::Kibibytes(gTotalWorldData).value(); - download["object_kbytes"] = LLTrace::Kibibytes(gTotalObjectData).value(); - download["texture_kbytes"] = LLTrace::Kibibytes(gTotalTextureData).value(); + download["world_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalWorldData).value(); + download["object_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalObjectData).value(); + download["texture_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 4e48a61264..879f0067b9 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -94,17 +94,17 @@ extern LLTrace::CountStatHandle<> FPS, NUM_NEW_OBJECTS; -extern LLTrace::CountStatHandle<LLTrace::Kibibits> KBIT, - LAYERS_KBIT, - OBJECT_KBIT, - ASSET_KBIT, - TEXTURE_KBIT, - ACTUAL_IN_KBIT, - ACTUAL_OUT_KBIT; - -extern LLTrace::CountStatHandle<LLTrace::Seconds> SIM_20_FPS_TIME, - SIM_PHYSICS_20_FPS_TIME, - LOSS_5_PERCENT_TIME; +extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibits> > KBIT, + LAYERS_KBIT, + OBJECT_KBIT, + ASSET_KBIT, + TEXTURE_KBIT, + ACTUAL_IN_KBIT, + ACTUAL_OUT_KBIT; + +extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> > SIM_20_FPS_TIME, + SIM_PHYSICS_20_FPS_TIME, + LOSS_5_PERCENT_TIME; extern SimMeasurement<> SIM_TIME_DILATION, SIM_FPS, @@ -144,41 +144,40 @@ extern LLTrace::SampleStatHandle<> FPS_SAMPLE, WINDOW_WIDTH, WINDOW_HEIGHT; -extern LLTrace::SampleStatHandle<LLTrace::Bytes> DELTA_BANDWIDTH, - MAX_BANDWIDTH, - GL_TEX_MEM, - GL_BOUND_MEM, - RAW_MEM, - FORMATTED_MEM; - -extern SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME, - SIM_NET_TIME, - SIM_OTHER_TIME, - SIM_PHYSICS_TIME, - SIM_PHYSICS_STEP_TIME, - SIM_PHYSICS_SHAPE_UPDATE_TIME, - SIM_PHYSICS_OTHER_TIME, - SIM_AI_TIME, - SIM_AGENTS_TIME, - SIM_IMAGES_TIME, - SIM_SCRIPTS_TIME, - SIM_SPARE_TIME, - SIM_SLEEP_TIME, - SIM_PUMP_IO_TIME; - -extern SimMeasurement<LLTrace::Bytes> SIM_UNACKED_BYTES, - SIM_PHYSICS_MEM; - - -extern LLTrace::SampleStatHandle<LLTrace::Milliseconds> FRAMETIME_JITTER, - FRAMETIME_SLEW, - SIM_PING; - -extern LLTrace::EventStatHandle<LLTrace::Meters> AGENT_POSITION_SNAP; +extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> > GL_TEX_MEM, + GL_BOUND_MEM, + RAW_MEM, + FORMATTED_MEM; +extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> > DELTA_BANDWIDTH, + MAX_BANDWIDTH; +extern SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> > SIM_FRAME_TIME, + SIM_NET_TIME, + SIM_OTHER_TIME, + SIM_PHYSICS_TIME, + SIM_PHYSICS_STEP_TIME, + SIM_PHYSICS_SHAPE_UPDATE_TIME, + SIM_PHYSICS_OTHER_TIME, + SIM_AI_TIME, + SIM_AGENTS_TIME, + SIM_IMAGES_TIME, + SIM_SCRIPTS_TIME, + SIM_SPARE_TIME, + SIM_SLEEP_TIME, + SIM_PUMP_IO_TIME; + +extern SimMeasurement<LLUnit<F64, LLUnits::Bytes> > SIM_UNACKED_BYTES, + SIM_PHYSICS_MEM; + + +extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> > FRAMETIME_JITTER, + FRAMETIME_SLEW, + SIM_PING; + +extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP; extern LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY; -extern LLTrace::EventStatHandle<LLTrace::Milliseconds> REGION_CROSSING_TIME, +extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > REGION_CROSSING_TIME, FRAME_STACKTIME, UPDATE_STACKTIME, NETWORK_STACKTIME, @@ -186,12 +185,12 @@ extern LLTrace::EventStatHandle<LLTrace::Milliseconds> REGION_CROSSING_TIME, REBUILD_STACKTIME, RENDER_STACKTIME; -extern LLTrace::EventStatHandle<LLTrace::Seconds> AVATAR_EDIT_TIME, - TOOLBOX_TIME, - MOUSELOOK_TIME, - FPS_10_TIME, - FPS_8_TIME, - FPS_2_TIME; +extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> > AVATAR_EDIT_TIME, + TOOLBOX_TIME, + MOUSELOOK_TIME, + FPS_10_TIME, + FPS_8_TIME, + FPS_2_TIME; } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 5003ec7e7b..431a3b330c 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -671,8 +671,8 @@ void LLViewerTextureList::updateImages(F32 max_time) sample(NUM_RAW_IMAGES, LLImageRaw::sRawImageCount); sample(GL_TEX_MEM, LLImageGL::sGlobalTextureMemory); sample(GL_BOUND_MEM, LLImageGL::sBoundTextureMemory); - sample(RAW_MEM, LLTrace::Bytes(LLImageRaw::sGlobalRawMemory)); - sample(FORMATTED_MEM, LLTrace::Bytes(LLImageFormatted::sGlobalFormattedMemory)); + sample(RAW_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageRaw::sGlobalRawMemory)); + sample(FORMATTED_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageFormatted::sGlobalFormattedMemory)); } { @@ -1374,7 +1374,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d { received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_KBIT, LLTrace::Bytes(received_size)); + add(LLStatViewer::TEXTURE_KBIT, LLUnit<F64, LLUnits::Bytes>(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); U8 codec; @@ -1448,7 +1448,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d received_size = msg->getReceiveSize() ; } - add(LLStatViewer::TEXTURE_KBIT, LLTrace::Bytes(received_size)); + add(LLStatViewer::TEXTURE_KBIT, LLUnit<F64, LLUnits::Bytes>(received_size)); add(LLStatViewer::TEXTURE_PACKETS, 1); //llprintline("Start decode, image header..."); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7d99b11360..67da311c5a 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -900,7 +900,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (mLastRegionHandle != 0) { ++mRegionCrossingCount; - LLTrace::Seconds delta = mRegionCrossingTimer.getElapsedTimeF32(); + LLUnit<F64, LLUnits::Seconds> delta = mRegionCrossingTimer.getElapsedTimeF32(); record(LLStatViewer::REGION_CROSSING_TIME, delta); // Diagnostics diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 93daf2e171..60d78890b5 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -244,6 +244,13 @@ U32 LLVOCacheEntry::getMinFrameRange()const void LLVOCacheEntry::addChild(LLVOCacheEntry* entry) { llassert(entry != NULL); + llassert(entry->getParentID() == mLocalID); + llassert(entry->getEntry() != NULL); + + if(!entry || !entry->getEntry() || entry->getParentID() != mLocalID) + { + return; + } mChildrenList.push_back(entry); } @@ -392,9 +399,10 @@ void LLVOCachePartition::removeEntry(LLViewerOctreeEntry* entry) class LLVOCacheOctreeCull : public LLViewerOctreeCull { public: - LLVOCacheOctreeCull(LLCamera* camera, LLViewerRegion* regionp, const LLVector3& shift, bool use_object_cache_occlusion) + LLVOCacheOctreeCull(LLCamera* camera, LLViewerRegion* regionp, const LLVector3& shift, bool use_object_cache_occlusion, LLVOCachePartition* part) : LLViewerOctreeCull(camera), - mRegionp(regionp) + mRegionp(regionp), + mPartition(part) { mLocalShift = shift; mUseObjectCacheOcclusion = (use_object_cache_occlusion && LLPipeline::sUseOcclusion); @@ -406,15 +414,17 @@ public: base_group->getOctreeNode()->getParent()) //never occlusion cull the root node { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)base_group; - if(group->needsUpdate()) + if(group->needsUpdate())//needs to issue new occlusion culling check. { - return false; //needs to issue new occlusion culling check. + mPartition->addOccluders(group); + return true; } group->checkOcclusion(); if (group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { + mPartition->addOccluders(group); return true; } } @@ -452,23 +462,14 @@ public: virtual void processGroup(LLviewerOctreeGroup* base_group) { - if(mUseObjectCacheOcclusion && base_group->getOctreeNode()->getParent()) - { - LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)base_group; - if (group->needsUpdate() || group->mVisible[LLViewerCamera::sCurCameraID] < LLDrawable::getCurrentFrame() - 1) - { - ((LLOcclusionCullingGroup*)group)->doOcclusion(mCamera); - group->setVisible(); - return; //wait for occlusion culling results - } - } mRegionp->addVisibleGroup(base_group); } private: - LLViewerRegion* mRegionp; - LLVector3 mLocalShift; //shift vector from agent space to local region space. - bool mUseObjectCacheOcclusion; + LLVOCachePartition* mPartition; + LLViewerRegion* mRegionp; + LLVector3 mLocalShift; //shift vector from agent space to local region space. + bool mUseObjectCacheOcclusion; }; S32 LLVOCachePartition::cull(LLCamera &camera) @@ -486,12 +487,48 @@ S32 LLVOCachePartition::cull(LLCamera &camera) LLVector3 region_agent = mRegionp->getOriginAgent(); camera.calcRegionFrustumPlanes(region_agent); - LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, use_object_cache_occlusion); + mOccludedGroups.clear(); + + LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, use_object_cache_occlusion, this); culler.traverse(mOctree); + if(!mOccludedGroups.empty()) + { + processOccluders(&camera, ®ion_agent); + mOccludedGroups.clear(); + } + return 0; } +void LLVOCachePartition::addOccluders(LLviewerOctreeGroup* gp) +{ + LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)gp; + + const U32 MIN_WAIT_TIME = 19; //wait 19 frames to issue a new occlusion request + U32 last_issued_time = group->getLastOcclusionIssuedTime(); + if(!group->needsUpdate() && gFrameCount > last_issued_time && gFrameCount < last_issued_time + MIN_WAIT_TIME) + { + return; + } + + if(!group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION)) + { + group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION); + mOccludedGroups.insert(group); + } +} + +void LLVOCachePartition::processOccluders(LLCamera* camera, const LLVector3* region_agent) +{ + for(std::set<LLOcclusionCullingGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter) + { + LLOcclusionCullingGroup* group = *iter; + group->doOcclusion(camera, region_agent); + group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION); + } +} + //------------------------------------------------------------------- //LLVOCache //------------------------------------------------------------------- diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index b8a7ccac99..bf75cafac5 100755 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -156,8 +156,15 @@ public: void addEntry(LLViewerOctreeEntry* entry); void removeEntry(LLViewerOctreeEntry* entry); /*virtual*/ S32 cull(LLCamera &camera); + void addOccluders(LLviewerOctreeGroup* gp); static LLTrace::MemStatHandle sMemStat; + +private: + void processOccluders(LLCamera* camera, const LLVector3* region_agent); + +private: + std::set<LLOcclusionCullingGroup*> mOccludedGroups; }; // diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index b49152508c..a95adbf442 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -732,9 +732,9 @@ void LLWorld::updateNetStats() S32 actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); S32 actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); - add(LLStatViewer::ACTUAL_IN_KBIT, LLTrace::Bits(actual_in_bits)); - add(LLStatViewer::ACTUAL_OUT_KBIT, LLTrace::Bits(actual_out_bits)); - add(LLStatViewer::KBIT, LLTrace::Bits(bits)); + add(LLStatViewer::ACTUAL_IN_KBIT, LLUnit<F64, LLUnits::Bits>(actual_in_bits)); + add(LLStatViewer::ACTUAL_OUT_KBIT, LLUnit<F64, LLUnits::Bits>(actual_out_bits)); + add(LLStatViewer::KBIT, LLUnit<F64, LLUnits::Bits>(bits)); add(LLStatViewer::PACKETS_IN, packets_in); add(LLStatViewer::PACKETS_OUT, packets_out); add(LLStatViewer::PACKETS_LOST, packets_lost); |