diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-01-19 09:13:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 09:13:45 -0600 |
commit | 7bd9d21e19b923096ba2b5ea3cbc8be3e13d7aa0 (patch) | |
tree | e96b35f6ae7a1377334e467fc324ec17ac6e49c3 /indra/llprimitive | |
parent | 1ff3b1ffa54db0f7aaca543e2565e1ac3087d1e0 (diff) |
Optimizations, decruft, and intel compatibility pass (#53)
SL-18869, SL-18772 Overhaul VBO management, restore occlusion culling, intel compatibility pass, etc
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 13 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index f546ac1645..0ab97a0df3 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llmaterial.h" +#include "llmd5.h" /** * Materials cap parameters @@ -475,4 +476,16 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) return ret; } +LLUUID LLMaterial::getHash() const +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + LLMD5 md5; + // HACK - hash the bytes of this LLMaterial, but trim off the S32 in LLRefCount + md5.update((unsigned char*)this + sizeof(S32), sizeof(this) - sizeof(S32)); + md5.finalize(); + LLUUID id; + md5.raw_digest(id.mData); + // *TODO: Hash the overrides + return id; +} diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 2f8aafc2cf..d715671ae1 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -125,6 +125,7 @@ public: bool operator != (const LLMaterial& rhs) const; U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT); + LLUUID getHash() const; protected: LLUUID mNormalID; |