diff options
Diffstat (limited to 'indra/newview/lldrawpoolbump.cpp')
-rw-r--r-- | indra/newview/lldrawpoolbump.cpp | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 8db6a10e26..cc454417c6 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -41,6 +41,7 @@ #include "lldrawable.h" #include "llface.h" #include "llsky.h" +#include "llstartup.h" #include "lltextureentry.h" #include "llviewercamera.h" #include "llviewertexturelist.h" @@ -48,6 +49,7 @@ #include "llspatialpartition.h" #include "llviewershadermgr.h" #include "llmodel.h" +#include "llperfstats.h" //#include "llimagebmp.h" //#include "../tools/imdebug/imdebug.h" @@ -77,13 +79,10 @@ static S32 cube_channel = -1; static S32 diffuse_channel = -1; static S32 bump_channel = -1; -#define LL_BUMPLIST_MULTITHREADED 0 // TODO -- figure out why this doesn't work +// Enabled after changing LLViewerTexture::mNeedsCreateTexture to an +// LLAtomicBool; this should work just fine, now. HB +#define LL_BUMPLIST_MULTITHREADED 1 -// static -void LLStandardBumpmap::init() -{ - LLStandardBumpmap::restoreGL(); -} // static void LLStandardBumpmap::shutdown() @@ -94,7 +93,7 @@ void LLStandardBumpmap::shutdown() // static void LLStandardBumpmap::restoreGL() { - addstandard(); + addstandard(); } // static @@ -107,6 +106,12 @@ void LLStandardBumpmap::addstandard() return ; } + if (LLStartUp::getStartupState() < STATE_SEED_CAP_GRANTED) + { + // Not ready, need caps for images + return; + } + // can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps. //llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 ); clear(); @@ -538,10 +543,18 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL { LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type]; - for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) + std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; + for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) { LLDrawInfo& params = **k; + LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject(); + + if( vobj && vobj->isAttachment() ) + { + trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr ); + } + applyModelMatrix(params); if (params.mGroup) @@ -706,10 +719,21 @@ void LLDrawPoolBump::renderDeferred(S32 pass) LLVOAvatar* avatar = nullptr; U64 skin = 0; + std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i) { LLDrawInfo& params = **i; + if(params.mFace) + { + LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject(); + + if(vobj && vobj->isAttachment()) + { + trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr ); + } + } + LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(params.mAlphaMaskCutoff); LLDrawPoolBump::bindBumpMap(params, bump_channel); @@ -769,8 +793,6 @@ void LLBumpImageList::init() llassert( mBrightnessEntries.size() == 0 ); llassert( mDarknessEntries.size() == 0 ); - LLStandardBumpmap::init(); - LLStandardBumpmap::restoreGL(); sMainQueue = LL::WorkQueue::getInstance("mainloop"); sTexUpdateQueue = LL::WorkQueue::getInstance("LLImageGL"); // Share work queue with tex loader. @@ -1337,10 +1359,21 @@ void LLDrawPoolBump::renderBump(U32 type, U32 mask) LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type); LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type); + std::unique_ptr<LLPerfStats::RecordAttachmentTime> ratPtr{}; for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i) { LLDrawInfo& params = **i; + if(params.mFace) + { + LLViewerObject* vobj = (LLViewerObject *)params.mFace->getViewerObject(); + + if( vobj && vobj->isAttachment() ) + { + trackAttachments( vobj, params.mFace->isState(LLFace::RIGGED), &ratPtr ); + } + } + if (LLDrawPoolBump::bindBumpMap(params)) { if (mRigged) |