diff options
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rwxr-xr-x | indra/newview/lldrawpoolalpha.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 75f7921941..2f9e5813c0 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -363,6 +363,9 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) } } +static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group"); +static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_PUSH("Alpha Push Verts"); + void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) { BOOL initialized_lighting = FALSE; @@ -379,10 +382,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) if (group->getSpatialPartition()->mRenderByGroup && !group->isDead()) { + bool is_particle_or_hud_particle = group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_PARTICLE + || group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE; + bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. - group->getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + !is_particle_or_hud_particle; + + + LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_GROUP_LOOP); + + bool disable_cull = is_particle_or_hud_particle; + LLGLDisable cull(disable_cull ? GL_CULL_FACE : 0); LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; @@ -570,10 +581,14 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) } } + { + LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_PUSH); + gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor); params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + } // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && @@ -608,6 +623,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLVertexBuffer::unbind(); if (!light_enabled) @@ -615,4 +632,3 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) gPipeline.enableLightsDynamic(); } } - |