Skip to content

Commit

Permalink
Simplify features now that portable-atomic is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
bushrat011899 committed Feb 24, 2025
1 parent 9931f17 commit 7b49b9c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 28 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@ std = ["bevy_internal/std"]
# `critical-section` provides the building blocks for synchronization primitives on all platforms, including `no_std`.
critical-section = ["bevy_internal/critical-section"]

# `portable-atomic` provides additional platform support for atomic types and operations, even on targets without native support.
portable-atomic = ["bevy_internal/portable-atomic"]

# Uses the `libm` maths library instead of the one provided in `std` and `core`.
libm = ["bevy_internal/libm"]

Expand Down
17 changes: 0 additions & 17 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,6 @@ critical-section = [
"bevy_tasks/critical-section",
]

# `portable-atomic` provides additional platform support for atomic types and
# operations, even on targets without native support.
portable-atomic = [
"bevy_a11y?/portable-atomic",
"bevy_app/portable-atomic",
"bevy_diagnostic/portable-atomic",
"bevy_ecs/portable-atomic",
"bevy_input/portable-atomic",
"bevy_input_focus?/portable-atomic",
"bevy_platform_support/portable-atomic",
"bevy_reflect/portable-atomic",
"bevy_state?/portable-atomic",
"bevy_time/portable-atomic",
"bevy_utils/portable-atomic",
"bevy_tasks/portable-atomic",
]

# Uses the `libm` maths library instead of the one provided in `std` and `core`.
libm = [
"bevy_a11y?/libm",
Expand Down
7 changes: 1 addition & 6 deletions crates/bevy_platform_support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ This is explicitly incompatible with `no_std` targets.
Enables usage of the [`alloc`](https://doc.rust-lang.org/stable/alloc/) crate. Note that this feature is automatically enabled when enabling `std`.
This is compatible with most `no_std` targets, but not all.

### `portable-atomic`

Switches to using [`portable-atomic`](https://docs.rs/portable-atomic/latest/portable_atomic/) as a backend for atomic types, such as `Arc`, `AtomicU8`, etc.
You may need to enable this feature on platforms without full support for atomic types or certain operations, such as [atomic CAS](https://en.wikipedia.org/wiki/Compare-and-swap).

### `critical-section`

Switches to using [`critical-section`](https://docs.rs/critical-section/latest/critical_section/) as a backend for synchronization.
You may need to enable this feature on platforms with little to no support for atomic operations, and is often paired with the `portable-atomic` feature.
You may need to enable this feature on platforms with little to no support for atomic operations.
2 changes: 1 addition & 1 deletion crates/bevy_tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The determining factor for what kind of work should go in each pool is latency r

## `no_std` Support

To enable `no_std` support in this crate, you will need to disable default features, and enable the `edge_executor` and `critical-section` features. For platforms without full support for Rust atomics, you may also need to enable the `portable-atomic` feature.
To enable `no_std` support in this crate, you will need to disable default features, and enable the `edge_executor` and `critical-section` features.

[bevy]: https://bevyengine.org
[rayon]: https://github.com/rayon-rs/rayon
Expand Down
1 change: 0 additions & 1 deletion docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ The default feature set enables most of the expected features of a game engine,
|pbr_specular_textures|Enable support for specular textures in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs|
|pbr_transmission_textures|Enable support for transmission-related textures in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs|
|pnm|PNM image format support, includes pam, pbm, pgm and ppm|
|portable-atomic|`portable-atomic` provides additional platform support for atomic types and operations, even on targets without native support. |
|qoi|QOI image format support|
|reflect_documentation|Enable documentation reflection|
|reflect_functions|Enable function reflection|
Expand Down

0 comments on commit 7b49b9c

Please sign in to comment.