mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 22:50:19 +00:00
012ae07dc8
Right now, a direct reference to the target TaskPool is required to launch tasks on the pools, despite the three newtyped pools (AsyncComputeTaskPool, ComputeTaskPool, and IoTaskPool) effectively acting as global instances. The need to pass a TaskPool reference adds notable friction to spawning subtasks within existing tasks. Possible use cases for this may include chaining tasks within the same pool like spawning separate send/receive I/O tasks after waiting on a network connection to be established, or allowing cross-pool dependent tasks like starting dependent multi-frame computations following a long I/O load. Other task execution runtimes provide static access to spawning tasks (i.e. `tokio::spawn`), which is notably easier to use than the reference passing required by `bevy_tasks` right now. This PR makes does the following: * Adds `*TaskPool::init` which initializes a `OnceCell`'ed with a provided TaskPool. Failing if the pool has already been initialized. * Adds `*TaskPool::get` which fetches the initialized global pool of the respective type or panics. This generally should not be an issue in normal Bevy use, as the pools are initialized before they are accessed. * Updated default task pool initialization to either pull the global handles and save them as resources, or if they are already initialized, pull the a cloned global handle as the resource. This should make it notably easier to build more complex task hierarchies for dependent tasks. It should also make writing bevy-adjacent, but not strictly bevy-only plugin crates easier, as the global pools ensure it's all running on the same threads. One alternative considered is keeping a thread-local reference to the pool for all threads in each pool to enable the same `tokio::spawn` interface. This would spawn tasks on the same pool that a task is currently running in. However this potentially leads to potential footgun situations where long running blocking tasks run on `ComputeTaskPool`.
41 lines
1.6 KiB
TOML
41 lines
1.6 KiB
TOML
[package]
|
|
name = "bevy_gltf"
|
|
version = "0.8.0-dev"
|
|
edition = "2021"
|
|
description = "Bevy Engine GLTF loading"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_animation = { path = "../bevy_animation", version = "0.8.0-dev", optional = true }
|
|
bevy_app = { path = "../bevy_app", version = "0.8.0-dev" }
|
|
bevy_asset = { path = "../bevy_asset", version = "0.8.0-dev" }
|
|
bevy_core = { path = "../bevy_core", version = "0.8.0-dev" }
|
|
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.8.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev" }
|
|
bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.8.0-dev" }
|
|
bevy_log = { path = "../bevy_log", version = "0.8.0-dev" }
|
|
bevy_math = { path = "../bevy_math", version = "0.8.0-dev" }
|
|
bevy_pbr = { path = "../bevy_pbr", version = "0.8.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", features = ["bevy"] }
|
|
bevy_render = { path = "../bevy_render", version = "0.8.0-dev" }
|
|
bevy_scene = { path = "../bevy_scene", version = "0.8.0-dev" }
|
|
bevy_transform = { path = "../bevy_transform", version = "0.8.0-dev" }
|
|
bevy_tasks = { path = "../bevy_tasks", version = "0.8.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" }
|
|
|
|
# other
|
|
gltf = { version = "1.0.0", default-features = false, features = [
|
|
"KHR_lights_punctual",
|
|
"KHR_materials_unlit",
|
|
"extras",
|
|
"names",
|
|
"utils",
|
|
] }
|
|
thiserror = "1.0"
|
|
anyhow = "1.0.4"
|
|
base64 = "0.13.0"
|
|
percent-encoding = "2.1"
|