Skip to content

Support opt-in winit OffscreenCanvas worker windows - #6

Draft
eordano wants to merge 1 commit into
robtfm:release-0.16-dclfrom
eordano:feat/winit-offscreen-worker
Draft

eordano wants to merge 1 commit into
robtfm:release-0.16-dclfrom
eordano:feat/winit-offscreen-worker

Conversation

@eordano

@eordano eordano commented Sep 18, 2026

Copy link
Copy Markdown

Allows Bevy's winit integration to use a canvas attached to a dedicated worker. Adds a disabled-by-default web-worker feature and skips page-only canvas lookup and parent sizing when the worker owns the canvas.

Five files, 21 additions and two deletions. The existing native and non-worker paths remain unchanged. Depends on robtfm/winit#1; the Cargo patch currently pins its public eordano/winit revision and should move to the merged revision when available.

Validation:

  • Native, ordinary Wasm, and atomics Wasm bevy_winit checks pass with the feature both disabled and enabled.
  • A real Bevy 0.16 WebGPU app handles keyboard input and resize on a dedicated worker. During a one-second page stall it advances six GPU submissions and six presented frames. During a 700 ms worker stall, page timers and button events remain responsive.
  • Full upstream Decentraland Explorer Wasm build passes with these Bevy and winit dependencies.

This draft covers the engine integration. Moving Explorer's own bootstrap and browser APIs into a worker is separate application work.

Forward the disabled-by-default web-worker feature to winit. Adopt the page-owned canvas without querying a worker document or overwriting its parent sizing. Pin the companion winit implementation.
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.

1 participant