Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description for rendering/limits/spatial_indexer/threaded_cull_minimum_instances #86246

Merged

Conversation

ecmjohnson
Copy link
Contributor

Adds a description for the property rendering/limits/spatial_indexer/threaded_cull_minimum_instances based on my reading of its use in renderer_scene_cull.cpp.

Accessing:

thread_cull_threshold = GLOBAL_GET("rendering/limits/spatial_indexer/threaded_cull_minimum_instances");

Using:

if (visibility_cull_data.cull_count > thread_cull_threshold) {
WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &RendererSceneCull::_visibility_cull_threaded, &visibility_cull_data, WorkerThreadPool::get_singleton()->get_thread_count(), -1, true, SNAME("VisibilityCullInstances"));
WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task);
} else {
_visibility_cull(visibility_cull_data, visibility_cull_data.cull_offset, visibility_cull_data.cull_offset + visibility_cull_data.cull_count);
}

if (cull_to > thread_cull_threshold) {
//multiple threads
for (InstanceCullResult &thread : scene_cull_result_threads) {
thread.clear();
}
WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &RendererSceneCull::_scene_cull_threaded, &cull_data, scene_cull_result_threads.size(), -1, true, SNAME("RenderCullInstances"));
WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task);
for (InstanceCullResult &thread : scene_cull_result_threads) {
scene_cull_result.append_from(thread);
}
} else {
//single threaded
_scene_cull(cull_data, scene_cull_result, cull_from, cull_to);
}

@ecmjohnson ecmjohnson requested a review from a team as a code owner December 17, 2023 00:05
@AThousandShips AThousandShips added enhancement documentation cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Dec 17, 2023
@AThousandShips AThousandShips added this to the 4.3 milestone Dec 17, 2023
@ecmjohnson ecmjohnson force-pushed the doc-threaded_cull_minimum_instances branch from 53f2030 to 498f460 Compare January 16, 2024 00:41
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@YuriSizov YuriSizov changed the title Add descpription for rendering/limits/spatial_indexer/threaded_cull_minimum_instances Add description for rendering/limits/spatial_indexer/threaded_cull_minimum_instances Jan 17, 2024
@YuriSizov YuriSizov merged commit 1169b87 into godotengine:master Jan 17, 2024
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Jan 24, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jan 24, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.4.

@ecmjohnson ecmjohnson deleted the doc-threaded_cull_minimum_instances branch May 19, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants