diff options
-rw-r--r-- | indra/llcommon/llpointer.h | 24 | ||||
-rw-r--r-- | indra/newview/lldrawable.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 15 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 2 |
5 files changed, 31 insertions, 16 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index 9a6453ea48..f9de0c7929 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -340,4 +340,28 @@ private: bool mStayUnique; }; + +// boost hash adapter +template <class Type> +struct boost::hash<LLPointer<Type>> +{ + typedef LLPointer<Type> argument_type; + typedef std::size_t result_type; + result_type operator()(argument_type const& s) const + { + return (std::size_t) s.get(); + } +}; + +// Adapt boost hash to std hash +namespace std +{ + template<class Type> struct hash<LLPointer<Type>> + { + std::size_t operator()(LLPointer<Type> const& s) const noexcept + { + return boost::hash<LLPointer<Type>>()(s); + } + }; +} #endif diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 2a0f4c93ac..cdd8ae88bb 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -42,6 +42,7 @@ #include "llrect.h" #include "llappviewer.h" // for gFrameTimeSeconds #include "llvieweroctree.h" +#include <unordered_set> class LLCamera; class LLDrawPool; @@ -223,7 +224,8 @@ public: friend class LLDrawPool; friend class LLSpatialBridge; - typedef std::set<LLPointer<LLDrawable> > drawable_set_t; + typedef std::unordered_set<LLPointer<LLDrawable> > drawable_set_t; + typedef std::set<LLPointer<LLDrawable> > ordered_drawable_set_t; typedef std::vector<LLPointer<LLDrawable> > drawable_vector_t; typedef std::list<LLPointer<LLDrawable> > drawable_list_t; typedef std::queue<LLPointer<LLDrawable> > drawable_queue_t; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index aebeeb21ac..251af1b46e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -7234,22 +7234,11 @@ void LLViewerObject::setRenderMaterialIDs(const LLRenderMaterialParams* material { if (!local_origin) { - const S32 num_tes = llmin((S32)getNumTEs(), (S32)getNumFaces()); // avatars have TEs but no faces - for (S32 te = 0; te < num_tes; ++te) + for (S32 te = 0; te < getNumTEs(); ++te) { const LLUUID& id = material_params ? material_params->getMaterial(te) : LLUUID::null; - if (id.notNull()) - { - getTE(te)->setGLTFMaterial(gGLTFMaterialList.getMaterial(id)); - setHasRenderMaterialParams(true); - } - else - { - getTE(te)->setGLTFMaterial(nullptr); - } + setRenderMaterialID(te, id, false); } - faceMappingChanged(); - gPipeline.markTextured(mDrawable); } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b60b64ed1f..a0fec90f87 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6150,7 +6150,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) // FIND NEW LIGHTS THAT ARE IN RANGE light_set_t new_nearby_lights; - for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); + for (LLDrawable::ordered_drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter) { LLDrawable* drawable = *iter; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 59858cfcfc..3b41d60356 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -798,7 +798,7 @@ protected: }; typedef std::set< Light, Light::compare > light_set_t; - LLDrawable::drawable_set_t mLights; + LLDrawable::ordered_drawable_set_t mLights; light_set_t mNearbyLights; // lights near camera LLColor4 mHWLightColors[8]; |