bevy/crates/bevy_render
Robin KAY dc25edd0a2
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-20 22:16:28 +00:00
..
macros Release 0.13.0 (#11920) 2024-02-17 09:24:25 +00:00
src Fix MSAA writeback when 3 or more cameras have the same target. (#11968) 2024-02-20 22:16:28 +00:00
Cargo.toml Add the serde feature to bitflags for bevy_render. (#11966) 2024-02-19 00:37:34 +00:00