summaryrefslogtreecommitdiff
path: root/main/performance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/performance.cpp')
-rw-r--r--main/performance.cpp81
1 files changed, 54 insertions, 27 deletions
diff --git a/main/performance.cpp b/main/performance.cpp
index 3ca7d7bed8..3de2cba125 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -125,33 +125,60 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
float Performance::get_monitor(Monitor p_monitor) const {
switch (p_monitor) {
- case TIME_FPS: return Engine::get_singleton()->get_frames_per_second();
- case TIME_PROCESS: return _process_time;
- case TIME_PHYSICS_PROCESS: return _physics_process_time;
- case MEMORY_STATIC: return Memory::get_mem_usage();
- case MEMORY_STATIC_MAX: return Memory::get_mem_max_usage();
- case MEMORY_MESSAGE_BUFFER_MAX: return MessageQueue::get_singleton()->get_max_buffer_usage();
- case OBJECT_COUNT: return ObjectDB::get_object_count();
- case OBJECT_RESOURCE_COUNT: return ResourceCache::get_cached_resource_count();
- case OBJECT_NODE_COUNT: return _get_node_count();
- case OBJECT_ORPHAN_NODE_COUNT: return Node::orphan_node_count;
- case RENDER_OBJECTS_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_OBJECTS_IN_FRAME);
- case RENDER_VERTICES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_VERTICES_IN_FRAME);
- case RENDER_MATERIAL_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_MATERIAL_CHANGES_IN_FRAME);
- case RENDER_SHADER_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_SHADER_CHANGES_IN_FRAME);
- case RENDER_SURFACE_CHANGES_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_SURFACE_CHANGES_IN_FRAME);
- case RENDER_DRAW_CALLS_IN_FRAME: return RS::get_singleton()->get_render_info(RS::INFO_DRAW_CALLS_IN_FRAME);
- case RENDER_VIDEO_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_VIDEO_MEM_USED);
- case RENDER_TEXTURE_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_TEXTURE_MEM_USED);
- case RENDER_VERTEX_MEM_USED: return RS::get_singleton()->get_render_info(RS::INFO_VERTEX_MEM_USED);
- case RENDER_USAGE_VIDEO_MEM_TOTAL: return RS::get_singleton()->get_render_info(RS::INFO_USAGE_VIDEO_MEM_TOTAL);
- case PHYSICS_2D_ACTIVE_OBJECTS: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ACTIVE_OBJECTS);
- case PHYSICS_2D_COLLISION_PAIRS: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_COLLISION_PAIRS);
- case PHYSICS_2D_ISLAND_COUNT: return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ISLAND_COUNT);
- case PHYSICS_3D_ACTIVE_OBJECTS: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ACTIVE_OBJECTS);
- case PHYSICS_3D_COLLISION_PAIRS: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_COLLISION_PAIRS);
- case PHYSICS_3D_ISLAND_COUNT: return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ISLAND_COUNT);
- case AUDIO_OUTPUT_LATENCY: return AudioServer::get_singleton()->get_output_latency();
+ case TIME_FPS:
+ return Engine::get_singleton()->get_frames_per_second();
+ case TIME_PROCESS:
+ return _process_time;
+ case TIME_PHYSICS_PROCESS:
+ return _physics_process_time;
+ case MEMORY_STATIC:
+ return Memory::get_mem_usage();
+ case MEMORY_STATIC_MAX:
+ return Memory::get_mem_max_usage();
+ case MEMORY_MESSAGE_BUFFER_MAX:
+ return MessageQueue::get_singleton()->get_max_buffer_usage();
+ case OBJECT_COUNT:
+ return ObjectDB::get_object_count();
+ case OBJECT_RESOURCE_COUNT:
+ return ResourceCache::get_cached_resource_count();
+ case OBJECT_NODE_COUNT:
+ return _get_node_count();
+ case OBJECT_ORPHAN_NODE_COUNT:
+ return Node::orphan_node_count;
+ case RENDER_OBJECTS_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_OBJECTS_IN_FRAME);
+ case RENDER_VERTICES_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_VERTICES_IN_FRAME);
+ case RENDER_MATERIAL_CHANGES_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_MATERIAL_CHANGES_IN_FRAME);
+ case RENDER_SHADER_CHANGES_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_SHADER_CHANGES_IN_FRAME);
+ case RENDER_SURFACE_CHANGES_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_SURFACE_CHANGES_IN_FRAME);
+ case RENDER_DRAW_CALLS_IN_FRAME:
+ return RS::get_singleton()->get_render_info(RS::INFO_DRAW_CALLS_IN_FRAME);
+ case RENDER_VIDEO_MEM_USED:
+ return RS::get_singleton()->get_render_info(RS::INFO_VIDEO_MEM_USED);
+ case RENDER_TEXTURE_MEM_USED:
+ return RS::get_singleton()->get_render_info(RS::INFO_TEXTURE_MEM_USED);
+ case RENDER_VERTEX_MEM_USED:
+ return RS::get_singleton()->get_render_info(RS::INFO_VERTEX_MEM_USED);
+ case RENDER_USAGE_VIDEO_MEM_TOTAL:
+ return RS::get_singleton()->get_render_info(RS::INFO_USAGE_VIDEO_MEM_TOTAL);
+ case PHYSICS_2D_ACTIVE_OBJECTS:
+ return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_2D_COLLISION_PAIRS:
+ return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_COLLISION_PAIRS);
+ case PHYSICS_2D_ISLAND_COUNT:
+ return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ISLAND_COUNT);
+ case PHYSICS_3D_ACTIVE_OBJECTS:
+ return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ACTIVE_OBJECTS);
+ case PHYSICS_3D_COLLISION_PAIRS:
+ return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_COLLISION_PAIRS);
+ case PHYSICS_3D_ISLAND_COUNT:
+ return PhysicsServer3D::get_singleton()->get_process_info(PhysicsServer3D::INFO_ISLAND_COUNT);
+ case AUDIO_OUTPUT_LATENCY:
+ return AudioServer::get_singleton()->get_output_latency();
default: {
}