Skip to content

[Merged by Bors] - Allow minimising in 2d #4527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions crates/bevy_core_pipeline/src/main_pass_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ impl Node for MainPass2dNode {
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
let (transparent_phase, target) = self
.query
.get_manual(world, view_entity)
.expect("view entity should exist");
// If there is no view entity, do not try to process the render phase for the view
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
Ok(it) => it,
_ => return Ok(()),
};

if transparent_phase.items.is_empty() {
return Ok(());
Expand Down
11 changes: 6 additions & 5 deletions crates/bevy_ui/src/render/render_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ impl Node for UiPassNode {
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
let (transparent_phase, target) = self
.query
.get_manual(world, view_entity)
.expect("view entity should exist");

// If there is no view entity, do not try to process the render phase for the view
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
Ok(it) => it,
_ => return Ok(()),
};

if transparent_phase.items.is_empty() {
return Ok(());
}

let pass_descriptor = RenderPassDescriptor {
label: Some("ui_pass"),
color_attachments: &[RenderPassColorAttachment {
Expand Down