bevy/crates/bevy_app/src
andriyDev 2c6cf9a597
Run RenderStartup in/before extract instead of after it. (#19926)
# Objective

- Fixes #19910.

## Solution

- First, allow extraction function to be FnMut instead of Fn. FnMut is a
superset of Fn anyway, and we only ever call this function once at a
time (we would never call this in parallel for different pairs of worlds
or something).
- Run the `RenderStartup` schedule in the extract function with a flag
to only do it once.
- Remove all the `MainRender` stuff.

One sad part here is that now the `RenderStartup` blocks extraction. So
for pipelined rendering, our simulation will be blocked on the first
frame while we set up all the rendering resources. I don't see this as a
big loss though since A) that is fundamentally what we want here -
extraction **has to** run after `RenderStartup`, and the only way to do
better is to somehow run `RenderStartup` in parallel with the first
simulation frame, and B) without `RenderStartup` the **entire** app was
blocked on initializing render resources during Plugin construction - so
we're not really losing anything here.

## Testing

- I ran the `custom_post_processing` example (which was ported to use
`RenderStartup` in #19886) and it still works.
2025-07-07 01:31:40 +00:00
..
app.rs Rename num_entities to entity_count (#19781) 2025-06-23 05:08:02 +00:00
hotpatch.rs Hot patching systems with subsecond (#19309) 2025-06-03 21:12:38 +00:00
lib.rs generic component propagation (#17575) 2025-06-06 00:02:02 +00:00
main_schedule.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
panic_handler.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
plugin_group.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
plugin.rs Update downcast-rs to version 2 (#17223) 2025-01-07 21:33:40 +00:00
propagate.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
schedule_runner.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
sub_app.rs Run RenderStartup in/before extract instead of after it. (#19926) 2025-07-07 01:31:40 +00:00
task_pool_plugin.rs Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
terminal_ctrl_c_handler.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00