Skip to content

Commit

Permalink
Merge pull request godotengine#69286 from dzil123/add_null_check_bake…
Browse files Browse the repository at this point in the history
…_step_function

GPUParticlesCollisionSDF3D add null `bake_step_function` check
  • Loading branch information
akien-mga committed Nov 28, 2022
2 parents 166066d + d50a2e1 commit 7b18bf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scene/3d/gpu_particles_collision_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ void GPUParticlesCollisionSDF3D::_compute_sdf(ComputeSDFParams *params) {
WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &GPUParticlesCollisionSDF3D::_compute_sdf_z, params, params->size.z);
while (!WorkerThreadPool::get_singleton()->is_group_task_completed(group_task)) {
OS::get_singleton()->delay_usec(10000);
bake_step_function(WorkerThreadPool::get_singleton()->get_group_processed_element_count(group_task) * 100 / params->size.z, "Baking SDF");
if (bake_step_function) {
bake_step_function(WorkerThreadPool::get_singleton()->get_group_processed_element_count(group_task) * 100 / params->size.z, "Baking SDF");
}
}
WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task);
}
Expand Down

0 comments on commit 7b18bf7

Please sign in to comment.