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

Implement Component for WASM FakeTask #4052

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/bevy_ecs/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ where
type Storage = TableStorage;
}

#[cfg(target_arch = "wasm32")]
// ECS dependencies cannot derive Component, so we must implement it manually for relevant structs.
impl Component for bevy_tasks::FakeTask
where
Self: Send + Sync + 'static,
{
type Storage = TableStorage;
}

/// The storage used for a specific component type.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_tasks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub use task_pool::{Scope, TaskPool, TaskPoolBuilder};
#[cfg(target_arch = "wasm32")]
mod single_threaded_task_pool;
#[cfg(target_arch = "wasm32")]
pub use single_threaded_task_pool::{Scope, TaskPool, TaskPoolBuilder};
pub use single_threaded_task_pool::{FakeTask, Scope, TaskPool, TaskPoolBuilder};

mod usages;
pub use usages::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool};
Expand Down