From c0ba626c8009b22310b3923e8170e5db2a021253 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 15 Oct 2012 21:34:29 -0600 Subject: For SH-3333: Design and implement a new object cache system on viewer side --- indra/newview/llvograss.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvograss.cpp') diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 4dca87652d..d378ed2577 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -603,8 +603,8 @@ U32 LLVOGrass::getPartitionType() const return LLViewerRegion::PARTITION_GRASS; } -LLGrassPartition::LLGrassPartition() -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB) +LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) +: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB, regionp) { mDrawableType = LLPipeline::RENDER_TYPE_GRASS; mPartitionType = LLViewerRegion::PARTITION_GRASS; @@ -624,9 +624,9 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count LLViewerCamera* camera = LLViewerCamera::getInstance(); for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) { - LLDrawable* drawablep = *i; + LLDrawable* drawablep = (LLDrawable*)(*i)->getDrawable(); - if (drawablep->isDead()) + if (!drawablep || drawablep->isDead()) { continue; } @@ -738,8 +738,10 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), //facep->getTexture(), buffer, fullbright); - info->mExtents[0] = group->mObjectExtents[0]; - info->mExtents[1] = group->mObjectExtents[1]; + + const LLVector4a* exts = group->getObjectExtents(); + info->mExtents[0] = exts[0]; + info->mExtents[1] = exts[1]; info->mVSize = vsize; draw_vec.push_back(info); //for alpha sorting -- cgit v1.2.3 From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/newview/llvograss.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llvograss.cpp') diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 88ce6df916..62fe6e7b12 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -28,7 +28,6 @@ #include "llvograss.h" -#include "imageids.h" #include "llviewercontrol.h" #include "llagentcamera.h" -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llvograss.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvograss.cpp') diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 62fe6e7b12..a60d8a2284 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -97,7 +97,7 @@ void LLVOGrass::updateSpecies() if (!sSpeciesTable.count(mSpecies)) { - llinfos << "Unknown grass type, substituting grass type." << llendl; + LL_INFOS() << "Unknown grass type, substituting grass type." << LL_ENDL; SpeciesMap::const_iterator it = sSpeciesTable.begin(); mSpecies = (*it).first; } @@ -119,7 +119,7 @@ void LLVOGrass::initClass() if (!grass_def_grass.parseFile(xml_filename)) { - llerrs << "Failed to parse grass file." << llendl; + LL_ERRS() << "Failed to parse grass file." << LL_ENDL; return; } @@ -131,7 +131,7 @@ void LLVOGrass::initClass() { if (!grass_def->hasName("grass")) { - llwarns << "Invalid grass definition node " << grass_def->getName() << llendl; + LL_WARNS() << "Invalid grass definition node " << grass_def->getName() << LL_ENDL; continue; } F32 F32_val; @@ -143,13 +143,13 @@ void LLVOGrass::initClass() static LLStdStringHandle species_id_string = LLXmlTree::addAttributeString("species_id"); if (!grass_def->getFastAttributeS32(species_id_string, species)) { - llwarns << "No species id defined" << llendl; + LL_WARNS() << "No species id defined" << LL_ENDL; continue; } if (species < 0) { - llwarns << "Invalid species id " << species << llendl; + LL_WARNS() << "Invalid species id " << species << LL_ENDL; continue; } @@ -170,7 +170,7 @@ void LLVOGrass::initClass() if (sSpeciesTable.count(species)) { - llinfos << "Grass species " << species << " already defined! Duplicate discarded." << llendl; + LL_INFOS() << "Grass species " << species << " already defined! Duplicate discarded." << LL_ENDL; delete newGrass; continue; } @@ -186,7 +186,7 @@ void LLVOGrass::initClass() std::string name; static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); grass_def->getFastAttributeString(name_string, name); - llwarns << "Incomplete definition of grass " << name << llendl; + LL_WARNS() << "Incomplete definition of grass " << name << LL_ENDL; } } @@ -257,7 +257,7 @@ U32 LLVOGrass::processUpdateMessage(LLMessageSystem *mesgsys, ||(getAcceleration().lengthSquared() > 0.f) ||(getAngularVelocity().lengthSquared() > 0.f)) { - llinfos << "ACK! Moving grass!" << llendl; + LL_INFOS() << "ACK! Moving grass!" << LL_ENDL; setVelocity(LLVector3::zero); setAcceleration(LLVector3::zero); setAngularVelocity(LLVector3::zero); @@ -444,7 +444,7 @@ void LLVOGrass::plantBlades() // This is bad, but not the end of the world. if (!sSpeciesTable.count(mSpecies)) { - llinfos << "Unknown grass species " << mSpecies << llendl; + LL_INFOS() << "Unknown grass species " << mSpecies << LL_ENDL; return; } -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/newview/llvograss.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvograss.cpp') diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index a60d8a2284..1abb081e73 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -412,11 +412,11 @@ LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLFastTimer::DeclareTimer FTM_UPDATE_GRASS("Update Grass"); +static LLTrace::TimeBlock FTM_UPDATE_GRASS("Update Grass"); BOOL LLVOGrass::updateGeometry(LLDrawable *drawable) { - LLFastTimer ftm(FTM_UPDATE_GRASS); + LL_RECORD_BLOCK_TIME(FTM_UPDATE_GRASS); dirtySpatialGroup(); @@ -670,11 +670,11 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count } } -static LLFastTimer::DeclareTimer FTM_REBUILD_GRASS_VB("Grass VB"); +static LLTrace::TimeBlock FTM_REBUILD_GRASS_VB("Grass VB"); void LLGrassPartition::getGeometry(LLSpatialGroup* group) { - LLFastTimer ftm(FTM_REBUILD_GRASS_VB); + LL_RECORD_BLOCK_TIME(FTM_REBUILD_GRASS_VB); std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater()); -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/newview/llvograss.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvograss.cpp') diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 7aee0efe69..3d4d7aaa81 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -412,7 +412,7 @@ LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLTrace::TimeBlock FTM_UPDATE_GRASS("Update Grass"); +static LLTrace::BlockTimerStatHandle FTM_UPDATE_GRASS("Update Grass"); BOOL LLVOGrass::updateGeometry(LLDrawable *drawable) { @@ -671,7 +671,7 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count } } -static LLTrace::TimeBlock FTM_REBUILD_GRASS_VB("Grass VB"); +static LLTrace::BlockTimerStatHandle FTM_REBUILD_GRASS_VB("Grass VB"); void LLGrassPartition::getGeometry(LLSpatialGroup* group) { -- cgit v1.2.3