diff options
Diffstat (limited to 'indra/newview/llspatialpartition.h')
-rw-r--r-- | indra/newview/llspatialpartition.h | 78 |
1 files changed, 28 insertions, 50 deletions
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 919f386d29..afe24d7d1f 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -41,6 +41,7 @@ #include "llviewercamera.h" #include "llvector4a.h" #include <queue> +#include <unordered_map> #define SG_STATE_INHERIT_MASK (OCCLUDED) #define SG_INITIAL_STATE_MASK (DIRTY | GEOM_DIRTY) @@ -49,20 +50,18 @@ class LLViewerOctreePartition; class LLSpatialPartition; class LLSpatialBridge; class LLSpatialGroup; -class LLTextureAtlas; -class LLTextureAtlasSlot; class LLViewerRegion; void pushVerts(LLFace* face, U32 mask); -class LLDrawInfo : public LLRefCount, public LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16> +class LLDrawInfo : public LLRefCount { + LL_ALIGN_NEW; protected: ~LLDrawInfo(); public: LLDrawInfo(const LLDrawInfo& rhs) - : LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16>("LLDrawInfo") { *this = rhs; } @@ -81,12 +80,19 @@ public: void validate(); + // 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; + // virtual size of mTexture and mTextureList textures + // used to update the decode priority of textures in this DrawInfo + std::vector<F32> mTextureListVSize; + S32 mDebugColor; const LLMatrix4* mTextureMatrix; const LLMatrix4* mModelMatrix; @@ -119,6 +125,8 @@ public: F32 mAlphaMaskCutoff; U8 mDiffuseAlphaMode; bool mSelected; + LLVOAvatar* mAvatar = nullptr; + LLMeshSkinInfo* mSkinInfo = nullptr; struct CompareTexture @@ -216,10 +224,10 @@ public: typedef std::vector<LLPointer<LLSpatialGroup> > sg_vector_t; typedef std::vector<LLPointer<LLSpatialBridge> > bridge_list_t; typedef std::vector<LLPointer<LLDrawInfo> > drawmap_elem_t; - typedef std::map<U32, drawmap_elem_t > draw_map_t; + typedef std::unordered_map<U32, drawmap_elem_t > draw_map_t; typedef std::vector<LLPointer<LLVertexBuffer> > buffer_list_t; - typedef std::map<LLFace*, buffer_list_t> buffer_texture_map_t; - typedef std::map<U32, buffer_texture_map_t> buffer_map_t; + typedef std::unordered_map<LLFace*, buffer_list_t> buffer_texture_map_t; + typedef std::unordered_map<U32, buffer_texture_map_t> buffer_map_t; struct CompareDistanceGreater { @@ -298,49 +306,15 @@ public: virtual void handleDestruction(const TreeNode* node); virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child); -//------------------- -//for atlas use -//------------------- - //atlas - void setCurUpdatingTime(U32 t) {mCurUpdatingTime = t ;} - U32 getCurUpdatingTime() const { return mCurUpdatingTime ;} - - void setCurUpdatingSlot(LLTextureAtlasSlot* slotp) ; - LLTextureAtlasSlot* getCurUpdatingSlot(LLViewerTexture* imagep, S8 recursive_level = 3) ; - - void setCurUpdatingTexture(LLViewerTexture* tex){ mCurUpdatingTexture = tex ;} - LLViewerTexture* getCurUpdatingTexture() const { return mCurUpdatingTexture ;} - - BOOL hasAtlas(LLTextureAtlas* atlasp) ; - LLTextureAtlas* getAtlas(S8 ncomponents, S8 to_be_reserved, S8 recursive_level = 3) ; - void addAtlas(LLTextureAtlas* atlasp, S8 recursive_level = 3) ; - void removeAtlas(LLTextureAtlas* atlasp, BOOL remove_group = TRUE, S8 recursive_level = 3) ; - void clearAtlasList() ; - public: - LL_ALIGN_16(LLVector4a mViewAngle); LL_ALIGN_16(LLVector4a mLastUpdateViewAngle); F32 mObjectBoxSize; //cached mObjectBounds[1].getLength3() - -private: - U32 mCurUpdatingTime ; - //do not make the below two to use LLPointer - //because mCurUpdatingTime invalidates them automatically. - LLTextureAtlasSlot* mCurUpdatingSlotp ; - LLViewerTexture* mCurUpdatingTexture ; - - std::vector< std::list<LLTextureAtlas*> > mAtlasList ; -//------------------- -//end for atlas use -//------------------- protected: virtual ~LLSpatialGroup(); - static S32 sLODSeed; - public: bridge_list_t mBridgeList; buffer_map_t mBufferMap; //used by volume buffers to attempt to reuse vertex buffers @@ -465,8 +439,11 @@ public: virtual void cleanupReferences(); virtual LLSpatialPartition* asPartition() { return this; } + //transform agent space camera into this Spatial Bridge's coordinate frame virtual LLCamera transformCamera(LLCamera& camera); - + + //transform agent space bounding box into this Spatial Bridge's coordinate frame + void transformExtents(const LLVector4a* src, LLVector4a* dst); LLDrawable* mDrawable; }; @@ -646,7 +623,8 @@ class LLVolumeGeometryManager: public LLGeometryManager virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); - U32 genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE); + virtual void addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count); + U32 genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL rigged = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); private: @@ -654,13 +632,13 @@ private: void freeFaces(); static int32_t sInstanceCount; - static LLFace** sFullbrightFaces; - static LLFace** sBumpFaces; - static LLFace** sSimpleFaces; - static LLFace** sNormFaces; - static LLFace** sSpecFaces; - static LLFace** sNormSpecFaces; - static LLFace** sAlphaFaces; + static LLFace** sFullbrightFaces[2]; + static LLFace** sBumpFaces[2]; + static LLFace** sSimpleFaces[2]; + static LLFace** sNormFaces[2]; + static LLFace** sSpecFaces[2]; + static LLFace** sNormSpecFaces[2]; + static LLFace** sAlphaFaces[2]; }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) |