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

BatchedMesh Example much slower on WebGPU than WebGL on Android #29580

Open
Makio64 opened this issue Oct 7, 2024 · 1 comment
Open

BatchedMesh Example much slower on WebGPU than WebGL on Android #29580

Makio64 opened this issue Oct 7, 2024 · 1 comment

Comments

@Makio64
Copy link
Contributor

Makio64 commented Oct 7, 2024

Description

On Android ( Samsung Galaxy S20 FE ) BatchedMesh Example WebGPU is much slower :

WebGPU : ~13FPS
WebGL : ~25FPS

Screenshot_20241007_185610_Chrome

Screenshot_20241007_185559_Chrome

Reproduction steps

  1. load on Android https://threejs.org/examples/?q=bat#webgpu_mesh_batch
  2. enabled/disable WebGPU

Code

Live example

``

Screenshots

No response

Version

r169

Device

Mobile

Browser

Chrome

OS

Android

@RenaudRohlinger
Copy link
Collaborator

RenaudRohlinger commented Oct 8, 2024

The multiDrawAPI isn't currently supported in WebGPU, which is why a single multi-draw call with 20,000 batched elements performs significantly better in WebGL, especially on smartphones.

However, there’s good news! A new MultiDrawIndirect API is on the horizon for WebGPU, which is expected to surpass the performance of the WebGL version:
gpuweb/gpuweb#1354 (comment)
https://issues.chromium.org/issues/369246557/dependencies

This API is already available in Chrome Canary behind the chromium-experimental-multi-draw-indirect flag, enabled through enable-unsafe-webgpu. I plan to begin working with it over the coming weeks, as multi-draw is an important part of my workflow.

In the meantime, as discussed in this PR, we can implement a workaround using multiple drawIndirect() calls with a single indirect buffer, mapped at different offsets for each draw alongside Render Bundles. This approach can mimic the upcoming MultiDrawIndirect API until it becomes widely available: #29197 (comment)

For now, I’ll wait for @Spiri0's work on implementing drawIndirect that looks very promising, which will provide a solid base for that work:
#29568 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants