summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-28 13:22:23 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-28 13:22:23 +0100
commit7b18bf7bbd82a58980aae46a33c1238f25dad708 (patch)
treeef13c4d6c40951fbe53a0b6ec8ba90ff71ffc786 /scene
parent166066d9f74e574b68d9f9d0ba05bf42b8de2131 (diff)
parentd50a2e1e51cd54a5365d0e55bb9e8e5fc0b6e37d (diff)
Merge pull request #69286 from dzil123/add_null_check_bake_step_function
GPUParticlesCollisionSDF3D add null `bake_step_function` check
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/gpu_particles_collision_3d.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp
index 2c5df48b75..476820b1c4 100644
--- a/scene/3d/gpu_particles_collision_3d.cpp
+++ b/scene/3d/gpu_particles_collision_3d.cpp
@@ -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);
}