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

Fix initialization of visual server in all platforms #23434

Merged
merged 1 commit into from
Nov 1, 2018
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
9 changes: 5 additions & 4 deletions platform/android/os_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "file_access_android.h"
#include "main/main.h"
#include "servers/visual/visual_server_raster.h"
//#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual/visual_server_wrap_mt.h"

#ifdef ANDROID_NATIVE_ACTIVITY
#include "dir_access_android.h"
Expand Down Expand Up @@ -182,11 +182,12 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int

video_driver_index = p_video_driver;

visual_server = memnew(VisualServerRaster);
/* if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {

visual_server = memnew(VisualServerWrapMT(visual_server, false));
};*/
} else {
visual_server = memnew(VisualServerRaster);
}

visual_server->init();
// visual_server->cursor_set_visible(false, 0);
Expand Down
15 changes: 7 additions & 8 deletions platform/haiku/os_haiku.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p

#endif

visual_server = memnew(VisualServerRaster());

ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);

// TODO: enable multithreaded VS
/*
// FIXME: Reimplement threaded rendering? Or remove?
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));

visual_server = memnew(VisualServerWrapMT(visual_server, false));
} else {
visual_server = memnew(VisualServerRaster);
}
*/

ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);

video_driver_index = p_video_driver;

Expand Down
11 changes: 5 additions & 6 deletions platform/iphone/os_iphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "drivers/gles3/rasterizer_gles3.h"
#include "servers/visual/visual_server_raster.h"
//#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual/visual_server_wrap_mt.h"

#include "main/main.h"

Expand Down Expand Up @@ -107,13 +107,12 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();

visual_server = memnew(VisualServerRaster());
/*
FIXME: Reimplement threaded rendering? Or remove?
// FIXME: Reimplement threaded rendering? Or remove?
akien-mga marked this conversation as resolved.
Show resolved Hide resolved
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, false));
};
*/
} else {
visual_server = memnew(VisualServerRaster);
}

visual_server->init();
//visual_server->cursor_set_visible(false, 0);
Expand Down
3 changes: 2 additions & 1 deletion platform/osx/os_osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1383,10 +1383,11 @@ static void displays_arrangement_changed(CGDirectDisplayID display_id, CGDisplay

video_driver_index = p_video_driver;

visual_server = memnew(VisualServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {

visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
} else {
visual_server = memnew(VisualServerRaster);
}

visual_server->init();
Expand Down
7 changes: 3 additions & 4 deletions platform/uwp/os_uwp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,13 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au

set_video_mode(vm);

visual_server = memnew(VisualServerRaster);
// FIXME: Reimplement threaded rendering? Or remove?
/*
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {

visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
visual_server = memnew(VisualServerWrapMT(visual_server, false));
} else {
visual_server = memnew(VisualServerRaster);
}
*/

visual_server->init();
input = memnew(InputDefault);
Expand Down
3 changes: 2 additions & 1 deletion platform/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,10 +1332,11 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
gl_context->set_use_vsync(video_mode.use_vsync);
#endif

visual_server = memnew(VisualServerRaster);
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {

visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
} else {
visual_server = memnew(VisualServerRaster);
}

/*
Expand Down
3 changes: 2 additions & 1 deletion platform/x11/os_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,12 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
context_gl->set_use_vsync(current_videomode.use_vsync);

#endif
visual_server = memnew(VisualServerRaster);

if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {

visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
} else {
visual_server = memnew(VisualServerRaster);
}
if (current_videomode.maximized) {
current_videomode.maximized = false;
Expand Down