From 93b1da52f56293663d9bfe5272a83a77185f4cff Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 2 Feb 2023 14:35:09 -0600 Subject: SL-18908 Make media texture override base color and emissive texture on PBR materials when present. --- indra/llprimitive/llgltfmaterial.h | 12 +++++------- indra/llprimitive/llmaterial.cpp | 8 ++------ 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'indra/llprimitive') diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h index dec7b696f8..2bd2d34b53 100644 --- a/indra/llprimitive/llgltfmaterial.h +++ b/indra/llprimitive/llgltfmaterial.h @@ -33,7 +33,7 @@ #include "v3color.h" #include "v2math.h" #include "lluuid.h" -#include "llmd5.h" +#include "hbxxh.h" #include @@ -98,12 +98,10 @@ public: LLUUID getHash() const { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - LLMD5 md5; - md5.update((unsigned char*)this, sizeof(this)); - md5.finalize(); - LLUUID id; - md5.raw_digest(id.mData); - return id; + // HACK - hash the bytes of this object but don't include the ref count + LLUUID hash; + HBXXH128::digest(hash, (unsigned char*)this + sizeof(S32), sizeof(this) - sizeof(S32)); + return hash; } enum TextureInfo : U32 diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 0ab97a0df3..a694a666c6 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -27,7 +27,7 @@ #include "linden_common.h" #include "llmaterial.h" -#include "llmd5.h" +#include "hbxxh.h" /** * Materials cap parameters @@ -479,13 +479,9 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) 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 + HBXXH128::digest(id, (unsigned char*)this + sizeof(S32), sizeof(this) - sizeof(S32)); return id; } -- cgit v1.2.3