Repository: bevyengine/bevy
File: crates/bevy_pbr/src/ssao/mod.rs (Rust)

Code before:
            preprocess_depth_pass.dispatch_workgroups(
                camera_size.x.div_ceil(16),
                camera_size.y.div_ceil(16),
                1,
            );
        }

        {
            let mut ssao_pass = command_encoder.begin_compute_pass(&ComputePassDescriptor {
                label: Some("ssao_ssao_pass"),
                timestamp_writes: None,
            });
            ssao_pass.set_pipeline(ssao_pipeline);
            ssao_pass.set_bind_group(0, &bind_groups.ssao_bind_group, &[]);
            ssao_pass.set_bind_group(
                1,
                &bind_groups.common_bind_group,
                &[view_uniform_offset.offset],
            );
            ssao_pass.dispatch_workgroups(camera_size.x.div_ceil(8), camera_size.y.div_ceil(8), 1);
        }

        {
            let mut spatial_denoise_pass =
                command_encoder.begin_compute_pass(&ComputePassDescriptor {
                    label: Some("ssao_spatial_denoise_pass"),
                    timestamp_writes: None,
                });
            spatial_denoise_pass.set_pipeline(spatial_denoise_pipeline);
            spatial_denoise_pass.set_bind_group(0, &bind_groups.spatial_denoise_bind_group, &[]);
            spatial_denoise_pass.set_bind_group(
                1,
                &bind_groups.common_bind_group,
                &[view_uniform_offset.offset],
            );
            spatial_denoise_pass.dispatch_workgroups(
                camera_size.x.div_ceil(8),
                camera_size.y.div_ceil(8),
                1,
            );
        }

        time_span.end(command_encoder);
        command_encoder.pop_debug_group();
        Ok(())
    }
}

#[derive(Resource)]
struct SsaoPipelines {
    preprocess_depth_pipeline: CachedComputePipelineId,

Review comment (suggestion):
```suggestion
                    label: Some("ssao_spatial_denoise"),
```

Code after:
            preprocess_depth_pass.dispatch_workgroups(
                camera_size.x.div_ceil(16),
                camera_size.y.div_ceil(16),
                1,
            );
        }

        {
            let mut ssao_pass = command_encoder.begin_compute_pass(&ComputePassDescriptor {
                label: Some("ssao"),
                timestamp_writes: None,
            });
            ssao_pass.set_pipeline(ssao_pipeline);
            ssao_pass.set_bind_group(0, &bind_groups.ssao_bind_group, &[]);
            ssao_pass.set_bind_group(
                1,
                &bind_groups.common_bind_group,
                &[view_uniform_offset.offset],
            );
            ssao_pass.dispatch_workgroups(camera_size.x.div_ceil(8), camera_size.y.div_ceil(8), 1);
        }

        {
            let mut spatial_denoise_pass =
                command_encoder.begin_compute_pass(&ComputePassDescriptor {
                    label: Some("ssao_spatial_denoise"),
                    timestamp_writes: None,
                });
            spatial_denoise_pass.set_pipeline(spatial_denoise_pipeline);
            spatial_denoise_pass.set_bind_group(0, &bind_groups.spatial_denoise_bind_group, &[]);
            spatial_denoise_pass.set_bind_group(
                1,
                &bind_groups.common_bind_group,
                &[view_uniform_offset.offset],
            );
            spatial_denoise_pass.dispatch_workgroups(
                camera_size.x.div_ceil(8),
                camera_size.y.div_ceil(8),
                1,
            );
        }

        time_span.end(command_encoder);
        command_encoder.pop_debug_group();
        Ok(())
    }
}

#[derive(Resource)]
struct SsaoPipelines {
    preprocess_depth_pipeline: CachedComputePipelineId,