From bce19c101209254efc22d4ed86275936cfed96b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Sat, 16 Nov 2024 21:39:13 +0100 Subject: [PATCH] remove ViewUniformOffset from inactive cameras (#16399) # Objective - Fixes #16285 - Inactive camera are keeping the component `ViewUniformOffset` from when they were active, still matching some queries trying to render to them ## Solution - Remove component `ViewUniformOffset` from cameras that are inactive ## Testing - Ran example `render_primitives` and switched camera --- crates/bevy_render/src/camera/camera.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs index d6d2d869d3..689734c4fb 100644 --- a/crates/bevy_render/src/camera/camera.rs +++ b/crates/bevy_render/src/camera/camera.rs @@ -1,6 +1,4 @@ use super::{ClearColorConfig, Projection}; -use crate::sync_world::TemporaryRenderEntity; -use crate::view::RenderVisibleEntities; use crate::{ batching::gpu_preprocessing::GpuPreprocessingSupport, camera::{CameraProjection, ManualTextureViewHandle, ManualTextureViews}, @@ -8,11 +6,12 @@ use crate::{ render_asset::RenderAssets, render_graph::{InternedRenderSubGraph, RenderSubGraph}, render_resource::TextureView, + sync_world::TemporaryRenderEntity, sync_world::{RenderEntity, SyncToRenderWorld}, texture::GpuImage, view::{ - ColorGrading, ExtractedView, ExtractedWindows, GpuCulling, Msaa, RenderLayers, Visibility, - VisibleEntities, + ColorGrading, ExtractedView, ExtractedWindows, GpuCulling, Msaa, RenderLayers, + RenderVisibleEntities, ViewUniformOffset, Visibility, VisibleEntities, }, Extract, }; @@ -1065,6 +1064,7 @@ pub fn extract_cameras( RenderLayers, Projection, GpuCulling, + ViewUniformOffset, )>(); continue; }