From 9b0dd4f571ff431e23b9097e7f29746f4157be12 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 15 Jun 2019 23:45:24 -0300 Subject: A lot of progress with canvas rendering, still far from working. --- servers/visual/visual_server_raster.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 74a4265462..1b9f5b58b2 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -107,6 +107,8 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { VSG::viewport->draw_viewports(); VSG::scene->render_probes(); + VSG::canvas_render->update(); + _draw_margins(); VSG::rasterizer->end_frame(p_swap_buffers); -- cgit v1.2.3 From 2d6a916835bd851b2ea03a2e887ba83f0065dae4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 26 Aug 2019 17:43:58 -0300 Subject: Environment sky more or less working. --- servers/visual/visual_server_raster.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 1b9f5b58b2..0910bf3a9f 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -105,6 +105,8 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { VSG::scene->update_dirty_instances(); //update scene stuff + VSG::scene_render->update(); + VSG::viewport->draw_viewports(); VSG::scene->render_probes(); VSG::canvas_render->update(); -- cgit v1.2.3 From 920db604d26e2e82b6289807ad8a0607b310eef6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 6 Sep 2019 22:51:27 -0300 Subject: Rewrote large part of rendering, omni and spot shadows now work. --- servers/visual/visual_server_raster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 0910bf3a9f..2f25b8b015 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -103,9 +103,9 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { VSG::rasterizer->begin_frame(frame_step); - VSG::scene->update_dirty_instances(); //update scene stuff + VSG::scene_render->update(); //update scenes stuff before updating instances - VSG::scene_render->update(); + VSG::scene->update_dirty_instances(); //update scene stuff VSG::viewport->draw_viewports(); VSG::scene->render_probes(); -- cgit v1.2.3 From 123ee5995c989d7c2f0bb320fe94ef1702a48c13 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 20 Sep 2019 17:58:06 -0300 Subject: Visual GPU profiler and related profiling support in Vulkan. --- servers/visual/visual_server_raster.cpp | 37 ++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 2f25b8b015..513393c9c9 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -103,12 +103,14 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { VSG::rasterizer->begin_frame(frame_step); + VSG::storage->capture_timestamps_begin(); + VSG::scene_render->update(); //update scenes stuff before updating instances VSG::scene->update_dirty_instances(); //update scene stuff - VSG::viewport->draw_viewports(); VSG::scene->render_probes(); + VSG::viewport->draw_viewports(); VSG::canvas_render->update(); _draw_margins(); @@ -130,6 +132,25 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { frame_drawn_callbacks.pop_front(); } VS::get_singleton()->emit_signal("frame_post_draw"); + + if (VSG::storage->get_captured_timestamps_count()) { + Vector new_profile; + new_profile.resize(VSG::storage->get_captured_timestamps_count()); + + uint64_t base_cpu = VSG::storage->get_captured_timestamp_cpu_time(0); + uint64_t base_gpu = VSG::storage->get_captured_timestamp_gpu_time(0); + for (int i = 0; i < VSG::storage->get_captured_timestamps_count(); i++) { + uint64_t time_cpu = VSG::storage->get_captured_timestamp_cpu_time(i) - base_cpu; + uint64_t time_gpu = VSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu; + new_profile.write[i].gpu_msec = float(time_gpu / 1000) / 1000.0; + new_profile.write[i].cpu_msec = float(time_cpu) / 1000.0; + new_profile.write[i].name = VSG::storage->get_captured_timestamp_name(i); + } + + frame_profile = new_profile; + } + + frame_profile_frame = VSG::storage->get_captured_timestamps_frame(); } void VisualServerRaster::sync() { } @@ -167,6 +188,18 @@ String VisualServerRaster::get_video_adapter_vendor() const { return VSG::storage->get_video_adapter_vendor(); } +void VisualServerRaster::set_frame_profiling_enabled(bool p_enable) { + VSG::storage->capturing_timestamps = p_enable; +} + +uint64_t VisualServerRaster::get_frame_profile_frame() { + return frame_profile_frame; +} + +Vector VisualServerRaster::get_frame_profile() { + return frame_profile; +} + /* TESTING */ void VisualServerRaster::set_boot_image(const Ref &p_image, const Color &p_color, bool p_scale, bool p_use_filter) { @@ -217,6 +250,8 @@ VisualServerRaster::VisualServerRaster() { VSG::canvas_render = VSG::rasterizer->get_canvas(); VSG::scene_render = VSG::rasterizer->get_scene(); + frame_profile_frame = 0; + for (int i = 0; i < 4; i++) { black_margin[i] = 0; black_image[i] = RID(); -- cgit v1.2.3 From 965185c765bf5d17f0f035b7685dbaf4611e5288 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 3 Oct 2019 20:15:38 -0300 Subject: Better GIProbe quality settings. --- servers/visual/visual_server_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 513393c9c9..5bdbe6e93d 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -103,7 +103,7 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { VSG::rasterizer->begin_frame(frame_step); - VSG::storage->capture_timestamps_begin(); + TIMESTAMP_BEGIN() VSG::scene_render->update(); //update scenes stuff before updating instances -- cgit v1.2.3 From 4cac20aea32043c45304faca2eaf57da69525a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 12 Dec 2019 17:22:30 +0100 Subject: Fix crash after rebase on the master branch Apparently rasterizer is not initialized yet when this is called the first time, so it crashes. --- servers/visual/visual_server_raster.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'servers/visual/visual_server_raster.cpp') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 5bdbe6e93d..6599b9a2d2 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -238,7 +238,11 @@ void VisualServerRaster::call_set_use_vsync(bool p_enable) { } bool VisualServerRaster::is_low_end() const { - return VSG::rasterizer->is_low_end(); + // FIXME: Commented out when rebasing vulkan branch on master, + // causes a crash, it seems rasterizer is not initialized yet the + // first time it's called. + //return VSG::rasterizer->is_low_end(); + return false; } VisualServerRaster::VisualServerRaster() { -- cgit v1.2.3