Skip to content

#5962 Optimize writeWearablesToAvatar#5965

Merged
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5962
Jul 1, 2026
Merged

#5962 Optimize writeWearablesToAvatar#5965
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5962

Conversation

@akleshchev

@akleshchev akleshchev commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Avatar has hundreds of params, werables usually have significantly less and is a subset of an avatar, don't do pointless checks over every param when we are only interested in ones matching current wearable.

Testing shows ~90mks instead of ~160mks for an outfit with 6 wearables in a 3ms frame. Result can warry greatly but the more wearables the bigger the win in mks.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes how wearable visual parameters are applied to an avatar by iterating wearable-owned parameters (typically far fewer than avatar parameters) and adding a type-filtered setVisualParamWeight overload to avoid unnecessary checks across the full avatar param set. The PR also introduces Apple/platform-guard changes in LLVertexBuffer that affect VBO pooling and buffer region tracking behavior.

Changes:

  • Add a new setVisualParamWeight(index, type, weight) overload on LLCharacter and LLVOAvatarSelf to apply weights only when the visual param’s wearable type matches.
  • Update LLWearable::writeToAvatar to iterate the wearable’s own mVisualParamIndexMap instead of scanning all avatar params.
  • Gate Apple-specific VBO pooling / region tracking paths in LLVertexBuffer behind #if LL_DARWIN || LL_ARM64.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
indra/newview/llvoavatarself.h Declares a new type-filtered setVisualParamWeight overload on LLVOAvatarSelf.
indra/newview/llvoavatarself.cpp Implements the new overload used when wearables write params back to the avatar.
indra/llcharacter/llvisualparam.h Adds getWearableType() to the LLVisualParam interface to support type-filtering.
indra/llcharacter/llcharacter.h Declares the new LLCharacter::setVisualParamWeight(index, type, weight) overload.
indra/llcharacter/llcharacter.cpp Implements the new type-filtered setter using mVisualParamIndexMap.
indra/llappearance/llwearable.cpp Switches wearable-to-avatar param application to iterate wearable params and call the new overload.
indra/llrender/llvertexbuffer.cpp Adds compile-time guards around Apple-specific VBO pooling and buffer update/region-tracking logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indra/newview/llvoavatarself.cpp
Comment thread indra/llrender/llvertexbuffer.cpp Outdated
Comment thread indra/llrender/llvertexbuffer.cpp Outdated
Comment thread indra/llrender/llvertexbuffer.cpp
Comment thread indra/llrender/llvertexbuffer.cpp
@akleshchev akleshchev force-pushed the andreyk/viewer_5962 branch from 03b6cbe to 01fd02e Compare June 29, 2026 14:12
@akleshchev akleshchev linked an issue Jun 29, 2026 that may be closed by this pull request
@akleshchev akleshchev merged commit 4e02831 into develop Jul 1, 2026
18 checks passed
@akleshchev akleshchev deleted the andreyk/viewer_5962 branch July 1, 2026 17:01
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize writeWearablesToAvatar

4 participants