From 994312ac6d066276014e89df8e657a0dacf90d81 Mon Sep 17 00:00:00 2001 From: charlotte Date: Wed, 7 Aug 2024 16:59:38 -0700 Subject: [PATCH] Fix TAA on camera with viewport (#14582) # Objective Closes #14526 ## Solution The history texture was being created incorrectly with the viewport size rather than target size. When viewport < target, this meant that the render attachments would differer in size which causes a wgpu validation error. ## Testing Example in linked issue works. --- crates/bevy_core_pipeline/src/taa/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_core_pipeline/src/taa/mod.rs b/crates/bevy_core_pipeline/src/taa/mod.rs index 4edb6cb60f..4a78af178e 100644 --- a/crates/bevy_core_pipeline/src/taa/mod.rs +++ b/crates/bevy_core_pipeline/src/taa/mod.rs @@ -410,13 +410,13 @@ fn prepare_taa_history_textures( views: Query<(Entity, &ExtractedCamera, &ExtractedView), With>, ) { for (entity, camera, view) in &views { - if let Some(physical_viewport_size) = camera.physical_viewport_size { + if let Some(physical_target_size) = camera.physical_target_size { let mut texture_descriptor = TextureDescriptor { label: None, size: Extent3d { depth_or_array_layers: 1, - width: physical_viewport_size.x, - height: physical_viewport_size.y, + width: physical_target_size.x, + height: physical_target_size.y, }, mip_level_count: 1, sample_count: 1,