Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add thread guard for force_draw and update related documentation #82953

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@
<param index="0" name="swap_buffers" type="bool" default="true" />
<param index="1" name="frame_step" type="float" default="0.0" />
<description>
Forces redrawing of all viewports at once.
Forces redrawing of all viewports at once. Must be called from the main thread.
</description>
</method>
<method name="force_sync">
Expand Down
1 change: 1 addition & 0 deletions servers/rendering/rendering_server_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ void RenderingServerDefault::sync() {
}

void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) {
ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "Manually triggering the draw function from the RenderingServer can only be done on the main thread. Call this function from the main thread or use call_deferred().");
if (create_thread) {
command_queue.push(this, &RenderingServerDefault::_thread_draw, p_swap_buffers, frame_step);
} else {
Expand Down
Loading