summaryrefslogtreecommitdiff
path: root/servers/rendering/rendering_server_default.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/rendering/rendering_server_default.cpp')
-rw-r--r--servers/rendering/rendering_server_default.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp
index 47f7fa07d5..da6c3ef6f4 100644
--- a/servers/rendering/rendering_server_default.cpp
+++ b/servers/rendering/rendering_server_default.cpp
@@ -45,17 +45,17 @@ 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[MARGIN_LEFT] = p_left;
- black_margin[MARGIN_TOP] = p_top;
- black_margin[MARGIN_RIGHT] = p_right;
- black_margin[MARGIN_BOTTOM] = 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[MARGIN_LEFT] = p_left;
- black_image[MARGIN_TOP] = p_top;
- black_image[MARGIN_RIGHT] = p_right;
- black_image[MARGIN_BOTTOM] = 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() {
@@ -101,11 +101,16 @@ void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) {
TIMESTAMP_BEGIN()
+ uint64_t time_usec = OS::get_singleton()->get_ticks_usec();
+
RSG::scene->update(); //update scenes stuff before updating instances
+ frame_setup_time = double(OS::get_singleton()->get_ticks_usec() - time_usec) / 1000.0;
+
RSG::storage->update_particles(); //need to be done after instances are updated (colliders and particle transforms), and colliders are rendered
RSG::scene->render_probes();
+
RSG::viewport->draw_viewports();
RSG::canvas_render->update();
@@ -159,6 +164,10 @@ void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) {
frame_profile_frame = RSG::storage->get_captured_timestamps_frame();
}
+float RenderingServerDefault::get_frame_setup_time_cpu() const {
+ return frame_setup_time;
+}
+
void RenderingServerDefault::sync() {
}