@@ -6160,20 +6160,28 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
61606160 if (rendering_context->initialize () != OK) {
61616161 memdelete (rendering_context);
61626162 rendering_context = nullptr ;
6163- r_error = ERR_CANT_CREATE;
6163+ bool fallback_to_opengl3 = GLOBAL_GET (" rendering/rendering_device/fallback_to_opengl3" );
6164+ if (fallback_to_opengl3 && rendering_driver != " opengl3" ) {
6165+ WARN_PRINT (" Your video card drivers seem not to support the required Vulkan version, switching to OpenGL 3." );
6166+ rendering_driver = " opengl3" ;
6167+ OS::get_singleton ()->set_current_rendering_method (" gl_compatibility" );
6168+ OS::get_singleton ()->set_current_rendering_driver_name (rendering_driver);
6169+ } else {
6170+ r_error = ERR_CANT_CREATE;
6171+
6172+ if (p_rendering_driver == " vulkan" ) {
6173+ OS::get_singleton ()->alert (
6174+ vformat (" Your video card drivers seem not to support the required Vulkan version.\n\n "
6175+ " If possible, consider updating your video card drivers or using the OpenGL 3 driver.\n\n "
6176+ " You can enable the OpenGL 3 driver by starting the engine from the\n "
6177+ " command line with the command:\n\n \" %s\" --rendering-driver opengl3\n\n "
6178+ " If you recently updated your video card drivers, try rebooting." ,
6179+ executable_name),
6180+ " Unable to initialize Vulkan video driver" );
6181+ }
61646182
6165- if (p_rendering_driver == " vulkan" ) {
6166- OS::get_singleton ()->alert (
6167- vformat (" Your video card drivers seem not to support the required Vulkan version.\n\n "
6168- " If possible, consider updating your video card drivers or using the OpenGL 3 driver.\n\n "
6169- " You can enable the OpenGL 3 driver by starting the engine from the\n "
6170- " command line with the command:\n\n \" %s\" --rendering-driver opengl3\n\n "
6171- " If you recently updated your video card drivers, try rebooting." ,
6172- executable_name),
6173- " Unable to initialize Vulkan video driver" );
6183+ ERR_FAIL_MSG (vformat (" Could not initialize %s" , rendering_driver));
61746184 }
6175-
6176- ERR_FAIL_MSG (vformat (" Could not initialize %s" , rendering_driver));
61776185 }
61786186 driver_found = true ;
61796187 }
0 commit comments