summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolalpha.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:42:14 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-05-02 17:57:11 +0300
commitade8c96e5c68f672d33802f4a82ce46ccffd7816 (patch)
tree0f8c75d3657ce11c38a8d98b081b3b08b64de104 /indra/newview/lldrawpoolalpha.cpp
parent002ff88a130b16f03e26e159f7ea5f38782b16b6 (diff)
parent7ed52090a67882cd0bc904f1e0a9ce07cf6768e9 (diff)
Merge branch 'main' into DRTVWR-567
# Conflicts: # indra/newview/llappviewer.cpp
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)
{