Skip to content

Commit

Permalink
screenshot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Apr 19, 2023
1 parent ca8218f commit f2a6d6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/bevy_render/src/view/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ impl Plugin for WindowRenderPlugin {
render_app
.init_resource::<ExtractedWindows>()
.init_resource::<WindowSurfaces>()
.init_resource::<ScreenshotToScreenPipeline>()
.init_non_send_resource::<NonSendMarker>()
.add_systems(ExtractSchedule, extract_windows)
.configure_set(Render, WindowSystem::Prepare.in_set(RenderSet::Prepare))
.add_systems(Render, prepare_windows.in_set(WindowSystem::Prepare));
}
}

fn finish(&self, app: &mut App) {
if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {
render_app.init_resource::<ScreenshotToScreenPipeline>();
}
}
}

pub struct ExtractedWindow {
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_render/src/view/window/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ impl Plugin for ScreenshotPlugin {
"screenshot.wgsl",
Shader::from_wgsl
);
}

fn finish(&self, app: &mut bevy_app::App) {
if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {
render_app.init_resource::<SpecializedRenderPipelines<ScreenshotToScreenPipeline>>();
}
Expand Down

0 comments on commit f2a6d6e

Please sign in to comment.