SourceRenderer icon indicating copy to clipboard operation
SourceRenderer copied to clipboard

Implement multi threading for the web platform

Open K0bin opened this issue 9 months ago • 1 comments

  • Render thread
  • Thread pool similar to bevy_tasks
    • Mostly to the AssetLoader work on to

K0bin avatar Apr 14 '25 00:04 K0bin

Partially done.

  • There's a way to start web worker based threads from Rust now.
  • GPU & IO are optionally !Send depending on the platform and the renderer & asset manager can handle that
  • There's a super bare ones abstraction for spawning tasks

To do:

  • Work around Chrome bug when sending OffscreenCanvas from worker to worker. Start the renderer worker at the start and pick that if the send date is instanceof OffscreenCanvas.
  • Wait for a response for the Firefox bug report. (Probably needs another workaround).
  • Test Safari
  • Write thread pool and use that for asset loading in the asset manager (right now it just calls spawn_local)

K0bin avatar Apr 14 '25 00:04 K0bin