Skip to content

Commit cfc56cc

Browse files
committed
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
1 parent 8b7ebe1 commit cfc56cc

File tree

1 file changed

+2
-0
lines changed
  • crates/bevy_pbr/src/render

1 file changed

+2
-0
lines changed

crates/bevy_pbr/src/render/fog.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ pub fn prepare_fog(
5353
mut fog_meta: ResMut<FogMeta>,
5454
views: Query<(Entity, Option<&FogSettings>), With<ExtractedView>>,
5555
) {
56+
fog_meta.gpu_fogs.clear();
57+
5658
for (entity, fog) in &views {
5759
let gpu_fog = if let Some(fog) = fog {
5860
match &fog.falloff {

0 commit comments

Comments
 (0)