From a404eb2acfadf48f6b4cae54be0c9a51fd7d1533 Mon Sep 17 00:00:00 2001 From: Yoh Deadfall Date: Mon, 7 Jun 2021 19:02:02 +0000 Subject: [PATCH] Removed redundant visibility check (#2311) Since `visible_entities_system` already checks `Visiblie::is_visible` for each entity and requires it to be `true`, there's no reason to verify visibility in `PassNode::prepare` which consumes entities produced by the system. --- crates/bevy_render/src/render_graph/nodes/pass_node.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/bevy_render/src/render_graph/nodes/pass_node.rs b/crates/bevy_render/src/render_graph/nodes/pass_node.rs index 4f211a535c..cf0962a13a 100644 --- a/crates/bevy_render/src/render_graph/nodes/pass_node.rs +++ b/crates/bevy_render/src/render_graph/nodes/pass_node.rs @@ -3,7 +3,6 @@ use crate::{ draw::{Draw, RenderCommand}, pass::{ClearColor, LoadOp, PassDescriptor, TextureAttachment}, pipeline::{IndexFormat, PipelineDescriptor}, - prelude::Visible, render_graph::{Node, ResourceSlotInfo, ResourceSlots}, renderer::{ BindGroupId, BufferId, RenderContext, RenderResourceBindings, RenderResourceContext, @@ -160,11 +159,6 @@ where continue; }; - if let Some(visible) = world.get::(visible_entity.entity) { - if !visible.is_visible { - continue; - } - } for render_command in draw.render_commands.iter() { commands.push(render_command.clone()); // whenever a new pipeline is set, ensure the relevant camera bind groups