1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Remove RID_Owner.get_rid_by_index

* Implementing this function efficiently is not really possible.
* Replaced by an option to get all RIDs into a buffer for performance.
This commit is contained in:
reduz
2022-02-05 11:59:34 +01:00
parent df1724470d
commit 74adf0bf2e
2 changed files with 31 additions and 47 deletions

View File

@@ -3871,8 +3871,12 @@ void RendererSceneCull::update_dirty_instances() {
void RendererSceneCull::update() {
//optimize bvhs
for (uint32_t i = 0; i < scenario_owner.get_rid_count(); i++) {
Scenario *s = scenario_owner.get_ptr_by_index(i);
uint32_t rid_count = scenario_owner.get_rid_count();
RID *rids = (RID *)alloca(sizeof(RID) * rid_count);
scenario_owner.fill_owned_buffer(rids);
for (uint32_t i = 0; i < rid_count; i++) {
Scenario *s = scenario_owner.get_or_null(rids[i]);
s->indexers[Scenario::INDEXER_GEOMETRY].optimize_incremental(indexer_update_iterations);
s->indexers[Scenario::INDEXER_VOLUMES].optimize_incremental(indexer_update_iterations);
}