diff options
author | Dave Parks <davep@lindenlab.com> | 2023-01-09 15:18:57 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-01-09 15:18:57 -0600 |
commit | a710bf9067bd4c4217b9febc0ad277a1636ec882 (patch) | |
tree | df6b4105f0e7d518f8fecfe3ab654f17abd1ac7c /indra/newview/llspatialpartition.h | |
parent | b3fc82ff1da0c869f0b1dd841647a120a1ae56af (diff) |
SL-18869 Optimizations -- Use _mm_prefetch to cut down on cache misses when iterating over render batches.
Diffstat (limited to 'indra/newview/llspatialpartition.h')
-rw-r--r-- | indra/newview/llspatialpartition.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 020a010405..b765bd1632 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -87,8 +87,6 @@ public: // return mSkinHash->mHash, or 0 if mSkinHash is null U64 getSkinHash(); - LLVector4a mExtents[2]; - LLPointer<LLVertexBuffer> mVertexBuffer; LLPointer<LLViewerTexture> mTexture; std::vector<LLPointer<LLViewerTexture> > mTextureList; @@ -505,6 +503,23 @@ public: typedef LLDrawInfo** drawinfo_iterator; typedef LLDrawable** drawable_iterator; + // Helper function for taking advantage of _mm_prefetch when iterating over cull results + static inline void increment_iterator(LLCullResult::drawinfo_iterator& i, const LLCullResult::drawinfo_iterator& end) + { + ++i; + + if (i != end) + { + _mm_prefetch((char*)(*i)->mVertexBuffer.get(), _MM_HINT_NTA); + + auto* ni = i + 1; + if (ni != end) + { + _mm_prefetch((char*)*ni, _MM_HINT_NTA); + } + } + } + void clear(); sg_iterator beginVisibleGroups(); |