diff options
Diffstat (limited to 'servers/rendering/rendering_server_default.cpp')
-rw-r--r-- | servers/rendering/rendering_server_default.cpp | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 629d212b69..e3ebebca86 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -42,26 +42,6 @@ int RenderingServerDefault::changes = 0; -/* BLACK BARS */ - -void RenderingServerDefault::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) { - black_margin[SIDE_LEFT] = p_left; - black_margin[SIDE_TOP] = p_top; - black_margin[SIDE_RIGHT] = p_right; - black_margin[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) { - black_image[SIDE_LEFT] = p_left; - black_image[SIDE_TOP] = p_top; - black_image[SIDE_RIGHT] = p_right; - black_image[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::_draw_margins() { - RSG::canvas_render->draw_window_margins(black_margin, black_image); -}; - /* FREE */ void RenderingServerDefault::_free(RID p_rid) { @@ -114,7 +94,6 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { RSG::viewport->draw_viewports(); RSG::canvas_render->update(); - _draw_margins(); RSG::rasterizer->end_frame(p_swap_buffers); RSG::canvas->update_visibility_notifiers(); @@ -210,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 { @@ -260,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 { @@ -410,11 +398,6 @@ RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : sr->set_scene_render(RSG::rasterizer->get_scene()); frame_profile_frame = 0; - - for (int i = 0; i < 4; i++) { - black_margin[i] = 0; - black_image[i] = RID(); - } } RenderingServerDefault::~RenderingServerDefault() { |