System Lifecycle Rework: all Systems are initialized by definition#2777
System Lifecycle Rework: all Systems are initialized by definition#2777cart wants to merge 1 commit intobevyengine:mainfrom
Conversation
|
This touches a lot of stuff and most of it is just noise. The most relevant changes are in function_system.rs, the System trait, system descriptors, and the executor. |
I'd prefer not to do this. The standalone They also tend to care about compile sizes and dependencies in ways that other Bevy users don't. |
| } | ||
| } | ||
|
|
||
| impl IntoSystem<(), ShouldRun, ()> for FixedTimestep { |
There was a problem hiding this comment.
I love the reduced boilerplate needed here.
| } | ||
|
|
||
| // TODO: This impl could result in multi-boxed systems, but it also enables things like the new FixedTimestep impl | ||
| // maybe fine generally? who boxes their systems on insert? |
There was a problem hiding this comment.
Yeah, that seems like a weirdly pathological thing for users to do.
| let mut shaders = world.get_resource_mut::<Assets<Shader>>().unwrap(); | ||
| let mut active_cameras = world.get_resource_mut::<ActiveCameras>().unwrap(); | ||
| let msaa = world.get_resource::<Msaa>().unwrap(); | ||
| world.resource_scope(|world, mut graph: Mut<RenderGraph>| { |
There was a problem hiding this comment.
Deeply nested resource_scope's seems a bit suspicious. Is this driven by the other changes in this PR?
There was a problem hiding this comment.
This was the "quick and dirty" solution I called out in the description. The better fix would be to adapt the Render Graph to account for the System lifecycle, but thats more work than I wanted to invest in a proof of concept.
# Objective - Fix the ugliness of the `config` api. - Supercedes bevyengine#2440, bevyengine#2463, bevyengine#2491 ## Solution - Since bevyengine#2398, capturing closure systems have worked. - Use those instead where we needed config before - Remove the rest of the config api. - Related: bevyengine#2777
|
Worth considering but this is way out of date and would need significant reworks at this point. |
Note: This is just very rough experimentation. I (currently) have no intention to move this forward as-is ... I just created it because people are discussing reworking system descriptors and scheduling right now and this change is something that relates / that I've been wanting to explore for awhile.
This does the following:
The things this accomplishes:
This comes at the cost of: