Move initializing the ScreenshotToScreenPipeline to the ScreenshotPlugin. (#18524)

# Objective

- Minor cleanup.
- This seems to have been introduced in #8336. There is no discussion
about it I can see, there's no comment explaining why this is here and
not in `ScreenshotPlugin`. This seems to have just been misplaced.

## Solution

- Move this to the ScreenshotPlugin!

## Testing

- The screenshot example still works at least on desktop.
This commit is contained in:
andriyDev 2025-05-05 16:56:22 -07:00 committed by GitHub
parent f6543502b4
commit 798e1c5498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -21,7 +21,7 @@ use wgpu::{
pub mod screenshot;
use screenshot::{ScreenshotPlugin, ScreenshotToScreenPipeline};
use screenshot::ScreenshotPlugin;
pub struct WindowRenderPlugin;
@ -43,12 +43,6 @@ impl Plugin for WindowRenderPlugin {
.add_systems(Render, prepare_windows.in_set(RenderSet::ManageViews));
}
}
fn finish(&self, app: &mut App) {
if let Some(render_app) = app.get_sub_app_mut(RenderApp) {
render_app.init_resource::<ScreenshotToScreenPipeline>();
}
}
}
pub struct ExtractedWindow {

View File

@ -425,6 +425,7 @@ impl Plugin for ScreenshotPlugin {
.init_resource::<RenderScreenshotTargets>()
.init_resource::<RenderScreenshotsPrepared>()
.init_resource::<SpecializedRenderPipelines<ScreenshotToScreenPipeline>>()
.init_resource::<ScreenshotToScreenPipeline>()
.add_systems(ExtractSchedule, extract_screenshots.ambiguous_with_all())
.add_systems(
Render,