Skip to content

Improve baked Skeletal Animation performance. #18705

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

Merged
merged 3 commits into from
May 15, 2025

Conversation

Changdw
Copy link
Contributor

@Changdw Changdw commented May 12, 2025

Re: #18180

Changelog

  • Add the isSkipTransformUpdate method to the Node class, which is temporarily available for internal use only.
  • When the bake of SkeletalAnimation is applied, skip the transform updates of all skeleton nodes that are not sockets.

Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@Changdw
Copy link
Contributor Author

Changdw commented May 12, 2025

@cocos-robot run test cases

Copy link

github-actions bot commented May 12, 2025

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1005770 bytes 1005977 bytes ⚠️ +207 bytes
2D All (legacy pipeline) 2669427 bytes 2669634 bytes ⚠️ +207 bytes
2D All (new pipeline) 2757934 bytes 2758141 bytes ⚠️ +207 bytes
(2D + 3D) All 10013818 bytes 10014191 bytes ⚠️ +373 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16831007 bytes 16831380 bytes ⚠️ +373 bytes

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -21487,8 +21487,9 @@
         IsScaleLocked = 262144,
         IsAnchorLocked = 524288,
         IsSizeLocked = 1048576,
         IsPositionLocked = 2097152,
+        IsSkipTransformUpdate = 16777216,
         PersistentMask = -4192741,
         AllHideMasks = 1560
     }
     /**

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
ios PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
mac PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
android PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
wechatgame PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent

@star-e
Copy link
Contributor

star-e commented May 12, 2025

@cocos-robot run test cases

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
ios PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
mac PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
android PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent
wechatgame PASS PASS FAIL SpineAttachment,SpineBlend,SpinePhysics,ui-opacity,ui-opacity-change-parent

@star-e
Copy link
Contributor

star-e commented May 13, 2025

@cocos-robot run test cases

@smallmain
Copy link
Contributor

Why write isSkipTransformUpdate to CCObject?

@Changdw
Copy link
Contributor Author

Changdw commented May 13, 2025

Why write isSkipTransformUpdate to CCObject?

In some cases, we need to skip the unnecessary transform updates of Node. Since Node inherits from CCObject, we added a flag to indicate that the transform update of Node can be skipped. We also considered adding a dedicated property to indicate skipping the transform update of Node. However, given the extensive use of Node, adding a property might significantly increase memory usage. Therefore, we opted for the solution of adding a flag.

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Copy link

@Changdw, Please check the result of run test cases:

Task Details

@star-e
Copy link
Contributor

star-e commented May 13, 2025

@cocos-robot run-test-cases-custom

@smallmain
Copy link
Contributor

Why write isSkipTransformUpdate to CCObject?

In some cases, we need to skip the unnecessary transform updates of Node. Since Node inherits from CCObject, we added a flag to indicate that the transform update of Node can be skipped. We also considered adding a dedicated property to indicate skipping the transform update of Node. However, given the extensive use of Node, adding a property might significantly increase memory usage. Therefore, we opted for the solution of adding a flag.

Why write isSkipTransformUpdate to CCObject?

In some cases, we need to skip the unnecessary transform updates of Node. Since Node inherits from CCObject, we added a flag to indicate that the transform update of Node can be skipped. We also considered adding a dedicated property to indicate skipping the transform update of Node. However, given the extensive use of Node, adding a property might significantly increase memory usage. Therefore, we opted for the solution of adding a flag.

I just realized that _objFlags is on CCObject, and isSkipTransformUpdate is more like an accessor that should be on Node.

but it doesn't matter anymore.

@star-e
Copy link
Contributor

star-e commented May 13, 2025

@cocos-robot run-test-cases-custom

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Copy link

@Changdw, Please check the result of run test cases:

Task Details

@Changdw
Copy link
Contributor Author

Changdw commented May 14, 2025

@cocos-robot run test cases

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS PASS
android PASS PASS PASS
wechatgame PASS FAIL FAIL

@star-e
Copy link
Contributor

star-e commented May 15, 2025

@cocos-robot run test cases

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS PASS
ios PASS PASS FAIL rt-read-pixels
mac PASS PASS PASS

Copy link

@Changdw, Please check the result of run test cases:

Task Details

@star-e
Copy link
Contributor

star-e commented May 15, 2025

@cocos-robot run test cases

Copy link

@Changdw, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL graphics-continuous-filling
ios PASS PASS PASS
mac PASS PASS PASS

Copy link

@Changdw, Please check the result of run test cases:

Task Details

@star-e star-e merged commit f29677a into cocos:v3.8.7 May 15, 2025
33 checks 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.

3 participants