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

Optimize memory size of SparseArray and integer-based ECS IDs #3678

Closed
wants to merge 71 commits into from

Commits on Jan 15, 2022

  1. Configuration menu
    Copy the full SHA
    6620dd9 View commit details
    Browse the repository at this point in the history
  2. Use nonmax instead.

    james7132 committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    37bd31f View commit details
    Browse the repository at this point in the history
  3. Implement it for BundleId

    james7132 committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    28fe7a0 View commit details
    Browse the repository at this point in the history
  4. Fix tests

    james7132 committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    8bca091 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f01f1d2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d2ebb01 View commit details
    Browse the repository at this point in the history
  7. Fix formatting

    james7132 committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    1c2525c View commit details
    Browse the repository at this point in the history
  8. Fix test

    james7132 committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    6aa4a97 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2022

  1. Configuration menu
    Copy the full SHA
    ab57a2b View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2022

  1. Update docs

    james7132 committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    85fc10c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eea5465 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2022

  1. Address safety comment review

    Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
    james7132 and DJMcNab committed Mar 6, 2022
    Configuration menu
    Copy the full SHA
    41d7c08 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    db30528 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    351ffea View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f01b97a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    692b4a0 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Fix broken doc reference

    james7132 committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    307775e View commit details
    Browse the repository at this point in the history

Commits on May 20, 2022

  1. Configuration menu
    Copy the full SHA
    1e19f0e View commit details
    Browse the repository at this point in the history
  2. Formatting

    james7132 committed May 20, 2022
    Configuration menu
    Copy the full SHA
    ceeea05 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2022

  1. Per-ID type Repr

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    a1bd8c4 View commit details
    Browse the repository at this point in the history
  2. Formatting

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    fd34430 View commit details
    Browse the repository at this point in the history
  3. Shrink ComponentId to u32

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    77f9a15 View commit details
    Browse the repository at this point in the history
  4. Shrink ArchetypeId to u32

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    96ddad1 View commit details
    Browse the repository at this point in the history
  5. Shrink BundleId to u32

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    0a275db View commit details
    Browse the repository at this point in the history
  6. Shrink ArchetypeComponentId

    james7132 committed May 22, 2022
    Configuration menu
    Copy the full SHA
    a0edde8 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2022

  1. Configuration menu
    Copy the full SHA
    3ae86f0 View commit details
    Browse the repository at this point in the history
  2. Optimize ComponentSparseSet

    james7132 committed May 25, 2022
    Configuration menu
    Copy the full SHA
    83a8b57 View commit details
    Browse the repository at this point in the history
  3. Formatting

    james7132 committed May 25, 2022
    Configuration menu
    Copy the full SHA
    e74dc1f View commit details
    Browse the repository at this point in the history

Commits on May 31, 2022

  1. Configuration menu
    Copy the full SHA
    3c07935 View commit details
    Browse the repository at this point in the history
  2. Fix CI

    james7132 committed May 31, 2022
    Configuration menu
    Copy the full SHA
    c70b98b View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2022

  1. Configuration menu
    Copy the full SHA
    66d2c4d View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2022

  1. Configuration menu
    Copy the full SHA
    7e7c85e View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2022

  1. Configuration menu
    Copy the full SHA
    ff8cb07 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2022

  1. Configuration menu
    Copy the full SHA
    ebf8f9c View commit details
    Browse the repository at this point in the history
  2. Fix CI

    james7132 committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    675cdca View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. Configuration menu
    Copy the full SHA
    d2648e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e23485b View commit details
    Browse the repository at this point in the history
  3. NonMax -> NonZero

    james7132 committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    ef3082c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ea2d275 View commit details
    Browse the repository at this point in the history
  5. Make repr_to_index unsafe

    james7132 committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    b8219fa View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    92ca951 View commit details
    Browse the repository at this point in the history
  7. Delete outdated test

    james7132 committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    2aa3fe0 View commit details
    Browse the repository at this point in the history
  8. Fix CI

    james7132 committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    e28d7ac View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2023

  1. Configuration menu
    Copy the full SHA
    e477f50 View commit details
    Browse the repository at this point in the history
  2. Fix build

    james7132 committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    e945015 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c8cddc4 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2023

  1. Fix safety comment.

    Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
    james7132 and bjorn3 committed Jan 7, 2023
    Configuration menu
    Copy the full SHA
    3388b4a View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2023

  1. Discard incorrect test

    james7132 committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    79c65da View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2023

  1. Added missing details to SystemParam Local documentation. (bevyengine…

    …#7106)
    
    # Objective
    
    `SystemParam` `Local`s documentation currently leaves out information that should be documented.
    - What happens when multiple `SystemParam`s within the same system have the same `Local` type.
    - What lifetime parameter is expected by `Local`.
     
    ## Solution
    
    - Added sentences to documentation to communicate this information.
    - Renamed `Local` lifetimes in code to `'s` where they previously were not. Users can get complicated incorrect suggested fixes if they pass the wrong lifetime. Some instance of the code had `'w` indicating the expected lifetime might not have been known to those that wrote the code either.
    
    Co-authored-by: iiYese <83026177+iiYese@users.noreply.github.com>
    2 people authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    83b03f8 View commit details
    Browse the repository at this point in the history
  2. Fix doc comment "Turbo" -> "Extreme" (bevyengine#7091)

    # Objective
    Doc comment mentions turbo which is a sensitivity that doesn't exist.
    
    ## Solution
    
    Change the comment to "Extreme" which does exist
    A-Walrus authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    b0b7e58 View commit details
    Browse the repository at this point in the history
  3. add Axis::devices to get all the input devices (bevyengine#5400)

    (github made me type out a message for the commit which looked like it was for the pr, sorry)
    
    # Objective
    
    - Add a way to get all of the input devices of an `Axis`, primarily useful for looping through them
    
    ## Solution
    
    - Adds `Axis<T>::devices()` which returns a `FixedSizeIterator<Item = &T>`
    - Adds a (probably unneeded) `test_axis_devices` test because tests are cool.
    
    ---
    
    ## Changelog
    
    - Added `Axis<T>::devices()` method
    
    ## Migration Guide
    
    Not a breaking change.
    1e1001 authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    bebfb01 View commit details
    Browse the repository at this point in the history
  4. Update an outdated example for Mut::map_unchanged (bevyengine#7115)

    # Objective
    
    - The doctest for `Mut::map_unchanged` uses a fake function `set_if_not_equal` to demonstrate usage.
    - Now that bevyengine#6853 has been merged, we can use `Mut::set_if_neq` directly instead of mocking it.
    JoJoJet authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    5fa57ab View commit details
    Browse the repository at this point in the history
  5. Remove the SystemParamState trait and remove types like ResState (b…

    …evyengine#6919)
    
    Spiritual successor to bevyengine#5205.
    Actual successor to bevyengine#6865.
    
    # Objective
    
    Currently, system params are defined using three traits: `SystemParam`, `ReadOnlySystemParam`, `SystemParamState`. The behavior for each param is specified by the `SystemParamState` trait, while `SystemParam` simply defers to the state.
    
    Splitting the traits in this way makes it easier to implement within macros, but it increases the cognitive load. Worst of all, this approach requires each `MySystemParam` to have a public `MySystemParamState` type associated with it.
    
    ## Solution
    
    * Merge the trait `SystemParamState` into `SystemParam`.
    * Remove all trivial `SystemParam` state types. 
      * `OptionNonSendMutState<T>`: you will not be missed.
    
    ---
    
    - [x] Fix/resolve the remaining test failure.
    
    ## Changelog
    
    * Removed the trait `SystemParamState`, merging its functionality into `SystemParam`.
    
    ## Migration Guide
    
    **Note**: this should replace the migration guide for bevyengine#6865.
    This is relative to Bevy 0.9, not main.
    
    The traits `SystemParamState` and `SystemParamFetch` have been removed, and their functionality has been transferred to `SystemParam`.
    
    
    ```rust
    // Before (0.9)
    impl SystemParam for MyParam<'_, '_> {
        type State = MyParamState;
    }
    unsafe impl SystemParamState for MyParamState {
        fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self { ... }
    }
    unsafe impl<'w, 's> SystemParamFetch<'w, 's> for MyParamState {
        type Item = MyParam<'w, 's>;
        fn get_param(&mut self, ...) -> Self::Item;
    }
    unsafe impl ReadOnlySystemParamFetch for MyParamState { }
    
    // After (0.10)
    unsafe impl SystemParam for MyParam<'_, '_> {
        type State = MyParamState;
        type Item<'w, 's> = MyParam<'w, 's>;
        fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State { ... }
        fn get_param<'w, 's>(state: &mut Self::State, ...) -> Self::Item<'w, 's>;
    }
    unsafe impl ReadOnlySystemParam for MyParam<'_, '_> { }
    ```
    
    The trait `ReadOnlySystemParamFetch` has been replaced with `ReadOnlySystemParam`.
    
    ```rust
    // Before
    unsafe impl ReadOnlySystemParamFetch for MyParamState {}
    
    // After
    unsafe impl ReadOnlySystemParam for MyParam<'_, '_> {}
    ```
    JoJoJet authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    563cb2e View commit details
    Browse the repository at this point in the history
  6. bevy_render: Run calculate_bounds in the end-of-update exclusive syst…

    …ems (bevyengine#7127)
    
    # Objective
    
    - Avoid slower than necessary first frame after spawning many entities due to them not having `Aabb`s and so being marked visible
      - Avoids unnecessarily large system and VRAM allocations as a consequence
    
    ## Solution
    
    - I noticed when debugging the `many_cubes` stress test in Xcode that the `MeshUniform` binding was much larger than it needed to be. I realised that this was because initially, all mesh entities are marked as being visible because they don't have `Aabb`s because `calculate_bounds` is being run in `PostUpdate` and there are no system commands applications before executing the visibility check systems that need the `Aabb`s. The solution then is to run the `calculate_bounds` system just before the previous system commands are applied which is at the end of the `Update` stage.
    superdump authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    8340a3b View commit details
    Browse the repository at this point in the history
  7. Support storage buffers in derive AsBindGroup (bevyengine#6129)

    # Objective
    
    - Storage buffers are useful and not currently supported by the `AsBindGroup` derive which means you need to expand the macro if you need a storage buffer
    
    ## Solution
    
    - Add a new `#[storage]` attribute to the derive `AsBindGroup` macro.
    	- Support and optional `read_only` parameter that defaults to false when not present.
    	- Support visibility parameters like the texture and sampler attributes.
    
    ---
    
    ## Changelog
    
    - Add a new `#[storage(index)]` attribute to the derive `AsBindGroup` macro.
    
    
    Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
    2 people authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    025010a View commit details
    Browse the repository at this point in the history
  8. Expose symphonia features from rodio in bevy_audio and bevy (bevyengi…

    …ne#6388)
    
    # Objective
    Fix bevyengine#6301 
    
    ## Solution
    Add new features in `bevy_audio` to use `symphonia` sound format from `rodio` 
    Also add in `bevy`
    Ian-Yy authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    a15827b View commit details
    Browse the repository at this point in the history
  9. Smooth Transition between Animations (bevyengine#6922)

    # Objective
    
    - Fixes bevyengine#6338
    
    This PR allows for smooth transitions between different animations.
    
    ## Solution
    
    - This PR uses very simple linear blending of animations.
    - When starting a new animation, you can give it a duration, and throughout that duration, the previous and the new animation are being linearly blended, until only the new animation is running.
    - I'm aware of bevyengine/rfcs#49 and bevyengine/rfcs#51, which are more complete solutions to this problem, but they seem still far from being implemented. Until they're ready, this PR allows for the most basic use case of blending, i.e. smoothly transitioning between different animations.
    
    ## Migration Guide
    
    - no bc breaking changes
    smessmer authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    49e76e6 View commit details
    Browse the repository at this point in the history
  10. Gamepad events refactor (bevyengine#6965)

    # Objective 
    
    - Remove redundant gamepad events
    - Simplify consuming gamepad events.
    - Refactor: Separate handling of gamepad events into multiple systems.
    
    ## Solution
    
    - Removed `GamepadEventRaw`, and `GamepadEventType`.
    - Added bespoke `GamepadConnectionEvent`, `GamepadAxisChangedEvent`, and `GamepadButtonChangedEvent`. 
    - Refactored `gamepad_event_system`.
    - Added `gamepad_button_event_system`, `gamepad_axis_event_system`, and `gamepad_connection_system`, which update the `Input` and `Axis` resources using their corresponding event type.
    
    Gamepad events are now handled in their own systems and have their own types. 
    
    This allows for querying for gamepad events without having to match on `GamepadEventType` and makes creating handlers for specific gamepad event types, like a `GamepadConnectionEvent` or `GamepadButtonChangedEvent` possible.
    
    We remove `GamepadEventRaw` by filtering the gamepad events, using `GamepadSettings`, _at the source_, in `bevy_gilrs`. This way we can create `GamepadEvent`s directly and avoid creating `GamepadEventRaw` which do not pass the user defined filters. 
    
    We expose ordered `GamepadEvent`s and we can respond to individual gamepad event types.
    
    ## Migration Guide
    
    - Replace `GamepadEvent` and `GamepadEventRaw` types with their specific gamepad event type.
    DevinLeamy authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    32dac8a View commit details
    Browse the repository at this point in the history
  11. Separate Extract from Sub App Schedule (bevyengine#7046)

    # Objective
    
    - This pulls out some of the changes to Plugin setup and sub apps from bevyengine#6503 to make that PR easier to review.
    - Separate the extract stage from running the sub app's schedule to allow for them to be run on separate threads in the future
    - Fixes bevyengine#6990
    
    ## Solution
    
    - add a run method to `SubApp` that runs the schedule
    - change the name of `sub_app_runner` to extract to make it clear that this function is only for extracting data between the main app and the sub app
    - remove the extract stage from the sub app schedule so it can be run separately. This is done by adding a `setup` method to the `Plugin` trait that runs after all plugin build methods run. This is required to allow the extract stage to be removed from the schedule after all the plugins have added their systems to the stage. We will also need the setup method for pipelined rendering to setup the render thread. See https://github.com/bevyengine/bevy/blob/e3267965e15f14be18eec942dcaf16807144eb05/crates/bevy_render/src/pipelined_rendering.rs#L57-L98
    
    ## Changelog
    
    - Separate SubApp Extract stage from running the sub app schedule.
    
    ## Migration Guide
    
    ### SubApp `runner` has conceptually been changed to an `extract` function.
    
    The `runner` no longer is in charge of running the sub app schedule. It's only concern is now moving data between the main world and the sub app. The `sub_app.app.schedule` is now run for you after the provided function is called.
    
    ```rust
    // before
    fn main() {
        let sub_app = App::empty();
        sub_app.add_stage(MyStage, SystemStage::parallel());
        
        App::new().add_sub_app(MySubApp, sub_app, move |main_world, sub_app| {
            extract(app_world, render_app);
            render_app.app.schedule.run();
        });
    }
    
    // after
    fn main() {
            let sub_app = App::empty();
        sub_app.add_stage(MyStage, SystemStage::parallel());
        
        App::new().add_sub_app(MySubApp, sub_app, move |main_world, sub_app| {
            extract(app_world, render_app);
            // schedule is automatically called for you after extract is run
        });
    }
    ```
    hymm authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    45ee432 View commit details
    Browse the repository at this point in the history
  12. Reduce branching in TrackedRenderPass (bevyengine#7053)

    # Objective
    Speed up the render phase for rendering.
    
    ## Solution
     - Follow up bevyengine#6988 and make the internals of atomic IDs `NonZeroU32`. This niches the `Option`s of the IDs in draw state, which reduces the size and branching behavior when evaluating for equality.
     - Require `&RenderDevice` to get the device's `Limits` when initializing a `TrackedRenderPass` to preallocate the bind groups and vertex buffer state in `DrawState`, this removes the branch on needing to resize those `Vec`s.
    
    ## Performance
    This produces a similar speed up akin to that of bevyengine#6885. This shows an approximate 6% speed up in `main_opaque_pass_3d` on `many_foxes` (408.79 us -> 388us). This should be orthogonal to the gains seen there.
    
    ![image](https://user-images.githubusercontent.com/3137680/209906239-e430f026-63c2-4b95-957e-a2045b810d79.png)
    
    ---
    
    ## Changelog
    Added: `RenderContext::begin_tracked_render_pass`.
    Changed: `TrackedRenderPass` now requires a `&RenderDevice` on construction.
    Removed: `bevy_render::render_phase::DrawState`. It was not usable in any form outside of `bevy_render`.
    
    ## Migration Guide
    TODO
    james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    d823da0 View commit details
    Browse the repository at this point in the history
  13. reflect: add insert and remove methods to List (bevyengine#7063)

    # Objective
    
    - Fixes bevyengine#7061
    
    ## Solution
    
    - Add and implement `insert` and `remove` methods for `List`.
    
    ---
    
    ## Changelog
    
    - Added `insert` and `remove` methods to `List`.
    - Changed the `push` and `pop` methods on `List` to have default implementations.
    
    ## Migration Guide
    
    - Manual implementors of `List` need to implement the new methods `insert` and `remove` and 
    consider whether to use the new default implementation of `push` and `pop`.
    
    Co-authored-by: radiish <thesethskigamer@gmail.com>
    2 people authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    4343f2e View commit details
    Browse the repository at this point in the history
  14. Panic on dropping NonSend in non-origin thread. (bevyengine#6534)

    # Objective
    
    Fixes bevyengine#3310. Fixes bevyengine#6282. Fixes bevyengine#6278. Fixes bevyengine#3666.
    
    ## Solution
    Split out `!Send` resources into `NonSendResources`. Add a `origin_thread_id` to all `!Send` Resources, check it on dropping `NonSendResourceData`, if there's a mismatch, panic. Moved all of the checks that `MainThreadValidator` would do into `NonSendResources` instead.
    
    All `!Send` resources now individually track which thread they were inserted from. This is validated against for every access, mutation, and drop that could be done against the value. 
    
    A regression test using an altered version of the example from bevyengine#3310 has been added.
    
    This is a stopgap solution for the current status quo. A full solution may involve fully removing `!Send` resources/components from `World`, which will likely require a much more thorough design on how to handle the existing in-engine and ecosystem use cases.
    
    This PR also introduces another breaking change:
    
    ```rust
        use bevy_ecs::prelude::*;
    
        #[derive(Resource)]
        struct Resource(u32);
    
        fn main() {
            let mut world = World::new();
            world.insert_resource(Resource(1));
            world.insert_non_send_resource(Resource(2));
            let res = world.get_resource_mut::<Resource>().unwrap();
            assert_eq!(res.0, 2);
        }
    ```
    
    This code will run correctly on 0.9.1 but not with this PR, since NonSend resources and normal resources have become actual distinct concepts storage wise.
    
    ## Changelog
    Changed: Fix soundness bug with `World: Send`. Dropping a `World` that contains a `!Send` resource on the wrong thread will now panic.
    
    ## Migration Guide
    Normal resources and `NonSend` resources no longer share the same backing storage. If `R: Resource`, then `NonSend<R>` and `Res<R>` will return different instances from each other. If you are using both `Res<T>` and `NonSend<T>` (or their mutable variants), to fetch the same resources, it's strongly advised to use `Res<T>`.
    james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    845b956 View commit details
    Browse the repository at this point in the history
  15. Relax Sync bound on Local<T> as ExclusiveSystemParam (bevyengine#…

    …7040)
    
    # Objective
    
    The type `Local<T>` unnecessarily has the bound `T: Sync` when the local is used in an exclusive system.
    
    ## Solution
    
    Lift the bound.
    
    ---
    
    ## Changelog
    
    Removed the bound `T: Sync` from `Local<T>` when used as an `ExclusiveSystemParam`.
    JoJoJet authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    a151fbf View commit details
    Browse the repository at this point in the history
  16. add rust-version for MSRV and CI job to check (bevyengine#6852)

    # Objective
    
    - Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518
    - Help avoid confusing error message when using an older version of Rust
    
    ## Solution
    
    - Add the `rust-version` field to `Cargo.toml`
    - Add a CI job checking the MSRV
    - Add the job to bors
    mockersf authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    1ad542a View commit details
    Browse the repository at this point in the history
  17. Implement SparseSetIndex for WorldId (bevyengine#7125)

    # Objective
    
    - Fixes bevyengine#7124
    
    ## Solution
    
    - Add Hash Derive on `WorldId`
    - Add `SparseSetIndex` impl
    2ne1ugly authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    dc857c0 View commit details
    Browse the repository at this point in the history
  18. Fix doc in App::add_sub_app (bevyengine#7139)

    # Objective
    
    - Fix the name of function parameter name in docs
    
    ## Solution
    
    - Change `f` to `sub_app_runner`
    
    ---
    
    It confused me a bit when I was reading the docs in the autocomplete hint.
    Hesitated about filing a PR since it's just a one single word change in the comment.
    Is this the right process to change these docs?
    2ne1ugly authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    6c4acf9 View commit details
    Browse the repository at this point in the history
  19. Fix overflow scaling for images (bevyengine#7142)

    # Objective
    
    - Fixes bevyengine#4057 
    - Do not multiply position by scale factor
    mockersf authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    1246fdf View commit details
    Browse the repository at this point in the history
  20. Add TypeRegistrationDeserializer and remove BorrowedStr (bevyengi…

    …ne#7094)
    
    # Objective
    
    This a follow-up to bevyengine#6894, see bevyengine#6894 (comment)
    
    The goal is to avoid cloning any string when getting a `&TypeRegistration` corresponding to a string which is being deserialized. As a bonus code duplication is also reduced.
    
    ## Solution
    
    The manual deserialization of a string and lookup into the type registry has been moved into a separate `TypeRegistrationDeserializer` type, which implements `DeserializeSeed` with a `Visitor` that accepts any string with `visit_str`, even ones that may not live longer than that function call.
    `BorrowedStr` has been removed since it's no longer used.
    
    ---
    
    ## Changelog
    
    - The type `TypeRegistrationDeserializer` has been added, which simplifies getting a `&TypeRegistration` while deserializing a string.
    SkiFire13 authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    5cda426 View commit details
    Browse the repository at this point in the history
  21. Add Mut::reborrow (bevyengine#7114)

    # Objective
    
    - In some cases, you need a `Mut<T>` pointer, but you only have a mutable reference to one. There is no easy way of converting `&'a mut Mut<'_, T>` -> `Mut<'a, T>` outside of the engine.
    
    ### Example (Before)
    
    ```rust
    fn do_with_mut<T>(val: Mut<T>) { ... }
    
    for x: Mut<T> in &mut query {
        // The function expects a `Mut<T>`, so `x` gets moved here.
        do_with_mut(x);
        // Error: use of moved value.
        do_a_thing(&x);
    }
    ```
    
    ## Solution
    
    - Add the function `reborrow`, which performs the mapping. This is analogous to `PtrMut::reborrow`.
    
    ### Example (After)
    
    ```rust
    fn do_with_mut<T>(val: Mut<T>) { ... }
    
    for x: Mut<T> in &mut query {
        // We reborrow `x`, so the original does not get moved.
        do_with_mut(x.reborrow());
        // Works fine.
        do_a_thing(&x);
    }
    ```
    
    ---
    
    ## Changelog
    
    - Added the method `reborrow` to `Mut`, `ResMut`, `NonSendMut`, and `MutUntyped`.
    JoJoJet authored and james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    b7f1421 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    0ae7f77 View commit details
    Browse the repository at this point in the history
  23. Fix build

    james7132 committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    1029b0b View commit details
    Browse the repository at this point in the history