Allow minimising in 2d (#4527)
# Objective - We can't minimise if there's a 2d camera because ??? there legally must be a 2d target. - Fixes https://github.com/bevyengine/bevy/issues/4526 - Fixes https://github.com/bevyengine/bevy/issues/4856 ## Solution - Make it not crash in those cases, just do nothing - Seems to work ¯\\_(ツ)_/¯ - See also the companion commit in https://github.com/bevyengine/bevy/pull/3597 - 503c24717321bb2bb2681b358020ad1bcbef510e Co-authored-by: Asteria <asteria131@outlook.com>
This commit is contained in:
parent
60584139de
commit
09a3d8abe0
@ -39,10 +39,11 @@ impl Node for MainPass2dNode {
|
|||||||
world: &World,
|
world: &World,
|
||||||
) -> Result<(), NodeRunError> {
|
) -> Result<(), NodeRunError> {
|
||||||
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
|
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
|
||||||
let (transparent_phase, target) = self
|
// If there is no view entity, do not try to process the render phase for the view
|
||||||
.query
|
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
|
||||||
.get_manual(world, view_entity)
|
Ok(it) => it,
|
||||||
.expect("view entity should exist");
|
_ => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
if transparent_phase.items.is_empty() {
|
if transparent_phase.items.is_empty() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@ -66,15 +66,16 @@ impl Node for UiPassNode {
|
|||||||
world: &World,
|
world: &World,
|
||||||
) -> Result<(), NodeRunError> {
|
) -> Result<(), NodeRunError> {
|
||||||
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
|
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
|
||||||
let (transparent_phase, target) = self
|
|
||||||
.query
|
// If there is no view entity, do not try to process the render phase for the view
|
||||||
.get_manual(world, view_entity)
|
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
|
||||||
.expect("view entity should exist");
|
Ok(it) => it,
|
||||||
|
_ => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
if transparent_phase.items.is_empty() {
|
if transparent_phase.items.is_empty() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
let pass_descriptor = RenderPassDescriptor {
|
let pass_descriptor = RenderPassDescriptor {
|
||||||
label: Some("ui_pass"),
|
label: Some("ui_pass"),
|
||||||
color_attachments: &[RenderPassColorAttachment {
|
color_attachments: &[RenderPassColorAttachment {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user