Make LLPipeline::renderDebug() a bit cheaper

Each frame renderDebug() was pointlesly going over a large list of
partitions and bridges.
meow-7.2.2
Andrey Kleshchev 2024-08-22 17:27:16 +03:00 committed by Andrey Kleshchev
parent 0b062be308
commit e2809755c5
3 changed files with 38 additions and 18 deletions

View File

@ -775,6 +775,7 @@ void LLVOAvatarSelf::updateVisualParams()
void LLVOAvatarSelf::writeWearablesToAvatar()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
for (U32 type = 0; type < LLWearableType::WT_COUNT; type++)
{
LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type);

View File

@ -768,6 +768,7 @@ void LLWorld::updateParticles()
void LLWorld::renderPropertyLines()
{
LL_PROFILE_ZONE_SCOPED;
for (region_list_t::iterator iter = mVisibleRegionList.begin();
iter != mVisibleRegionList.end(); ++iter)
{

View File

@ -4532,33 +4532,51 @@ void LLPipeline::renderDebug()
}
// Debug stuff.
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE |
LLPipeline::RENDER_DEBUG_OCCLUSION |
LLPipeline::RENDER_DEBUG_LIGHTS |
LLPipeline::RENDER_DEBUG_BATCH_SIZE |
LLPipeline::RENDER_DEBUG_UPDATE_TYPE |
LLPipeline::RENDER_DEBUG_BBOXES |
LLPipeline::RENDER_DEBUG_NORMALS |
LLPipeline::RENDER_DEBUG_POINTS |
LLPipeline::RENDER_DEBUG_TEXTURE_AREA |
LLPipeline::RENDER_DEBUG_TEXTURE_ANIM |
LLPipeline::RENDER_DEBUG_RAYCAST |
LLPipeline::RENDER_DEBUG_AVATAR_VOLUME |
LLPipeline::RENDER_DEBUG_AVATAR_JOINTS |
LLPipeline::RENDER_DEBUG_AGENT_TARGET |
LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA |
LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("render debug bridges");
for (LLViewerRegion* region : LLWorld::getInstance()->getRegionList())
{
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
if ( (hud_only && (part->mDrawableType == RENDER_TYPE_HUD || part->mDrawableType == RENDER_TYPE_HUD_PARTICLES)) ||
(!hud_only && hasRenderType(part->mDrawableType)) )
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
{
part->renderDebug();
if ((hud_only && (part->mDrawableType == RENDER_TYPE_HUD || part->mDrawableType == RENDER_TYPE_HUD_PARTICLES)) ||
(!hud_only && hasRenderType(part->mDrawableType)))
{
part->renderDebug();
}
}
}
}
}
for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
{
LLSpatialBridge* bridge = *i;
if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
{
gGL.pushMatrix();
gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
bridge->renderDebug();
gGL.popMatrix();
LLSpatialBridge* bridge = *i;
if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
{
gGL.pushMatrix();
gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
bridge->renderDebug();
gGL.popMatrix();
}
}
}