Merge pull request #71561 from akien-mga/android-displayserver-duplicate-error

Improve DisplayServer message for video card drivers failure
This commit is contained in:
Rémi Verschelde 2023-01-17 17:31:13 +01:00
commit f0326297b3
No known key found for this signature in database
GPG key ID: C3336907360768E1
6 changed files with 51 additions and 63 deletions

View file

@ -466,14 +466,15 @@ Vector<String> DisplayServerAndroid::get_rendering_drivers_func() {
DisplayServer *DisplayServerAndroid::create_func(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error) { DisplayServer *DisplayServerAndroid::create_func(const String &p_rendering_driver, DisplayServer::WindowMode p_mode, DisplayServer::VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error) {
DisplayServer *ds = memnew(DisplayServerAndroid(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, r_error)); DisplayServer *ds = memnew(DisplayServerAndroid(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_position, p_resolution, p_screen, r_error));
if (r_error != OK) { if (r_error != OK) {
OS::get_singleton()->alert("Your video card driver does not support any of the supported Vulkan versions.", "Unable to initialize Video driver");
if (p_rendering_driver == "vulkan") { if (p_rendering_driver == "vulkan") {
OS::get_singleton()->alert("Your video card driver does not support the selected Vulkan version.\n" OS::get_singleton()->alert(
"Please try exporting your game using the gl_compatibility renderer.", "Your device seems not to support the required Vulkan version.\n\n"
"Unable to initialize Video driver"); "Please try exporting your game using the 'gl_compatibility' renderer.",
"Unable to initialize Vulkan video driver");
} else { } else {
OS::get_singleton()->alert("Your video card driver does not support OpenGL ES 3.0.", OS::get_singleton()->alert(
"Unable to initialize Video driver"); "Your device seems not to support the required OpenGL ES 3.0 version.",
"Unable to initialize OpenGL video driver");
} }
} }
return ds; return ds;

View file

@ -56,16 +56,9 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
tts = [[TTS_IOS alloc] init]; tts = [[TTS_IOS alloc] init];
#if defined(GLES3_ENABLED) #if defined(GLES3_ENABLED)
// FIXME: Add support for both OpenGL and Vulkan when OpenGL is implemented
// again,
// Note that we should be checking "opengl3" as the driver, might never enable this seeing OpenGL is deprecated on iOS
// We are hardcoding the rendering_driver to "vulkan" down below
if (rendering_driver == "opengl3") { if (rendering_driver == "opengl3") {
bool gl_initialization_error = false; bool gl_initialization_error = false;
// FIXME: Add Vulkan support via MoltenVK. Add fallback code back?
if (RasterizerGLES3::is_viable() == OK) { if (RasterizerGLES3::is_viable() == OK) {
RasterizerGLES3::register_config(); RasterizerGLES3::register_config();
RasterizerGLES3::make_current(); RasterizerGLES3::make_current();
@ -74,22 +67,10 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
} }
if (gl_initialization_error) { if (gl_initialization_error) {
OS::get_singleton()->alert("Your device does not support any of the supported OpenGL versions.", "Unable to initialize video driver"); OS::get_singleton()->alert(
// return ERR_UNAVAILABLE; "Your device seems not to support the required OpenGL ES 3.0 version.\n\n",
"Unable to initialize OpenGL video driver");
} }
// rendering_server = memnew(RenderingServerDefault);
// // FIXME: Reimplement threaded rendering
// if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
// rendering_server = memnew(RenderingServerWrapMT(rendering_server,
// false));
// }
// rendering_server->init();
// rendering_server->cursor_set_visible(false, 0);
// reset this to what it should be, it will have been set to 0 after
// rendering_server->init() is called
// RasterizerStorageGLES3system_fbo = gl_view_base_fb;
} }
#endif #endif

View file

@ -4576,18 +4576,20 @@ DisplayServer *DisplayServerX11::create_func(const String &p_rendering_driver, W
if (r_error != OK) { if (r_error != OK) {
if (p_rendering_driver == "vulkan") { if (p_rendering_driver == "vulkan") {
String executable_name = OS::get_singleton()->get_executable_path().get_file(); String executable_name = OS::get_singleton()->get_executable_path().get_file();
OS::get_singleton()->alert("Your video card driver does not support the selected Vulkan version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver or try using the OpenGL 3 driver.\n" vformat("Your video card drivers seem not to support the required Vulkan version.\n\n"
"You can enable the OpenGL 3 driver by starting the engine from the\n" "If possible, consider updating your video card drivers or using the OpenGL 3 driver.\n\n"
"command line with the command:\n'./" + "You can enable the OpenGL 3 driver by starting the engine from the\n"
executable_name + " --rendering-driver opengl3'.\n " "command line with the command:\n'%s --rendering-driver opengl3'\n\n"
"If you have updated your graphics drivers recently, try rebooting.", "If you recently updated your video card drivers, try rebooting.",
"Unable to initialize Video driver"); executable_name),
"Unable to initialize Vulkan video driver");
} else { } else {
OS::get_singleton()->alert("Your video card driver does not support the selected OpenGL version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver.\n" "Your video card drivers seem not to support the required OpenGL 3.3 version.\n\n"
"If you have updated your graphics drivers recently, try rebooting.", "If possible, consider updating your video card drivers.\n\n"
"Unable to initialize Video driver"); "If you recently updated your video card drivers, try rebooting.",
"Unable to initialize OpenGL video driver");
} }
} }
return ds; return ds;

View file

@ -3607,18 +3607,18 @@ DisplayServer *DisplayServerMacOS::create_func(const String &p_rendering_driver,
} else { } else {
executable_command = vformat("open %s --args --rendering-driver opengl3", OS::get_singleton()->get_bundle_resource_dir().path_join("../..").simplify_path()); executable_command = vformat("open %s --args --rendering-driver opengl3", OS::get_singleton()->get_bundle_resource_dir().path_join("../..").simplify_path());
} }
OS::get_singleton()->alert("Your video card driver does not support the selected Vulkan version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver or try using the OpenGL 3 driver.\n" vformat("Your video card drivers seem not to support the required Vulkan version.\n\n"
"You can enable the OpenGL 3 driver by starting the engine from the\n" "If possible, consider updating your macOS version or using the OpenGL 3 driver.\n\n"
"command line with the command: '" + "You can enable the OpenGL 3 driver by starting the engine from the\n"
executable_command + "'.\n" "command line with the command:\n'%s'",
"If you have updated your graphics drivers recently, try rebooting.", executable_command),
"Unable to initialize Video driver"); "Unable to initialize Vulkan video driver");
} else { } else {
OS::get_singleton()->alert("Your video card driver does not support the selected OpenGL version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver.\n" "Your video card drivers seem not to support the required OpenGL 3.3 version.\n\n"
"If you have updated your graphics drivers recently, try rebooting.", "If possible, consider updating your macOS version.",
"Unable to initialize Video driver"); "Unable to initialize OpenGL video driver");
} }
} }
return ds; return ds;

View file

@ -787,8 +787,10 @@ DisplayServerWeb::DisplayServerWeb(const String &p_rendering_driver, WindowMode
RasterizerGLES3::make_current(); RasterizerGLES3::make_current();
} else { } else {
OS::get_singleton()->alert("Your browser does not seem to support WebGL2. Please update your browser version.", OS::get_singleton()->alert(
"Unable to initialize video driver"); "Your browser seems not to support WebGL 2.\n\n"
"If possible, consider updating your browser version and video card drivers.",
"Unable to initialize WebGL 2 video driver");
RasterizerDummy::make_current(); RasterizerDummy::make_current();
} }
#else #else

View file

@ -4145,18 +4145,20 @@ DisplayServer *DisplayServerWindows::create_func(const String &p_rendering_drive
if (r_error != OK) { if (r_error != OK) {
if (p_rendering_driver == "vulkan") { if (p_rendering_driver == "vulkan") {
String executable_name = OS::get_singleton()->get_executable_path().get_file(); String executable_name = OS::get_singleton()->get_executable_path().get_file();
OS::get_singleton()->alert("Your video card driver does not support the selected Vulkan version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver or try using the OpenGL 3 driver.\n" vformat("Your video card drivers seem not to support the required Vulkan version.\n\n"
"You can enable the OpenGL 3 driver by starting the engine from the\n" "If possible, consider updating your video card drivers or using the OpenGL 3 driver.\n\n"
"command line with the command:\n'./" + "You can enable the OpenGL 3 driver by starting the engine from the\n"
executable_name + " --rendering-driver opengl3'.\n " "command line with the command:\n'%s --rendering-driver opengl3'\n\n"
"If you have updated your graphics drivers recently, try rebooting.", "If you have recently updated your video card drivers, try rebooting.",
"Unable to initialize Video driver"); executable_name),
"Unable to initialize Vulkan video driver");
} else { } else {
OS::get_singleton()->alert("Your video card driver does not support the selected OpenGL version.\n" OS::get_singleton()->alert(
"Please try updating your GPU driver.\n" "Your video card drivers seem not to support the required OpenGL 3.3 version.\n\n"
"If you have updated your graphics drivers recently, try rebooting.", "If possible, consider updating your video card drivers.\n\n"
"Unable to initialize Video driver"); "If you have recently updated your video card drivers, try rebooting.",
"Unable to initialize OpenGL video driver");
} }
} }
return ds; return ds;