summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpool.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
committerBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
commit369945b45da4697735bea7e925d87c65d90b2a5a (patch)
tree1c3d9af52d8e082b589085a87acad2d8a3f6ecd4 /indra/newview/lldrawpool.cpp
parent9f3f23ffa2ac487741be305068002536b872b015 (diff)
parent162a825dd59c23c9b475d75e0bd5169f3573267b (diff)
Merge remote-tracking branch 'origin/DRTVWR-539' into DRTVWR-559-merge-539
Diffstat (limited to 'indra/newview/lldrawpool.cpp')
-rw-r--r--indra/newview/lldrawpool.cpp66
1 files changed, 62 insertions, 4 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 15a07ce3d1..0e050c6f31 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -52,6 +52,7 @@
#include "llglcommonfunc.h"
#include "llvoavatar.h"
#include "llviewershadermgr.h"
+#include "llperfstats.h"
S32 LLDrawPool::sNumDrawPools = 0;
@@ -385,13 +386,22 @@ void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, bool texture)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type];
-
+
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Perf stats
for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
{
LLDrawInfo *pparams = *k;
if (pparams)
{
- pushBatch(*pparams, texture);
+ if(pparams->mFace)
+ {
+ LLViewerObject* vobj = pparams->mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments(vobj, false, &ratPtr);
+ }
+ }
+ pushBatch(*pparams, texture);
}
}
}
@@ -403,11 +413,21 @@ void LLRenderPass::renderRiggedGroup(LLSpatialGroup* group, U32 type, bool textu
LLVOAvatar* lastAvatar = nullptr;
U64 lastMeshId = 0;
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Perf stats
for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
{
LLDrawInfo* pparams = *k;
if (pparams)
{
+ if(pparams->mFace)
+ {
+ LLViewerObject* vobj = pparams->mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, true ,&ratPtr);
+ }
+ }
+
if (lastAvatar != pparams->mAvatar || lastMeshId != pparams->mSkinInfo->mHash)
{
uploadMatrixPalette(*pparams);
@@ -423,6 +443,7 @@ void LLRenderPass::renderRiggedGroup(LLSpatialGroup* group, U32 type, bool textu
void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{};
auto* begin = gPipeline.beginRenderMap(type);
auto* end = gPipeline.endRenderMap(type);
for (LLCullResult::drawinfo_iterator i = begin; i != end; )
@@ -430,8 +451,15 @@ void LLRenderPass::pushBatches(U32 type, bool texture, bool batch_textures, bool
LLDrawInfo* pparams = *i;
LLCullResult::increment_iterator(i, end);
- pushBatch(*pparams, texture, batch_textures, reset_gltf);
- reset_gltf = false;
+ if(pparams->mFace)
+ {
+ LLViewerObject* vobj = pparams->mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, false, &ratPtr);
+ }
+ }
+ pushBatch(*pparams, texture, batch_textures, reset_gltf);
}
}
@@ -442,11 +470,21 @@ void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures
U64 lastMeshId = 0;
auto* begin = gPipeline.beginRenderMap(type);
auto* end = gPipeline.endRenderMap(type);
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Perf stats
for (LLCullResult::drawinfo_iterator i = begin; i != end; )
{
LLDrawInfo* pparams = *i;
LLCullResult::increment_iterator(i, end);
+ if(pparams->mFace)
+ {
+ LLViewerObject* vobj = pparams->mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, true, &ratPtr);
+ }
+ }
+
if (pparams->mAvatar.notNull() && (lastAvatar != pparams->mAvatar || lastMeshId != pparams->mSkinInfo->mHash))
{
uploadMatrixPalette(*pparams);
@@ -462,12 +500,21 @@ void LLRenderPass::pushRiggedBatches(U32 type, bool texture, bool batch_textures
void LLRenderPass::pushMaskBatches(U32 type, bool texture, bool batch_textures, bool reset_gltf)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{};
auto* begin = gPipeline.beginRenderMap(type);
auto* end = gPipeline.endRenderMap(type);
for (LLCullResult::drawinfo_iterator i = begin; i != end; )
{
LLDrawInfo* pparams = *i;
LLCullResult::increment_iterator(i, end);
+ if((*pparams).mFace)
+ {
+ LLViewerObject* vobj = (*pparams).mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, false, &ratPtr);
+ }
+ }
LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(pparams->mAlphaMaskCutoff);
pushBatch(*pparams, texture, batch_textures, reset_gltf);
reset_gltf = false;
@@ -479,6 +526,7 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_text
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLVOAvatar* lastAvatar = nullptr;
U64 lastMeshId = 0;
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{};
auto* begin = gPipeline.beginRenderMap(type);
auto* end = gPipeline.endRenderMap(type);
for (LLCullResult::drawinfo_iterator i = begin; i != end; )
@@ -487,6 +535,16 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_text
LLCullResult::increment_iterator(i, end);
+ llassert(pparams);
+ if((*pparams).mFace)
+ {
+ LLViewerObject* vobj = (*pparams).mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, true, &ratPtr);
+ }
+ }
+
if (LLGLSLShader::sCurBoundShaderPtr)
{
LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(pparams->mAlphaMaskCutoff);