summaryrefslogtreecommitdiff
path: root/servers/rendering/rendering_server_default.cpp
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 /servers/rendering/rendering_server_default.cpp
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 'servers/rendering/rendering_server_default.cpp')
-rw-r--r--servers/rendering/rendering_server_default.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp
index aad6163a16..e3ebebca86 100644
--- a/servers/rendering/rendering_server_default.cpp
+++ b/servers/rendering/rendering_server_default.cpp
@@ -189,6 +189,8 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) {
print_frame_profile_frame_count = 0;
}
}
+
+ RSG::storage->update_memory_info();
}
float RenderingServerDefault::get_frame_setup_time_cpu() const {
@@ -239,8 +241,15 @@ void RenderingServerDefault::finish() {
/* STATUS INFORMATION */
-uint64_t RenderingServerDefault::get_render_info(RenderInfo p_info) {
- return RSG::storage->get_render_info(p_info);
+uint64_t RenderingServerDefault::get_rendering_info(RenderingInfo p_info) {
+ if (p_info == RENDERING_INFO_TOTAL_OBJECTS_IN_FRAME) {
+ return RSG::viewport->get_total_objects_drawn();
+ } else if (p_info == RENDERING_INFO_TOTAL_PRIMITIVES_IN_FRAME) {
+ return RSG::viewport->get_total_vertices_drawn();
+ } else if (p_info == RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME) {
+ return RSG::viewport->get_total_draw_calls_used();
+ }
+ return RSG::storage->get_rendering_info(p_info);
}
String RenderingServerDefault::get_video_adapter_name() const {