summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-07-02 20:14:19 -0300
committerreduz <reduzio@gmail.com>2021-07-03 10:15:04 -0300
commit6c55d2aad22cd5fc3a7f1499c4cb85779613a394 (patch)
tree13e55bfba5921dfa904b93830be058b2ca9cc175 /main
parentecf9ea740ef99afbfac94fc5da50988279fd9b9b (diff)
Fix Render Info
* Fixed and redone the process to obtain render information from a viewport * Some stats, such as material changes are too difficult to guess on Vulkan, were removed. * Separated visible and shadow stats, which causes confusion. * Texture, buffer and general video memory can be queried now. * Fixed the performance metrics too.
Diffstat (limited to 'main')
-rw-r--r--main/performance.cpp56
-rw-r--r--main/performance.h12
2 files changed, 22 insertions, 46 deletions
diff --git a/main/performance.cpp b/main/performance.cpp
index a2e53f2ee2..9f5be7b8c4 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -60,16 +60,12 @@ void Performance::_bind_methods() {
BIND_ENUM_CONSTANT(OBJECT_RESOURCE_COUNT);
BIND_ENUM_CONSTANT(OBJECT_NODE_COUNT);
BIND_ENUM_CONSTANT(OBJECT_ORPHAN_NODE_COUNT);
- BIND_ENUM_CONSTANT(RENDER_OBJECTS_IN_FRAME);
- BIND_ENUM_CONSTANT(RENDER_VERTICES_IN_FRAME);
- BIND_ENUM_CONSTANT(RENDER_MATERIAL_CHANGES_IN_FRAME);
- BIND_ENUM_CONSTANT(RENDER_SHADER_CHANGES_IN_FRAME);
- BIND_ENUM_CONSTANT(RENDER_SURFACE_CHANGES_IN_FRAME);
- BIND_ENUM_CONSTANT(RENDER_DRAW_CALLS_IN_FRAME);
+ BIND_ENUM_CONSTANT(RENDER_TOTAL_OBJECTS_IN_FRAME);
+ BIND_ENUM_CONSTANT(RENDER_TOTAL_PRIMITIVES_IN_FRAME);
+ BIND_ENUM_CONSTANT(RENDER_TOTAL_DRAW_CALLS_IN_FRAME);
BIND_ENUM_CONSTANT(RENDER_VIDEO_MEM_USED);
BIND_ENUM_CONSTANT(RENDER_TEXTURE_MEM_USED);
- BIND_ENUM_CONSTANT(RENDER_VERTEX_MEM_USED);
- BIND_ENUM_CONSTANT(RENDER_USAGE_VIDEO_MEM_TOTAL);
+ BIND_ENUM_CONSTANT(RENDER_BUFFER_MEM_USED);
BIND_ENUM_CONSTANT(PHYSICS_2D_ACTIVE_OBJECTS);
BIND_ENUM_CONSTANT(PHYSICS_2D_COLLISION_PAIRS);
BIND_ENUM_CONSTANT(PHYSICS_2D_ISLAND_COUNT);
@@ -103,16 +99,12 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
"object/resources",
"object/nodes",
"object/orphan_nodes",
- "raster/objects_drawn",
- "raster/vertices_drawn",
- "raster/mat_changes",
- "raster/shader_changes",
- "raster/surface_changes",
- "raster/draw_calls",
+ "raster/total_objects_drawn",
+ "raster/total_primitives_drawn",
+ "raster/total_draw_calls",
"video/video_mem",
"video/texture_mem",
- "video/vertex_mem",
- "video/video_mem_max",
+ "video/buffer_mem",
"physics_2d/active_objects",
"physics_2d/collision_pairs",
"physics_2d/islands",
@@ -148,26 +140,18 @@ float Performance::get_monitor(Monitor p_monitor) const {
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_TOTAL_OBJECTS_IN_FRAME:
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_INFO_TOTAL_OBJECTS_IN_FRAME);
+ case RENDER_TOTAL_PRIMITIVES_IN_FRAME:
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_INFO_TOTAL_PRIMITIVES_IN_FRAME);
+ case RENDER_TOTAL_DRAW_CALLS_IN_FRAME:
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME);
case RENDER_VIDEO_MEM_USED:
- return RS::get_singleton()->get_render_info(RS::INFO_VIDEO_MEM_USED);
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_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);
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_INFO_TEXTURE_MEM_USED);
+ case RENDER_BUFFER_MEM_USED:
+ return RS::get_singleton()->get_rendering_info(RS::RENDERING_INFO_BUFFER_MEM_USED);
case PHYSICS_2D_ACTIVE_OBJECTS:
return PhysicsServer2D::get_singleton()->get_process_info(PhysicsServer2D::INFO_ACTIVE_OBJECTS);
case PHYSICS_2D_COLLISION_PAIRS:
@@ -207,10 +191,6 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const
MONITOR_TYPE_QUANTITY,
MONITOR_TYPE_QUANTITY,
MONITOR_TYPE_QUANTITY,
- MONITOR_TYPE_QUANTITY,
- MONITOR_TYPE_QUANTITY,
- MONITOR_TYPE_QUANTITY,
- MONITOR_TYPE_MEMORY,
MONITOR_TYPE_MEMORY,
MONITOR_TYPE_MEMORY,
MONITOR_TYPE_MEMORY,
diff --git a/main/performance.h b/main/performance.h
index 122e5a4f9a..174b3500d1 100644
--- a/main/performance.h
+++ b/main/performance.h
@@ -73,16 +73,12 @@ public:
OBJECT_RESOURCE_COUNT,
OBJECT_NODE_COUNT,
OBJECT_ORPHAN_NODE_COUNT,
- RENDER_OBJECTS_IN_FRAME,
- RENDER_VERTICES_IN_FRAME,
- RENDER_MATERIAL_CHANGES_IN_FRAME,
- RENDER_SHADER_CHANGES_IN_FRAME,
- RENDER_SURFACE_CHANGES_IN_FRAME,
- RENDER_DRAW_CALLS_IN_FRAME,
+ RENDER_TOTAL_OBJECTS_IN_FRAME,
+ RENDER_TOTAL_PRIMITIVES_IN_FRAME,
+ RENDER_TOTAL_DRAW_CALLS_IN_FRAME,
RENDER_VIDEO_MEM_USED,
RENDER_TEXTURE_MEM_USED,
- RENDER_VERTEX_MEM_USED,
- RENDER_USAGE_VIDEO_MEM_TOTAL,
+ RENDER_BUFFER_MEM_USED,
PHYSICS_2D_ACTIVE_OBJECTS,
PHYSICS_2D_COLLISION_PAIRS,
PHYSICS_2D_ISLAND_COUNT,