Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MSAA writeback when 3 or more cameras have the same target. (bevy…
…engine#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.
- Loading branch information