Skip to content

Conversation

@PPpro
Copy link
Contributor

@PPpro PPpro commented May 5, 2023

Re: https://github.com/cocos/3d-tasks/issues/6330

Changelog

  • support pal/wasm module exporting isntantiateWASM interface
  • support sys.hasFeature(sys.Feature.WASM) query
  • support WASM_SUPPORT_MODE constant in internal:constants module
  • optimize wasm module bullet physx and webgpu
  • support wasm in Editor and Preview

Relative PR

Tested Platform

Tested Module

  • physx (we only use asmjs for the current implementation)
  • bullet
  • webgpu (tested wasm building)

WASM docs

https://github.com/cocos/3d-tasks/blob/master/design-docs/scripting/engine-wasm-module.md


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.

@PPpro PPpro marked this pull request as ready for review May 5, 2023 12:19
@PPpro PPpro marked this pull request as draft May 5, 2023 14:07
// refer https://stackoverflow.com/questions/47879864/how-can-i-check-if-a-browser-supports-webassembly
const supportWasm = (() => {
// iOS 15.4 has some wasm memory issue, can not use wasm for bullet
const isiOS15_4 = (this.os === OS.IOS || this.os === OS.OSX) && /(OS 15_4)|(Version\/15.4)/.test(window.navigator.userAgent);
Copy link
Contributor

Choose a reason for hiding this comment

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

But why check OSX too?

Copy link
Contributor Author

@PPpro PPpro May 6, 2023

Choose a reason for hiding this comment

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

it's a history bug fix, it seems that on safari, there is some memory issue

Copy link
Contributor

Choose a reason for hiding this comment

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

But the variable name is isiOS15_4 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it means on safari iOS15.4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated here 0e1101f

@PPpro PPpro marked this pull request as ready for review May 6, 2023 01:35
// iOS 15.4 has some wasm memory issue, can not use wasm for bullet
const isiOS15_4 = (this.os === OS.IOS || this.os === OS.OSX) && /(OS 15_4)|(Version\/15.4)/.test(window.navigator.userAgent);
if (isiOS15_4) {
// safari iOS 15.4 has some wasm memory issue, can not use wasm for bullet
Copy link
Contributor

Choose a reason for hiding this comment

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

I think should modify the comment too? As not only has issue on iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

udpated de35e29

@lealzhan lealzhan requested a review from yiwenxue May 6, 2023 07:29
@minggo minggo merged commit 0b353b6 into cocos:develop May 8, 2023
@PPpro PPpro deleted the dev-wasm branch May 8, 2023 10:02
@github-actions
Copy link

github-actions bot commented May 8, 2023

@PPpro ❗ There was an error during the execution of the tasks. Please check the logs for more details.

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.

6 participants