Skip to content

Commit

Permalink
fixed update of stats for empty instance storages.
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySalnikov committed Dec 15, 2023
1 parent f7f7488 commit f46527a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples_dd3d/DebugDrawDemoScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ func _on_Button_pressed() -> void:
process_priority = 1
script = ExtResource("1")
custom_font = ExtResource("2_aedbq")
update_in_physics = true
draw_array_of_boxes = true
text_groups_show_stats = true
text_groups_position = 2
Expand Down
7 changes: 7 additions & 0 deletions src/3d/render_instances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ PackedFloat32Array GeometryPool::get_raw_data(InstanceType _type, temp_raw_buffe
}
}
}
} else {
// Force reset stats
for (auto &proc : pools) {
auto &inst = proc.instances[(int)_type];
inst._prev_used_instant = inst.used_instant;
inst.used_delayed = 0;
}
}

return buffer.slice(0, last_added * INSTANCE_DATA_FLOAT_COUNT);
Expand Down

0 comments on commit f46527a

Please sign in to comment.