bevy/crates/bevy_render/src
Cameron 01649f13e2
Refactor App and SubApp internals for better separation (#9202)
# Objective

This is a necessary precursor to #9122 (this was split from that PR to
reduce the amount of code to review all at once).

Moving `!Send` resource ownership to `App` will make it unambiguously
`!Send`. `SubApp` must be `Send`, so it can't wrap `App`.

## Solution

Refactor `App` and `SubApp` to not have a recursive relationship. Since
`SubApp` no longer wraps `App`, once `!Send` resources are moved out of
`World` and into `App`, `SubApp` will become unambiguously `Send`.

There could be less code duplication between `App` and `SubApp`, but
that would break `App` method chaining.

## Changelog

- `SubApp` no longer wraps `App`.
- `App` fields are no longer publicly accessible.
- `App` can no longer be converted into a `SubApp`.
- Various methods now return references to a `SubApp` instead of an
`App`.
## Migration Guide

- To construct a sub-app, use `SubApp::new()`. `App` can no longer
convert into `SubApp`.
- If you implemented a trait for `App`, you may want to implement it for
`SubApp` as well.
- If you're accessing `app.world` directly, you now have to use
`app.world()` and `app.world_mut()`.
- `App::sub_app` now returns `&SubApp`.
- `App::sub_app_mut`  now returns `&mut SubApp`.
- `App::get_sub_app` now returns `Option<&SubApp>.`
- `App::get_sub_app_mut` now returns `Option<&mut SubApp>.`
2024-03-31 03:16:10 +00:00
..
batching Improve performance by binning together opaque items instead of sorting them. (#12453) 2024-03-30 02:55:02 +00:00
camera Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
diagnostic Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
mesh Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
primitives Reflect default in some types on bevy_render (#12580) 2024-03-19 22:50:17 +00:00
render_graph Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_phase Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_resource Improve performance by binning together opaque items instead of sorting them. (#12453) 2024-03-30 02:55:02 +00:00
renderer Get Bevy building for WebAssembly with multithreading (#12205) 2024-03-25 19:10:18 +00:00
texture Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
view Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
alpha.rs Move AlphaMode into bevy_render (#12012) 2024-02-21 19:34:10 +00:00
deterministic.rs Option to enable deterministic rendering (#11248) 2024-01-09 00:46:01 +00:00
extract_component.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
extract_instances.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
extract_param.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
extract_resource.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
globals.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
lib.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
maths.wgsl Add support for KHR_texture_transform (#11904) 2024-02-21 01:11:28 +00:00
pipelined_rendering.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_asset.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
settings.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
spatial_bundle.rs Implement Clone for VisibilityBundle and SpatialBundle (#10394) 2023-11-07 21:25:00 +00:00