summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/buffer_util.h
diff options
context:
space:
mode:
authorAtlasLinden <114031241+AtlasLinden@users.noreply.github.com>2025-08-06 09:42:26 -0400
committerGitHub <noreply@github.com>2025-08-06 09:42:26 -0400
commite4a25dc5b97cd939e6a5ddc8275a728075768a52 (patch)
treeef39a05be37eae43e34d5c1e5ab081aa208b0ebd /indra/newview/gltf/buffer_util.h
parent9311b522d8979cfe6e7a751f9447df8e0c3d1e96 (diff)
parent819817f5c9cebad353f5b86996b5426095dd73b8 (diff)
Merge branch 'develop' into atlas-qaworkflow
Diffstat (limited to 'indra/newview/gltf/buffer_util.h')
-rw-r--r--indra/newview/gltf/buffer_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/gltf/buffer_util.h b/indra/newview/gltf/buffer_util.h
index ef9bba8128..be36c5e90b 100644
--- a/indra/newview/gltf/buffer_util.h
+++ b/indra/newview/gltf/buffer_util.h
@@ -159,6 +159,12 @@ namespace LL
}
template<>
+ inline void copyVec3<F32, LLColor4U>(F32* src, LLColor4U& dst)
+ {
+ dst.set((U8)(src[0] * 255.f), (U8)(src[1] * 255.f), (U8)(src[2] * 255.f), 255);
+ }
+
+ template<>
inline void copyVec3<U16, LLColor4U>(U16* src, LLColor4U& dst)
{
dst.set((U8)(src[0]), (U8)(src[1]), (U8)(src[2]), 255);
@@ -369,6 +375,11 @@ namespace LL
template<class T>
inline void copy(Asset& asset, Accessor& accessor, LLStrider<T>& dst)
{
+ if (accessor.mBufferView == INVALID_INDEX)
+ {
+ LL_WARNS("GLTF") << "Invalid buffer" << LL_ENDL;
+ return;
+ }
const BufferView& bufferView = asset.mBufferViews[accessor.mBufferView];
const Buffer& buffer = asset.mBuffers[bufferView.mBuffer];
const U8* src = buffer.mData.data() + bufferView.mByteOffset + accessor.mByteOffset;