From ec91f9a02602e21d5707557400573b536958647e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 17 Jan 2018 23:18:00 -0600 Subject: [PATCH] Skip binding emissive shader for alpha glow. Caused huge pipeline stalls. Looking into alternate solution. --- indra/newview/lldrawpoolalpha.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 20b59ade8..04d1e7904 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -554,20 +554,21 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) - emissive_shader->bind(); - + //emissive_shader->bind(); + // glow doesn't use vertex colors from the mesh data // Singu Note: Pull attribs from shader, since we always have one here. - params.mVertexBuffer->setBuffer(emissive_shader->mAttributeMask); - + // Singu Note: To avoid ridiculous shader bind cost, simply re-use prior shader, but let llvertexbuffer replace the color attrib ptr with the emissive one. + params.mVertexBuffer->setBuffer(current_shader->mAttributeMask | LLVertexBuffer::MAP_EMISSIVE); + // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + //current_shader->bind(); + // restore our alpha blend mode gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - - current_shader->bind(); } if (tex_setup)