bevy/crates/bevy_render/src
Robin KAY 152ee42a72 Fix MSAA writeback when 3 or more cameras have the same target. (#11968)
# Objective

If multiple cameras render to the same target with MSAA enabled, only
the first and the last camera output will appear in the final output*.
This is because each camera maintains a separate flag to track the
active main texture. The first camera renders to texture A and all
subsequent cameras first write-back from A and then render into texture
B. Hence, camera 3 onwards will overwrite the work of the previous
camera.

\* This would manifest slightly differently if there were other calls to
post_process_write() in a more complex setup.

The is a functional regression from Bevy 0.12.

## Solution

The flag which tracks the active main texture should be shared between
cameras with the same `NormalizedRenderTarget`. Add the
`Arc<AtomicUsize>` to the existing per-target cache.
2024-02-27 17:11:42 +01:00
..
batching optimize batch_and_prepare_render_phase (#11323) 2024-01-20 09:30:44 +00:00
camera Derive Reflect for Exposure (#11907) 2024-02-16 19:03:46 +00:00
color Replace deprecated elements (#10991) 2023-12-16 02:25:12 +00:00
mesh Add Mesh::merge (#11456) 2024-02-12 22:04:33 +00:00
primitives Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
render_graph Rename Core Render Graph Labels (#11882) 2024-02-15 23:15:16 +00:00
render_phase Stop extracting mesh entities to the render world. (#11803) 2024-02-10 10:46:10 +00:00
render_resource Add configuration for async pipeline creation on RenderPlugin (#11847) 2024-02-16 13:35:47 +00:00
renderer Multithreaded render command encoding (#9172) 2024-02-09 07:35:35 +00:00
texture Support optional clear color in ColorAttachment. (#11884) 2024-02-16 13:25:55 +00:00
view Fix MSAA writeback when 3 or more cameras have the same target. (#11968) 2024-02-27 17:11:42 +01:00
deterministic.rs Option to enable deterministic rendering (#11248) 2024-01-09 00:46:01 +00:00
extract_component.rs Revert rendering-related associated type name changes (#11027) 2024-01-22 15:01:55 +00:00
extract_instances.rs Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
extract_param.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
extract_resource.rs Use warn_once where relevant instead of manually implementing a single warn check (#11693) 2024-02-05 21:05:43 +00:00
globals.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
lib.rs Add configuration for async pipeline creation on RenderPlugin (#11847) 2024-02-16 13:35:47 +00:00
maths.wgsl Use instancing for sprites (#9597) 2023-09-02 18:03:19 +00:00
pipelined_rendering.rs wait for render app when main world is dropped (#11737) 2024-02-08 14:09:17 +00:00
render_asset.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
settings.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
spatial_bundle.rs Implement Clone for VisibilityBundle and SpatialBundle (#10394) 2023-11-07 21:25:00 +00:00