diff options
author | Dave Parks <davep@lindenlab.com> | 2024-06-21 13:13:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-21 13:13:08 -0500 |
commit | 80ea30af1a8b38360f71c29cc45872c4399dab0d (patch) | |
tree | db07a706a4c896b11b8abca8a7d8815797a8d0be /indra/newview/gltf/primitive.h | |
parent | 9fb9e8f33cb33a1535f43b4be030009c192ea92b (diff) |
#1769 gltf optimization pass (#1816)
#1814 and #1517 Fix mirror update rate and occlusion culling
Diffstat (limited to 'indra/newview/gltf/primitive.h')
-rw-r--r-- | indra/newview/gltf/primitive.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/gltf/primitive.h b/indra/newview/gltf/primitive.h index 7cc05cf831..304eb26432 100644 --- a/indra/newview/gltf/primitive.h +++ b/indra/newview/gltf/primitive.h @@ -54,10 +54,7 @@ namespace LL ~Primitive(); - // GPU copy of mesh data - LLPointer<LLVertexBuffer> mVertexBuffer; - - // CPU copy of mesh data, keep these as LLVector types for compatibility with raycasting code + // CPU copy of mesh data std::vector<LLVector2> mTexCoords0; std::vector<LLVector2> mTexCoords1; std::vector<LLVector4a> mNormals; @@ -80,6 +77,17 @@ namespace LL // shader variant according to LLGLSLShader::GLTFVariant flags U8 mShaderVariant = 0; + // vertex attribute mask + U32 mAttributeMask = 0; + + // backpointer to vertex buffer (owned by Asset) + LLPointer<LLVertexBuffer> mVertexBuffer; + U32 mVertexOffset = 0; + U32 mIndexOffset = 0; + + U32 getVertexCount() const { return (U32) mPositions.size(); } + U32 getIndexCount() const { return (U32) mIndexArray.size(); } + std::unordered_map<std::string, S32> mAttributes; // create octree based on vertex buffer @@ -100,6 +108,11 @@ namespace LL const Primitive& operator=(const Value& src); bool prep(Asset& asset); + + // upload geometry to given vertex buffer + // asserts that buffer is bound + // asserts that buffer is valid for this primitive + void upload(LLVertexBuffer* buffer); }; } } |