summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2021-09-15 15:39:48 -0700
committerPtolemy <ptolemy@lindenlab.com>2021-09-22 14:38:42 -0700
commit25089265699afe6c2a035f81259e8fd1e4b7008f (patch)
tree250a153bd666cb8e1ec0f677d7ff0a9f118be4e6
parentb1c32db37f74de715b4d6f9e98653f482e05df51 (diff)
SL-16014 Add Tracy logging to lldrawpoolavatar.cpp
-rw-r--r--indra/newview/lldrawpoolavatar.cpp126
1 files changed, 125 insertions, 1 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index c04142ab47..4f615d6107 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -121,6 +121,8 @@ LLDrawPoolAvatar::~LLDrawPoolAvatar()
// virtual
BOOL LLDrawPoolAvatar::isDead()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLFacePool::isDead())
{
return FALSE;
@@ -138,11 +140,15 @@ BOOL LLDrawPoolAvatar::isDead()
S32 LLDrawPoolAvatar::getShaderLevel() const
{
+ LL_PROFILE_ZONE_SCOPED
+
return (S32) LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
}
void LLDrawPoolAvatar::prerender()
{
+ LL_PROFILE_ZONE_SCOPED
+
mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
sShaderLevel = mShaderLevel;
@@ -169,6 +175,8 @@ void LLDrawPoolAvatar::prerender()
LLMatrix4& LLDrawPoolAvatar::getModelView()
{
+ LL_PROFILE_ZONE_SCOPED
+
static LLMatrix4 ret;
ret.initRows(LLVector4(gGLModelView+0),
@@ -257,6 +265,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass)
void LLDrawPoolAvatar::renderDeferred(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
render(pass);
}
@@ -267,6 +277,8 @@ S32 LLDrawPoolAvatar::getNumPostDeferredPasses()
void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0:
@@ -295,6 +307,8 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
void LLDrawPoolAvatar::beginPostDeferredAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
sSkipOpaque = TRUE;
sShaderLevel = mShaderLevel;
sVertexProgram = &gDeferredAvatarAlphaProgram;
@@ -309,6 +323,8 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha()
void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedAlphaProgram;
gPipeline.bindDeferredShader(*sVertexProgram);
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -317,6 +333,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0: pass = 1; break;
@@ -343,6 +361,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass)
void LLDrawPoolAvatar::endDeferredRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
gPipeline.unbindDeferredShader(*sVertexProgram);
sDiffuseChannel = 0;
@@ -353,6 +373,8 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha()
void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
switch (pass)
{
case 0:
@@ -381,6 +403,8 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
void LLDrawPoolAvatar::endPostDeferredAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
sRenderingSkinned = FALSE;
sSkipOpaque = FALSE;
@@ -392,6 +416,8 @@ void LLDrawPoolAvatar::endPostDeferredAlpha()
void LLDrawPoolAvatar::renderPostDeferred(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
static const S32 actual_pass[] =
{ //map post deferred pass numbers to what render() expects
2, //skinned
@@ -647,6 +673,8 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
S32 LLDrawPoolAvatar::getNumPasses()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLPipeline::sImpostorRender)
{
return 8;
@@ -660,6 +688,8 @@ S32 LLDrawPoolAvatar::getNumPasses()
S32 LLDrawPoolAvatar::getNumDeferredPasses()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLPipeline::sImpostorRender)
{
return 19;
@@ -780,6 +810,8 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
void LLDrawPoolAvatar::beginImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f);
@@ -798,6 +830,8 @@ void LLDrawPoolAvatar::beginImpostor()
void LLDrawPoolAvatar::endImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (LLGLSLShader::sNoFixedFunction)
{
gImpostorProgram.unbind();
@@ -807,6 +841,8 @@ void LLDrawPoolAvatar::endImpostor()
void LLDrawPoolAvatar::beginRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (gPipeline.canUseVertexShaders())
{
if (LLPipeline::sUnderWaterRender)
@@ -840,6 +876,8 @@ void LLDrawPoolAvatar::beginRigid()
void LLDrawPoolAvatar::endRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
if (sVertexProgram != NULL)
{
@@ -849,6 +887,8 @@ void LLDrawPoolAvatar::endRigid()
void LLDrawPoolAvatar::beginDeferredImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!LLPipeline::sReflectionRender)
{
LLVOAvatar::sRenderDistance = llclamp(LLVOAvatar::sRenderDistance, 16.f, 256.f);
@@ -865,6 +905,8 @@ void LLDrawPoolAvatar::beginDeferredImpostor()
void LLDrawPoolAvatar::endDeferredImpostor()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL);
sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP);
@@ -876,6 +918,8 @@ void LLDrawPoolAvatar::endDeferredImpostor()
void LLDrawPoolAvatar::beginDeferredRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram;
sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
sVertexProgram->bind();
@@ -892,6 +936,8 @@ void LLDrawPoolAvatar::beginDeferredRigid()
void LLDrawPoolAvatar::endDeferredRigid()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
sVertexProgram->unbind();
@@ -901,6 +947,8 @@ void LLDrawPoolAvatar::endDeferredRigid()
void LLDrawPoolAvatar::beginSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -967,6 +1015,8 @@ void LLDrawPoolAvatar::beginSkinned()
void LLDrawPoolAvatar::endSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
if (sShaderLevel > 0)
{
@@ -991,6 +1041,8 @@ void LLDrawPoolAvatar::endSkinned()
void LLDrawPoolAvatar::beginRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1031,6 +1083,8 @@ void LLDrawPoolAvatar::beginRiggedSimple()
void LLDrawPoolAvatar::endRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1041,27 +1095,37 @@ void LLDrawPoolAvatar::endRiggedSimple()
void LLDrawPoolAvatar::beginRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
beginRiggedSimple();
}
void LLDrawPoolAvatar::endRiggedAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedSimple();
}
void LLDrawPoolAvatar::beginRiggedFullbrightAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
beginRiggedFullbright();
}
void LLDrawPoolAvatar::endRiggedFullbrightAlpha()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedFullbright();
}
void LLDrawPoolAvatar::beginRiggedGlow()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1108,11 +1172,15 @@ void LLDrawPoolAvatar::beginRiggedGlow()
void LLDrawPoolAvatar::endRiggedGlow()
{
+ LL_PROFILE_ZONE_SCOPED
+
endRiggedFullbright();
}
void LLDrawPoolAvatar::beginRiggedFullbright()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1170,6 +1238,8 @@ void LLDrawPoolAvatar::beginRiggedFullbright()
void LLDrawPoolAvatar::endRiggedFullbright()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1180,6 +1250,8 @@ void LLDrawPoolAvatar::endRiggedFullbright()
void LLDrawPoolAvatar::beginRiggedShinySimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1220,6 +1292,8 @@ void LLDrawPoolAvatar::beginRiggedShinySimple()
void LLDrawPoolAvatar::endRiggedShinySimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1231,6 +1305,8 @@ void LLDrawPoolAvatar::endRiggedShinySimple()
void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -1296,6 +1372,8 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny()
void LLDrawPoolAvatar::endRiggedFullbrightShiny()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
if (sShaderLevel > 0 || gPipeline.canUseVertexShaders())
{
@@ -1308,6 +1386,8 @@ void LLDrawPoolAvatar::endRiggedFullbrightShiny()
void LLDrawPoolAvatar::beginDeferredRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedDiffuseProgram;
sDiffuseChannel = 0;
sVertexProgram->bind();
@@ -1323,6 +1403,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedSimple()
void LLDrawPoolAvatar::endDeferredRiggedSimple()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
sVertexProgram->unbind();
sVertexProgram = NULL;
@@ -1330,6 +1412,8 @@ void LLDrawPoolAvatar::endDeferredRiggedSimple()
void LLDrawPoolAvatar::beginDeferredRiggedBump()
{
+ LL_PROFILE_ZONE_SCOPED
+
sVertexProgram = &gDeferredSkinnedBumpProgram;
sVertexProgram->bind();
if (LLPipeline::sRenderingHUDs)
@@ -1346,6 +1430,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedBump()
void LLDrawPoolAvatar::endDeferredRiggedBump()
{
+ LL_PROFILE_ZONE_SCOPED
+
LLVertexBuffer::unbind();
sVertexProgram->disableTexture(LLViewerShaderMgr::BUMP_MAP);
sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -1357,6 +1443,8 @@ void LLDrawPoolAvatar::endDeferredRiggedBump()
void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (pass == 1 ||
pass == 5 ||
pass == 9 ||
@@ -1387,6 +1475,8 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass)
void LLDrawPoolAvatar::endDeferredRiggedMaterial(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (pass == 1 ||
pass == 5 ||
pass == 9 ||
@@ -1407,6 +1497,8 @@ void LLDrawPoolAvatar::endDeferredRiggedMaterial(S32 pass)
void LLDrawPoolAvatar::beginDeferredSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
sShaderLevel = mShaderLevel;
sVertexProgram = &gDeferredAvatarProgram;
sRenderingSkinned = TRUE;
@@ -1428,6 +1520,8 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
void LLDrawPoolAvatar::endDeferredSkinned()
{
+ LL_PROFILE_ZONE_SCOPED
+
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
sRenderingSkinned = FALSE;
sVertexProgram->unbind();
@@ -1740,6 +1834,8 @@ void LLDrawPoolAvatar::getRiggedGeometry(
LLVolume* volume,
const LLVolumeFace& vol_face)
{
+ LL_PROFILE_ZONE_SCOPED
+
face->setGeomIndex(0);
face->setIndicesIndex(0);
@@ -2040,6 +2136,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(
void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!avatar->shouldRenderRigged())
{
return;
@@ -2332,16 +2430,22 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_DEFERRED_SIMPLE);
}
void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_DEFERRED_BUMP);
}
void LLDrawPoolAvatar::renderDeferredRiggedMaterial(LLVOAvatar* avatar, S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, pass);
}
@@ -2396,27 +2500,37 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_SIMPLE);
}
void LLDrawPoolAvatar::renderRiggedFullbright(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_FULLBRIGHT);
}
void LLDrawPoolAvatar::renderRiggedShinySimple(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_SHINY);
}
void LLDrawPoolAvatar::renderRiggedFullbrightShiny(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
renderRigged(avatar, RIGGED_FULLBRIGHT_SHINY);
}
void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_ALPHA].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2434,6 +2548,8 @@ void LLDrawPoolAvatar::renderRiggedAlpha(LLVOAvatar* avatar)
void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_FULLBRIGHT_ALPHA].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2451,6 +2567,8 @@ void LLDrawPoolAvatar::renderRiggedFullbrightAlpha(LLVOAvatar* avatar)
void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
{
+ LL_PROFILE_ZONE_SCOPED
+
if (!mRiggedFace[RIGGED_GLOW].empty())
{
LLGLEnable blend(GL_BLEND);
@@ -2478,6 +2596,8 @@ void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
//-----------------------------------------------------------------------------
LLViewerTexture *LLDrawPoolAvatar::getDebugTexture()
{
+ LL_PROFILE_ZONE_SCOPED
+
if (mReferences.empty())
{
return NULL;
@@ -2501,6 +2621,8 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert (facep->isState(LLFace::RIGGED));
llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV);
if (facep->getPool() && facep->getPool() != this)
@@ -2523,6 +2645,8 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep)
{
+ LL_PROFILE_ZONE_SCOPED
+
llassert (facep->isState(LLFace::RIGGED));
llassert(getType() == LLDrawPool::POOL_AVATAR || getType() == LLDrawPool::POOL_CONTROL_AV);
if (facep->getPool() != this)
@@ -2560,7 +2684,7 @@ LLVertexBufferAvatar::LLVertexBufferAvatar()
: LLVertexBuffer(sDataMask,
GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets
{
-
+ LL_PROFILE_ZONE_SCOPED
}