summaryrefslogtreecommitdiff
path: root/indra/newview/llvocache.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
commitd1c0a5b840e9ec2d3a468216339ae5367aed4bf5 (patch)
tree30a47a8bf5ba4561c0f6d3839afd1a9f35dac873 /indra/newview/llvocache.h
parent6f99a844efe4e7809ed0a995b0118851e6f0d8d5 (diff)
parent53e958a2638705572ed7dbf61369d92b332c4b60 (diff)
Merge branch 'DRTVWR-559' into marchcat/587-v-pbr-merge
# Conflicts: # indra/llcommon/CMakeLists.txt # indra/newview/llspatialpartition.cpp # indra/newview/llviewergenericmessage.cpp # indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/newview/llvocache.h')
-rw-r--r--indra/newview/llvocache.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 55a13d934d..8525edd121 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -32,11 +32,27 @@
#include "lldir.h"
#include "llvieweroctree.h"
#include "llapr.h"
+#include "llgltfmaterial.h"
+
+#include <unordered_map>
//---------------------------------------------------------------------------
// Cache entries
class LLCamera;
+class LLGLTFOverrideCacheEntry
+{
+public:
+ bool fromLLSD(const LLSD& data);
+ LLSD toLLSD() const;
+
+ LLUUID mObjectId;
+ U32 mLocalId = 0;
+ std::unordered_map<S32, LLSD> mSides; //override LLSD per side
+ std::unordered_map<S32, LLPointer<LLGLTFMaterial> > mGLTFMaterial; //GLTF material per side
+ U64 mRegionHandle = 0;
+};
+
class LLVOCacheEntry
: public LLViewerOctreeEntryData
{
@@ -79,6 +95,13 @@ public:
}
}
};
+
+ struct ExtrasEntry
+ {
+ LLSD extras;
+ std::string extras_raw;
+ };
+
protected:
~LLVOCacheEntry();
public:
@@ -142,7 +165,9 @@ private:
public:
typedef std::map<U32, LLPointer<LLVOCacheEntry> > vocache_entry_map_t;
typedef std::set<LLVOCacheEntry*> vocache_entry_set_t;
- typedef std::set<LLVOCacheEntry*, CompareVOCacheEntry> vocache_entry_priority_list_t;
+ typedef std::set<LLVOCacheEntry*, CompareVOCacheEntry> vocache_entry_priority_list_t;
+
+ typedef std::unordered_map<U32, LLGLTFOverrideCacheEntry> vocache_gltf_overrides_map_t;
S32 mLastCameraUpdated;
protected:
@@ -265,7 +290,10 @@ public:
void removeCache(ELLPath location, bool started = false) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
+ void readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_gltf_overrides_map_t& cache_extras_entry_map);
+
void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled);
+ void writeGenericExtrasToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_gltf_overrides_map_t& cache_extras_entry_map, BOOL dirty_cache, bool removal_enabled);
void removeEntry(U64 handle) ;
U32 getCacheEntries() { return mNumEntries; }
@@ -275,6 +303,7 @@ private:
void setDirNames(ELLPath location);
// determine the cache filename for the region from the region handle
void getObjectCacheFilename(U64 handle, std::string& filename);
+ std::string getObjectCacheExtrasFilename(U64 handle);
void removeFromCache(HeaderEntryInfo* entry);
void readCacheHeader();
void writeCacheHeader();