diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-22 18:20:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 18:20:41 +0200 |
commit | d8ef904ffcad2ab07947918fcfdad59c2ea034d8 (patch) | |
tree | bb7cd54645ebd62c587ab2fcf1c423fc3ad0bb1b /servers | |
parent | 3ccff61979140493e4987f16558b5fab39b4b2b7 (diff) | |
parent | fc7333433b870fbc8961200f6689a7bf4ba6b90b (diff) |
Merge pull request #35758 from zmanuel/eliminate-draw-pending
Remove redundant thread sync counter draw_pending
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/rendering_server_default.cpp | 7 | ||||
-rw-r--r-- | servers/rendering/rendering_server_default.h | 1 |
2 files changed, 1 insertions, 7 deletions
diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 718f20f80a..3813db4b72 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -333,13 +333,10 @@ void RenderingServerDefault::_thread_exit() { } void RenderingServerDefault::_thread_draw(bool p_swap_buffers, double frame_step) { - if (!draw_pending.decrement()) { - _draw(p_swap_buffers, frame_step); - } + _draw(p_swap_buffers, frame_step); } void RenderingServerDefault::_thread_flush() { - draw_pending.decrement(); } void RenderingServerDefault::_thread_callback(void *_instance) { @@ -370,7 +367,6 @@ void RenderingServerDefault::_thread_loop() { void RenderingServerDefault::sync() { if (create_thread) { - draw_pending.increment(); command_queue.push_and_sync(this, &RenderingServerDefault::_thread_flush); } else { command_queue.flush_all(); //flush all pending from other threads @@ -379,7 +375,6 @@ void RenderingServerDefault::sync() { void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) { if (create_thread) { - draw_pending.increment(); command_queue.push(this, &RenderingServerDefault::_thread_draw, p_swap_buffers, frame_step); } else { _draw(p_swap_buffers, frame_step); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 56ab5891ed..2829dae837 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -84,7 +84,6 @@ class RenderingServerDefault : public RenderingServer { SafeFlag draw_thread_up; bool create_thread; - SafeNumeric<uint64_t> draw_pending; void _thread_draw(bool p_swap_buffers, double frame_step); void _thread_flush(); |