mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
bevy_pbr: Clear fog DynamicUniformBuffer before populating each frame (#7432)
# Objective - Fix a bug causing performance to drop over time because the GPU fog buffer was endlessly growing ## Solution - Clear the fog buffer every frame before populating it
This commit is contained in:
parent
8b7ebe1738
commit
cfc56cca2f
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,8 @@ pub fn prepare_fog(
|
|||
mut fog_meta: ResMut<FogMeta>,
|
||||
views: Query<(Entity, Option<&FogSettings>), With<ExtractedView>>,
|
||||
) {
|
||||
fog_meta.gpu_fogs.clear();
|
||||
|
||||
for (entity, fog) in &views {
|
||||
let gpu_fog = if let Some(fog) = fog {
|
||||
match &fog.falloff {
|
||||
|
|
Loading…
Reference in a new issue