summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolalpha.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/lldrawpoolalpha.cpp
parent9f3f23ffa2ac487741be305068002536b872b015 (diff)
parent162a825dd59c23c9b475d75e0bd5169f3573267b (diff)
Merge remote-tracking branch 'origin/DRTVWR-539' into DRTVWR-559-merge-539
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r--indra/newview/lldrawpoolalpha.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 280be162bc..dd6cfab52c 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -49,6 +49,7 @@
#include "llspatialpartition.h"
#include "llglcommonfunc.h"
#include "llvoavatar.h"
+#include "llperfstats.h"
#include "llenvironment.h"
@@ -348,10 +349,20 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
{
LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA+pass]; // <-- hacky + pass to use PASS_ALPHA_RIGGED on second pass
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Render time Stats collection
for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
{
LLDrawInfo& params = **k;
+ if(params.mFace)
+ {
+ LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject();
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr );
+ }
+ }
+
bool rigged = (params.mAvatar != nullptr);
gHighlightProgram.bind(rigged);
gGL.diffuseColor4f(1, 0, 0, 1);
@@ -535,8 +546,16 @@ void LLDrawPoolAlpha::renderRiggedEmissives(std::vector<LLDrawInfo*>& emissives)
LLVOAvatar* lastAvatar = nullptr;
U64 lastMeshId = 0;
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Render time Stats collection
for (LLDrawInfo* draw : emissives)
{
+ LL_PROFILE_ZONE_NAMED_CATEGORY_DRAWPOOL("Emissives");
+ auto vobj = draw->mFace?draw->mFace->getViewerObject():nullptr;
+ if(vobj && vobj->isAttachment())
+ {
+ trackAttachments( vobj, draw->mFace->isState(LLFace::RIGGED), &ratPtr );
+ }
+
bool tex_setup = TexSetup(draw, false);
if (lastAvatar != draw->mAvatar || lastMeshId != draw->mSkinInfo->mHash)
{
@@ -664,7 +683,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
LLSpatialGroup::drawmap_elem_t& draw_info = rigged ? group->mDrawMap[LLRenderPass::PASS_ALPHA_RIGGED] : group->mDrawMap[LLRenderPass::PASS_ALPHA];
- for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
+ std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; // Render time Stats collection
+ for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
{
LLDrawInfo& params = **k;
if ((bool)params.mAvatar != rigged)
@@ -676,6 +696,16 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
LLRenderPass::applyModelMatrix(params);
+ if(params.mFace)
+ {
+ LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject();
+
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr );
+ }
+ }
+
LLMaterial* mat = NULL;
LLGLTFMaterial *gltf_mat = params.mGLTFMaterial;
@@ -869,6 +899,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
}
}
+ ratPtr.reset(); // force the final batch to terminate to avoid double counting on the subsidiary batches for FB and Emmissives
+
// render emissive faces into alpha channel for bloom effects
if (!depth_only)
{