
# Objective - Contributes to #16877 ## Solution - Initial creation of `bevy_platform_support` crate. - Moved `bevy_utils::Instant` into new `bevy_platform_support` crate. - Moved `portable-atomic`, `portable-atomic-util`, and `critical-section` into new `bevy_platform_support` crate. ## Testing - CI --- ## Showcase Instead of needing code like this to import an `Arc`: ```rust #[cfg(feature = "portable-atomic")] use portable_atomic_util::Arc; #[cfg(not(feature = "portable-atomic"))] use alloc::sync::Arc; ``` We can now use: ```rust use bevy_platform_support::sync::Arc; ``` This applies to many other types, but the goal is overall the same: allowing crates to use `std`-like types without the boilerplate of conditional compilation and platform-dependencies. ## Migration Guide - Replace imports of `bevy_utils::Instant` with `bevy_platform_support::time::Instant` - Replace imports of `bevy::utils::Instant` with `bevy::platform_support::time::Instant` ## Notes - `bevy_platform_support` hasn't been reserved on `crates.io` - ~~`bevy_platform_support` is not re-exported from `bevy` at this time. It may be worthwhile exporting this crate, but I am unsure of a reasonable name to export it under (`platform_support` may be a bit wordy for user-facing).~~ - I've included an implementation of `Instant` which is suitable for `no_std` platforms that are not Wasm for the sake of eliminating feature gates around its use. It may be a controversial inclusion, so I'm happy to remove it if required. - There are many other items (`spin`, `bevy_utils::Sync(Unsafe)Cell`, etc.) which should be added to this crate. I have kept the initial scope small to demonstrate utility without making this too unwieldy. --------- Co-authored-by: TimJentzsch <TimJentzsch@users.noreply.github.com> Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com> Co-authored-by: François Mockers <francois.mockers@vleue.com>
128 lines
4.4 KiB
TOML
128 lines
4.4 KiB
TOML
[package]
|
|
name = "bevy_render"
|
|
version = "0.16.0-dev"
|
|
edition = "2021"
|
|
description = "Provides rendering functionality for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
# Texture formats (require more than just image support)
|
|
basis-universal = ["bevy_image/basis-universal"]
|
|
dds = ["bevy_image/dds"]
|
|
exr = ["bevy_image/exr"]
|
|
hdr = ["bevy_image/hdr"]
|
|
ktx2 = ["dep:ktx2", "bevy_image/ktx2"]
|
|
|
|
multi_threaded = ["bevy_tasks/multi_threaded"]
|
|
|
|
shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out", "naga_oil/glsl"]
|
|
shader_format_spirv = ["wgpu/spirv", "naga/spv-in", "naga/spv-out"]
|
|
|
|
# Enable SPIR-V shader passthrough
|
|
spirv_shader_passthrough = ["wgpu/spirv"]
|
|
|
|
trace = ["profiling"]
|
|
tracing-tracy = []
|
|
ci_limits = []
|
|
webgl = ["wgpu/webgl"]
|
|
webgpu = ["wgpu/webgpu"]
|
|
ios_simulator = []
|
|
detailed_trace = []
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.16.0-dev" }
|
|
bevy_asset = { path = "../bevy_asset", version = "0.16.0-dev" }
|
|
bevy_color = { path = "../bevy_color", version = "0.16.0-dev", features = [
|
|
"serialize",
|
|
"wgpu-types",
|
|
] }
|
|
bevy_derive = { path = "../bevy_derive", version = "0.16.0-dev" }
|
|
bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.16.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev" }
|
|
bevy_encase_derive = { path = "../bevy_encase_derive", version = "0.16.0-dev" }
|
|
bevy_math = { path = "../bevy_math", version = "0.16.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", features = [
|
|
"bevy",
|
|
] }
|
|
bevy_render_macros = { path = "macros", version = "0.16.0-dev" }
|
|
bevy_time = { path = "../bevy_time", version = "0.16.0-dev" }
|
|
bevy_transform = { path = "../bevy_transform", version = "0.16.0-dev" }
|
|
bevy_window = { path = "../bevy_window", version = "0.16.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.16.0-dev" }
|
|
bevy_tasks = { path = "../bevy_tasks", version = "0.16.0-dev" }
|
|
bevy_image = { path = "../bevy_image", version = "0.16.0-dev" }
|
|
bevy_mesh = { path = "../bevy_mesh", version = "0.16.0-dev" }
|
|
bevy_platform_support = { path = "../bevy_platform_support", version = "0.16.0-dev", default-features = false, features = [
|
|
"std",
|
|
] }
|
|
|
|
# rendering
|
|
image = { version = "0.25.2", default-features = false }
|
|
|
|
# misc
|
|
codespan-reporting = "0.11.0"
|
|
# `fragile-send-sync-non-atomic-wasm` feature means we can't use Wasm threads for rendering
|
|
# It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm.
|
|
# When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing
|
|
# and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread.
|
|
wgpu = { version = "23.0.1", default-features = false, features = [
|
|
"wgsl",
|
|
"dx12",
|
|
"metal",
|
|
"naga-ir",
|
|
"fragile-send-sync-non-atomic-wasm",
|
|
] }
|
|
naga = { version = "23", features = ["wgsl-in"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
bytemuck = { version = "1.5", features = ["derive", "must_cast"] }
|
|
downcast-rs = { version = "2", default-features = false, features = ["std"] }
|
|
thiserror = { version = "2", default-features = false }
|
|
derive_more = { version = "1", default-features = false, features = ["from"] }
|
|
futures-lite = "2.0.1"
|
|
ktx2 = { version = "0.3.0", optional = true }
|
|
encase = { version = "0.10", features = ["glam"] }
|
|
# For wgpu profiling using tracing. Use `RUST_LOG=info` to also capture the wgpu spans.
|
|
profiling = { version = "1", features = [
|
|
"profile-with-tracing",
|
|
], optional = true }
|
|
async-channel = "2.3.0"
|
|
nonmax = "0.5"
|
|
smallvec = { version = "1.11", features = ["const_new"] }
|
|
offset-allocator = "0.2"
|
|
variadics_please = "1.1"
|
|
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
# Omit the `glsl` feature in non-WebAssembly by default.
|
|
naga_oil = { version = "0.16", default-features = false, features = [
|
|
"test_shader",
|
|
] }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
naga_oil = "0.16"
|
|
js-sys = "0.3"
|
|
web-sys = { version = "0.3.67", features = [
|
|
'Blob',
|
|
'Document',
|
|
'Element',
|
|
'HtmlElement',
|
|
'Node',
|
|
'Url',
|
|
'Window',
|
|
] }
|
|
wasm-bindgen = "0.2"
|
|
|
|
[target.'cfg(all(target_arch = "wasm32", target_feature = "atomics"))'.dependencies]
|
|
send_wrapper = "0.6.0"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
rustdoc-args = ["-Zunstable-options", "--generate-link-to-definition"]
|
|
all-features = true
|