Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vrm10RuntimeExpression.SetWeightNonAlloc method #2128

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

notargs
Copy link
Contributor

@notargs notargs commented Aug 15, 2023

Dictionaryを受け取るバージョンであるSetWeightsNonAllocを作りました
DictionaryをIEnumerableとして列挙する際にGC Allocが発生しますが、このAPIを使うことでそれを回避することが出来ます

@notargs notargs requested a review from Santarh August 15, 2023 03:18
Copy link
Contributor

@Santarh Santarh left a comment

Choose a reason for hiding this comment

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

ありがとうございます!

  • 毎フレーム呼び出すことが期待される関数で GC はなるべく発生させたくない
  • SetWeights のオーバーロードとして定義すると Ambiguous になるので避けたい
  • ~~NonAlloc という命名は Unity の API にも存在する

ということで…… LGTM!

@Santarh Santarh merged commit d24cdbd into vrm-c:master Aug 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants