summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolalpha.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:39:13 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:39:13 +0300
commit1444c4a23cb0167002dd398a16cfc78a72e43e03 (patch)
treeb412497a524177b55b981220dfd8c11414496ad1 /indra/newview/lldrawpoolalpha.cpp
parentf9cb6a13b23df14c2dcc7709fafdb28c578a934e (diff)
parent7ed52090a67882cd0bc904f1e0a9ce07cf6768e9 (diff)
Merge branch 'main' into DRTVWR-582-maint-U
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 6c1abb24c9..5b205d373b 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"
BOOL LLDrawPoolAlpha::sShowDebugAlpha = FALSE;
@@ -338,10 +339,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 );
+ }
+ }
+
if (params.mParticle)
{
continue;
@@ -511,8 +522,16 @@ void LLDrawPoolAlpha::renderRiggedEmissives(U32 mask, std::vector<LLDrawInfo*>&
mask |= LLVertexBuffer::MAP_WEIGHT4;
+ 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)
{
@@ -577,7 +596,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)
@@ -596,6 +616,16 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
continue;
}
+ if(params.mFace)
+ {
+ LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject();
+
+ if(vobj->isAttachment())
+ {
+ trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr );
+ }
+ }
+
if(depth_only)
{
// when updating depth buffer, discard faces that are more than 90% transparent
@@ -780,6 +810,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)
{