1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[Windows] Offload RenderingDevice creation test to subprocess.

This commit is contained in:
Pāvels Nadtočajevs
2025-02-24 11:25:54 +02:00
parent 39c201ca58
commit ab717497ef
11 changed files with 276 additions and 3 deletions

View File

@@ -979,6 +979,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String project_path = ".";
bool upwards = false;
String debug_uri = "";
#if defined(TOOLS_ENABLED) && defined(WINDOWS_ENABLED)
bool test_rd_creation = false;
bool test_rd_support = false;
#endif
bool skip_breakpoints = false;
String main_pack;
bool quiet_stdout = false;
@@ -1666,6 +1670,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
debug_canvas_item_redraw = true;
} else if (arg == "--debug-stringnames") {
StringName::set_debug_stringnames(true);
#endif
#if defined(TOOLS_ENABLED) && defined(WINDOWS_ENABLED)
} else if (arg == "--test-rd-support") {
test_rd_support = true;
} else if (arg == "--test-rd-creation") {
test_rd_creation = true;
#endif
} else if (arg == "--remote-debug") {
if (N) {
@@ -1870,6 +1880,30 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#endif
}
#if defined(TOOLS_ENABLED) && defined(WINDOWS_ENABLED)
if (test_rd_support) {
// Test Rendering Device creation and exit.
OS::get_singleton()->set_crash_handler_silent();
if (OS::get_singleton()->_test_create_rendering_device()) {
exit_err = ERR_HELP;
} else {
exit_err = ERR_UNAVAILABLE;
}
goto error;
} else if (test_rd_creation) {
// Test OpenGL context and Rendering Device simultaneous creation and exit.
OS::get_singleton()->set_crash_handler_silent();
if (OS::get_singleton()->_test_create_rendering_device_and_gl()) {
exit_err = ERR_HELP;
} else {
exit_err = ERR_UNAVAILABLE;
}
goto error;
}
#endif
#ifdef TOOLS_ENABLED
if (editor) {
Engine::get_singleton()->set_editor_hint(true);