Sub app has Extract as a system param for fetching info from the main world through the sub app, but I'm not sure how to get info from a SubApp back into the main world through a system in the main app. E.G:
I want to reflect PipelineCache's Vec<RenderPipelineDescriptor> from the RenderApp's world, into my main app's world. But, I'm not sure how to do it.
This is what I've tried.
#[derive(Resource, Default)]
pub struct RenderPipelineDescriptors(pub Vec<RenderPipelineDescriptor>);
/// copy's render world render pipelines into mainworld pipeline holder for inspection.
pub fn update_reflected_pipelines(
render_world: &mut World,
mut main_world: World,
) {
let Some(pipeline_cache) = render_world.get_resource::<PipelineCache>() else {return;};
let descriptors = RenderPipelineDescriptors(
pipeline_cache
.pipelines()
.filter_map(|pipeline| match &pipeline.descriptor {
PipelineDescriptor::RenderPipelineDescriptor(non_compute_pipeline) =>
Some(
*(*non_compute_pipeline).clone()
),
PipelineDescriptor::ComputePipelineDescriptor(_) => None,
})
.collect::<Vec<_>>()
);
main_world.insert_resource(descriptors);
}
... in main app
let render_app = app.get_sub_app(RenderApp).unwrap();
let mut app_world = app.world;
app
.add_systems(Update, update_reflected_pipelines(&render_app.world, app.world))
however, I get the error:
the trait bound `(): IntoSystem<(), (), _>` is not satisfied
the following other types implement trait `IntoSystemConfigs<Marker>`:
Ideas?